用maven构建Hibernate+Spring+Struts的web工程
转自http://www./course/3_program/java/javajs/2008513/115765.html 写这个还是怕以后忘了。作个备案。供学习和改进: 会创建一个叫ssh2的maven web工程。 mvn -Declipse.workspace=d:\projects eclipse:add-maven-repo mvn eclipse:eclipse
在eclipse中导入ssh2工程 启动tomcat.在ie中输入url:http://localhost:8080/ssh2 继续: 在web.xml中增加struts2框架,并在src\main\resources中增加struts.xml 可以将appfuse项目中的copy过来做为模板 applicationContext.xml必须放在src\main\webapp\web-inf下 在applicationContext.xml中一定要设置dataSource和sessionFactory否则会报错。mysql数据库和数据库连接池的依赖包也要加载到pom.xml中 Cannot locate the chosen ObjectFactory implementation: spring 要加载struts2-spring.plugs.jar到pom.xml |
|