11 2013 档案
摘要:Struts2中默认的result-Type包括 Result的首要职责,是封装Action层到View层的跳转逻辑。Struts2的Action是一个与Web容器无关的POJO。所以,在Action执行完毕之后,框架需要把代码的执行权重新交还给Web容器,并转向到相应的页面或者其他类型的View层。而这个跳转逻辑,就由Result来完成。这样,对Action...
阅读全文
摘要:1、struts2自2.1以后推荐使用Convention Plugin支持struts零配置支持(引入jar:struts2-convention-plugin-2.x.x.jar)①convention默认扫描所有实现com.opensymphony.xwork2.Action的类和指定包路径下以Action结尾的类名②struts.convention.package.locators指定默认的根packages,struts.convention.action.packages指定搜索的packages下的action,struts.convention.exclude.package
阅读全文
摘要:在手动配置action的基础上引入struts2-convention-plugin-2.x.x.jar以支持action的注解支持修改的地方主要在struts.xml中 /hello.jsp --> 此时需要在WEB-INF/context下创建结果映射,如需修改,要定义启动过程中出现一个奇怪的异常严重: Exception starting filter struts2java.lang.NoSuchMethodError: org.apache.common...
阅读全文
摘要:1、web.xml中增加Struts2配置 struts2 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter struts2 /*2、在WEB-INF/lib中加入jarstruts2-core-2.x.x.jar、xwork-core-2.x.x.jar、log4j-1.x.x.jar、commons-fileupload-1.x.x.jar、commons-lang-2.x.jar、commons-logging-1.x.x.jar、...
阅读全文

浙公网安备 33010602011771号