getRequestDispatcher

getRequestDispatcher

public RequestDispatcher getRequestDispatcher(java.lang.String path)

Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path. A RequestDispatcher 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.

返回一个RequestDispatcher对象,该对象充当位于给定路径的资源的包装器。RequestDispatcher对象可用于将请求转发给资源,或将资源包含在响应中。资源可以是动态的,也可以是静态的。

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 returns null if the servlet container cannot return a RequestDispatcher.

指定的路径名可以是相对的,但其不能扩展到当前servlet上下文之外。如果路径以“/”开头,则将被解释为相对于当前上下文根路径。如果servlet容器无法返回RequestDispatcher,则该方法返回null。

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

此方法与  ServletContext.getRequestDispatcher(java.lang.String) 之间的区别,在于该方法可以采用相对路径。

Parameters:

path - a String specifying the pathname to the resource. If it is relative, it must be relative against the current servlet.

Returns:

RequestDispatcher object that acts as a wrapper for the resource at the specified path, or null if the servlet container cannot return a RequestDispatcher

See Also:

RequestDispatcherServletContext.getRequestDispatcher(java.lang.String)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值