标签:
1、 建立Spring项目,所有的配置文件以及jar好弄好。
2、 从struts2-blank项目中,把lib的所有jar导入,struts2-blank是Struts2自带的一个空白项目的例子。打开lib文件夹,按姓名排序,把重名的jar删除
3、 添加struts2的Web.xml 这一步可能不要做,因为myeclipse可能会在里面添加一些东西。比如listener
<listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:config/applicationContext-*.xml</param-value> </context-param> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>注意这里的classpath路径和文件名必须和自己的配置一样。listener要加上。
4、 添加log4j struts.xml文件,修改index.jsp,添加error.jsp
5、 修改struts.xml
<action name="index"> <result> /index.jsp </result> </action>
删掉 Spring 3.1.1 Libraries Spring Security 3.1.0 Spring 2.3.1 Web Flow这三大坨,,我日 我因为这个没删除 调代码调了一整天
错误信息是:
然后就可以开始写代码了 ,,配置文件写的时候小心点
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:
原文地址:http://blog.csdn.net/u011026968/article/details/47176779