根据
Servlet
的标准的重大变化决定了版本号从
2.4
跳跃到了
2.5
。
在这个发行的标准中 , 有四个详细的阐明 , 二个对其它文档的改变 , 增加了六个主要变化。
很多大的改变是通过使用 JDK1.5 的新特性带来的。
在这个发行的标准中 , 有四个详细的阐明 , 二个对其它文档的改变 , 增加了六个主要变化。
很多大的改变是通过使用 JDK1.5 的新特性带来的。
一个很大的问题就是,为什么 JSR 为 Servlet 的 init() 添加了 annotations ,带来了 init() (@PostConstruct), destroy() (@PreDestroy) 等新方法。 JCP Executive Committee 的成员 Hani Suleiman 在他的 blog 上,描述了他本来希望看到的新特性,但是事实却未能通过。有意思的是, Hani Suleiman 可是 JCP Executive Committee 的成员, JCP Executive Committee 对专家组提交的方案是有最终决定权的。为何 Hani Suleiman 未能让本来应有的一些变化添加到 Servlet 标准里呢?
新的特性包括:
Clarification on Session scope for when pages contain more then one session context
当一个页面包括多个会话上下文时,理清会话的范围
the ability to apply a single filter to many requests and many filters to a single request
the ability to apply a single filter to many requests and many filters to a single request
提供一个
filter
可以处理多个请求,以及一个请求可以经过多个
filter
的能力
the ability to create multiple mappings to the same Servlet
the ability to create multiple mappings to the same Servlet
提供针对相同的
Servlet
的多个映射
Allow the use of alternative HTTP methods with authorization constraints
Allow the use of alternative HTTP methods with authorization constraints
通过授权限制,允许用户修改
HTTP
方法
Support the use of annotations to inject resources into a servlet
Support the use of annotations to inject resources into a servlet
支持利用标注在
Servlet
注入资源
Removal of the restriction on not being able to call setStatus() in error handling
Removal of the restriction on not being able to call setStatus() in error handling
删除针对在错误处理中不能调用
setStatus
的限制