struts2中interceptor命名的新变化 StrutsApacheServletXML
程序员文章站
2024-03-14 08:30:46
...
按照struts2.0.8文档的说法,从struts2.0.7版本开始(当然我们能看到只是2.0.8,因为struts2的奇数版本号一般是内部测试版本,不会发布的),struts2的interceptor一律采用camelCase(驼峰:除了第一个,每个单词大写开头)命名,当然目前(2.0.8)还是可以使用中划线命名,而在2.1.0版本中将会完全删除中划线的命名的intercepter ,具体涉及到的interceptor如下(struts-default.xml的截取内容):
估计以后设计到命名变化不止这些,可能只要是有中划线"-"的命名都会改为"驼峰"的方式
<!-- Deprecated name forms scheduled for removal in Struts 2.1.0. The camelCase versions are preferred. See ww-1707 -->
<interceptor name="external-ref" class="com.opensymphony.xwork2.interceptor.ExternalReferencesInterceptor"/>
<interceptor name="model-driven" class="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"/>
<interceptor name="static-params" class="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"/>
<interceptor name="scoped-model-driven" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor"/>
<interceptor name="servlet-config" class="org.apache.struts2.interceptor.ServletConfigInterceptor"/>
<interceptor name="token-session" class="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"/>
<interceptor name="external-ref" class="com.opensymphony.xwork2.interceptor.ExternalReferencesInterceptor"/>
<interceptor name="model-driven" class="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"/>
<interceptor name="static-params" class="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"/>
<interceptor name="scoped-model-driven" class="com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor"/>
<interceptor name="servlet-config" class="org.apache.struts2.interceptor.ServletConfigInterceptor"/>
<interceptor name="token-session" class="org.apache.struts2.interceptor.TokenSessionStoreInterceptor"/>