惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
Arctic Wolf
T
Tor Project blog
G
GRAHAM CLULEY
I
InfoQ
博客园_首页
IT之家
IT之家
The Register - Security
The Register - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
K
Kaspersky official blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
U
Unit 42
PCI Perspectives
PCI Perspectives
量子位
P
Palo Alto Networks Blog
S
Securelist
T
Troy Hunt's Blog
博客园 - 【当耐特】
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
罗磊的独立博客
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
NISL@THU
NISL@THU
C
Cisco Blogs
T
Threatpost
有赞技术团队
有赞技术团队
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security

博客园 - Valen

命令方式启动SQL服务 tomcat中显示文件目录 equals中NullPointerException问题解决 - Valen - 博客园 JSTL与EL表达式简单应用 - Valen - 博客园 Java,Hibernate,Sql之间数据类型对应表 转:Java调用正则表达式 - Valen - 博客园 Jsp中EL表达式不能显示的解决方法 JAVA读取Properties的六种方法 Jsp中errorPage使用及web.xml配置 - Valen - 博客园 Install JSEclipse Method 备份你的手机通讯录到网络吧! vsftpd 配置 解决fedora11 root用户登录问题 Windows与Vmware下的Linux文件共享方法 Windows Live 设置 雷人签名 ob_start 用法 分页算法(1) 小沈阳 "不差钱" 改编版
Jsp重定向forward和sendRedirect的区别
Valen · 2009-10-11 · via 博客园 - Valen

1,forward工作原理

这种方式是服务器端的重定向,服务器端往客户端发送数据的过程是,先将数据输出到缓冲区,再将缓冲区的数据输出到客户端。

什么时候从缓冲区将数据输出到客户端呢?

a,当对客户端发送的请求全部处理完,并输出到缓冲区

b,当缓冲区满

c,在程序中调用换成去的方法out.flush(),respone.flushbuffer(),才将数据发送到客户端

这种重定向方式是采用服务器的缓冲区机制,在把缓冲区的数据发送到客户端之前,原来的数据不发送,只执行重定向页面,发送重定向页面的数据,重定向调用页的数据将被清除,如果在<jsp:forward>之前有很多输出,前面的输出致使缓冲区满,将自动输出到客户端,重定向不起作用

d,forward重定向时,地址不会变更,可以传递一个实例

2,sendRedirect

这种方式是客户端的重定向,该方法是通过修改http协议的head部分,该方法可以重定向相对路径和绝对路径,该方法传递方式只能通过?aaa=bbb方式,所以request不起作用,因为重定向后不是一个application