struts2改变了struts2只能使用JSP作为视图技术的现状,
struts2允许使用其他模板技术,如freemaker,velocity作为视图技术。
servlet2.4以下的版本要手动加载struts2标签库。
web.xml
<taglib>
<taglib-uri>/struts-tags</taglib-uri>
<taglib-location>/web-inf/struts-tags.tld</taglib-location>
</taglib>
struts2的Action 模块配置在多个配置文件中
struts.xml中需要配置
<include file="struts-part1.xml"></include>
struts2与spring整合 ,只要将struts2-srping-plugin2.0.6.jar加入就可以了。因为里面包含一个struts-plugin.xml设置了
必须的常量,拦截器等。
常量加载顺序
struts-default.xml(struts2-core-2.0.6.jar的文件中)
struts-plugin.xml(struts2-Xxx.2.0.6.jar文件中)
sturts.xml
struts.properties
web.xml
struts2拦截器
拦截器其实就是AOP的编程思想。
在哪定义?
<interceptors>
<interceptror name="authortity" class="le.AuthortyInterceptor" />
<interceptror name="log" class="le.LogInterceptro" />
<interceptror-stack name="authorityandlog">
<interceptor-ref name="authority">
<interceptor-ref name="log">
</interceptror-stack>
</interceptors>
《struts2权威指南》 第四章 深入struts2
本文介绍了Struts2框架的功能改进,包括支持多种视图技术、与Spring框架的整合方式及配置方法。此外还探讨了Struts2的标签库加载、Action模块配置、拦截器机制及其配置细节。
973

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



