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

推荐订阅源

N
Netflix TechBlog - Medium
V
Vulnerabilities – Threatpost
Google Online Security Blog
Google Online Security Blog
Hugging Face - Blog
Hugging Face - Blog
L
LINUX DO - 热门话题
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
D
Docker
C
Cyber Attacks, Cyber Crime and Cyber Security
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
T
Tenable Blog
P
Privacy International News Feed
Google DeepMind News
Google DeepMind News
小众软件
小众软件
Cisco Talos Blog
Cisco Talos Blog
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
A
Arctic Wolf
C
Cybersecurity and Infrastructure Security Agency CISA
C
Cisco Blogs
T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
The Hacker News
The Hacker News
Project Zero
Project Zero
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threatpost
V
Visual Studio Blog
The GitHub Blog
The GitHub Blog
The Cloudflare Blog
Last Week in AI
Last Week in AI
Jina AI
Jina AI
Cyberwarzone
Cyberwarzone
The Register - Security
The Register - Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
MongoDB | Blog
MongoDB | Blog
U
Unit 42
Scott Helme
Scott Helme
A
About on SuperTechFans
WordPress大学
WordPress大学
F
Fortinet All Blogs
大猫的无限游戏
大猫的无限游戏
G
GRAHAM CLULEY
Latest news
Latest news
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
Schneier on Security

博客园 - Snow*Cao

vs2010 调试快捷键 温故而知新:封装、继承、多态 海量的jQuery插件帖,很经典 委托事件的理解(转载) 常用JQuery插件整理 关于数据挖掘的详细介绍的一些网址 DropDownList 默认展示从数据库查询的值 Python 开发环境搭建 WCF优秀资源整理--持续更新 Python入门视频教程 txt文本导入到sql server数据库 抽象基类与接口,共性与个性的选择!(区别) C#中值类型和引用类型 通过IIS自带工具Iisapp.vbs查询哪个站点占用资源 主键与外键 分布式缓存BeIT Memcached简介 HttpHandlers和HttpModules接口详解 ASP.NET页面运行机制 jquery跨域获取数据以及分页 - Snow*Cao - 博客园
request 生命周期及参数信息
Snow*Cao · 2012-12-27 · via 博客园 - Snow*Cao

     当从一个jsp发出一个request,即表明了这个request生命周期的开始,当到达action之后一般有两种处理request的方式,一种为request.getDispatcher.forward,一种是response.sendRedirect。
对于request的forward,该request的生命周期将会继续延续下去,当采用forward如果到达JSP页面,那么之前从第一个JSP页面中发送出来的request的消息将仍然存在,新的页面同样能够取得该request里所包含的一些信息,比如之前的JSP发送request中所包含的参数信息.事实上,它们是同一个request.

而如果是使用response.sendRedirect那么该request的生命周期将结束.

对于request,对request信息的传递,只有setAttribute()这一个方法,该方法将设置一个Object对象到request中.
但是,如果当一个request是从jsp从发出,包含的信息段为param1=test这样的方式,那么只能通过getParameter()得到,getAttribute()是得不到param1的value的.
再次,对于JSP的EL表达式,${}这中方式只能得到setAttribute中的值,因此当从一个JSP发送request到达action并且被forward到新的JSP中时,如果想在该JSP中取得JSP发送时的参数信息需要写为这种形式:${param.patam1}.