根据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的限制
Servlet 2.5 标准引入了多项新特性,包括支持在 Servlet 中使用注解注入资源、允许单个过滤器处理多个请求及单个请求通过多个过滤器、取消在错误处理中调用 setStatus 的限制等。
173万+

被折叠的 条评论
为什么被折叠?



