getRequestDispatcher

来源:互联网 发布:mac怎么玩美服lol 编辑:程序博客网 时间:2024/06/11 03:50

getRequestDispatcher

public RequestDispatcher getRequestDispatcher(String path)
Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path. ARequestDispatcher object can be used to forward a request to the resource or to include the resource in a response. The resource can be dynamic or static.

The pathname specified may be relative, although it cannot extend outside the current servlet context. If the path begins with a "/" it is interpreted as relative to the current context root. This method returnsnull if the servlet container cannot return a RequestDispatcher.

The difference between this method and ServletContext.getRequestDispatcher(java.lang.String) is that this method can take a relative path.

Parameters:
path - a String specifying the pathname to the resource. If it is relative, it must be relative against the current servlet.
Returns:
a RequestDispatcher object that acts as a wrapper for the resource at the specified path, ornull if the servlet container cannot return a RequestDispatcher
0 0
原创粉丝点击