Recently bought a Alibaba cloud server. The server is a Linux command-line environment, and Tomcat, MySQL and everything are fine.
Just want to write a web backstage, make some network data what, give my mobile app-demo access to play.
Although I have learned web-related content before, but have left it for more than three years, forget the light.
In this document, we study and develop some of the processes, some problems encountered, and some solutions.
1. Download the latest full zip on the Struts website. struts2.3.20
2. Download the full zip of spring-framework3.2.8 on the network. (Official latest 4.x needs jdk1.8, my local is 1.7, do not want to churn)
3. Go to hibernate website to download the latest full zip. hibernate-release-4.3.8
4. With the Eclipse-javaee version, a Dynamic Web project was created, using web-module2.5 (this version automatically has XML,
more than 3.0 support Web modules using annotations, you can do without the XML )
5. Import some jar packages from struts (jar packages are imported into/webcontent/web-inf/lib/)
Asm-5.0.2.jarasm-commons-5.0.2.jarasm-tree-5.0.2.jar
Commons-fileupload-1.3.1.jar
Commons-io-2.2.jar
Commons-lang-2.4.jar
Commons-lang3-3.2.jar
Freemarker-2.3.19.jar
Javassist-3.11.0.ga.jar
Ognl-3.0.6.jar
Struts2-core-2.3.20.jar
Xwork-core-2.3.20.jar
6. Import some jar packages from spring Spring-aop-3.2.8.release.jar
Spring-beans-3.2.8.release.jar
Spring-context-3.2.8.release.jar
Spring-core-3.2.8.release.jar
Spring-expression-3.2.8.release.jar
Spring-jdbc-3.2.8.release.jar
Spring-orm-3.2.8.release.jar
Spring-tx-3.2.8.release.jar
Spring-web-3.2.8.release.jar
7. Some jar packages that import hibernate first required the jar package Antlr-2.7.7.jar
Dom4j-1.6.1.jar
Hibernate-commons-annotations-4.0.5.final.jar
Hibernate-core-4.3.8.final.jar
Hibernate-jpa-2.1-api-1.0.0.final.jar
Jandex-1.1.0.final.jar
Javassist-3.18.1-ga.jar
Jboss-logging-3.1.3.ga.jar
Jboss-logging-annotations-1.2.0.beta1.jar
Jboss-transaction-api_1.2_spec-1.0.0.final.jar
Then there are the others: Hibernate-commons-annotations-4.0.5.final.jar
Hibernate-core-4.3.8.final.jar
Hibernate-jpa-2.1-api-1.0.0.final.jar
8. Other jar package Mysql-connector-java-5.1.34-bin.jarapache Commons-dbcp2-2.1.jar Commons-pool2-2.3.jar
9. Web. xml
<!--struts2 Filters--
<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>
<!--spring configuration address and corresponding listener--
<context-param>
< Param-name >contextconfiglocation</param-name>
< Param-value >/web-inf/applicationcontext.xml</param-value>
</context-param>
<listener>
< Listener-class >org.springframework.web.context.ContextLoaderListener</listener-class >
</listener>
Java EE SSH Framework Integration (i) Jar package Import Web. XML configuration