sendRedirect和forword的区别
来源:互联网 发布:北京乐乎 编辑:程序博客网 时间:2024/05/15 07:14
以下内容来自API文档:
public interface RequestDispatcher
Defines an object that receives requests from the client and sends them to any resource (such as a servlet, HTML file, or JSP file) on the server. The servlet container creates the RequestDispatcher object, which is used as a wrapper around a server resource located at a particular path or given by a particular name.
This interface is intended to wrap servlets, but a servlet container can create RequestDispatcher objects to wrap any type of resource.
/*参数: request - a ServletRequest object that represents the request the client makes of the servlet response - a ServletResponse object that represents the response the servlet returns to the client异常: ServletException - if the target resource throws this exception IOException - if the target resource throws this exception IllegalStateException - if the response was already committed*/void forward(ServletRequest request, ServletResponse response) throws ServletException, IOException
Forwards a request from a servlet to another resource (servlet, JSP file, or HTML file) on the server. This method allows one servlet to do preliminary processing of a request and another resource to generate the response.
For a RequestDispatcher obtained via getRequestDispatcher(), the ServletRequest object has its path elements and parameters adjusted to match the path of the target resource.
forward should be called before the response has been committed to the client (before response body output has been flushed). If the response already has been committed, this method throws an IllegalStateException. Uncommitted output in the response buffer is automatically cleared before the forward.
The request and response parameters must be either the same objects as were passed to the calling servlet’s service method or be subclasses of the ServletRequestWrapper or ServletResponseWrapper classes that wrap them.
This method sets the dispatcher type of the given request to DispatcherType.FORWARD.
- sendRedirect和forword的区别
- Forword和SendRedirect区别
- sendRedirect&forword的区别
- jsp中forword和sendRedirect的区别
- jsp中forword和sendRedirect的区别
- jsp中forword和sendRedirect的区别
- forword和sendRedirect传值的区别
- jsp中forword和sendRedirect的区别
- forword和sendRedirect传值的区别
- jsp中forword和sendRedirect的区别
- 【面试】Forword和SendRedirect区别
- forword与sendRedirect的区别
- sendRedirect&forword的区别2
- 比较jsp中forword和sendredirect的区别
- servlet中forword与sendredirect的区别
- servlet中forword与sendredirect的区别
- forword和sendRedirect
- 图解SendRedirect、include、forword三者的区别
- 认识Linux及创建虚拟机和安装CentOS7
- Web应用的负载均衡、集群、高可用(HA)解决方案整理总结
- 大数据早报:美信用评级机构Equifax再遭黑客入侵 迪拜机场拟取消普通护照检查,全面采用人脸识别技术(10.17)
- redis、memcache远程管理的方法!
- ubuntu下 Navicat for mysql破解方法
- sendRedirect和forword的区别
- 在bootstrap模态框modal里使用clipboard.js时复制失效
- OAuth2开发者指南—服务端
- leetcode题解-1. Two Sum
- [Oracle 11g r2(11.2.0.4.0)]案例分析3-由于同一个子网中存在同名集群导致的gpnp 无法启动
- SwitchHosts—hosts管理利器
- Python爬虫-爬取百度贴吧的帖子并写入文件
- Java多线程编程-(1)-线程安全和锁Synchronized概念
- 数据结构实验之栈与队列六:下一较大值(二)