A simple web site with SpringMVC + Mybatis + Shiro + Druid + Ehcache frameworks, it is a J2EE project named 'webside', provide HTTP and Hessian interface to clients.
- Above JDK1.6 install
- Above Maven 3.0.5, Private repository with Nexus is more better in Company
- Eclipse Java EE IDE with Git and Checkstyle plugins, 'Kepler' version is more better.
- MySQL install (No mandatory requirement, maybe replace with H2 or HSQLDB)
- generate a Eclipse project with the following MAVEN script in CMD or SHELL window
mvn eclipse:eclipse
- run project in Tomcat
mvn tomcat:run -Dmaven.test.skip=true
- enter the following URL in browser with username/password(zhang/123) to login
http://localhost:8080/webside/index
- Unit Test, enter the following command
mvn test
- Integration Test, enter the following command
mvn integration-test
- Sourcecode check, enter the following command, see the results in target/checkstyle-result.xml
mvn checkstyle:checkstyle
Here introduces some very important configuration files to integrate SpringMVC、MyBatis、Shiro、Ehcache(such as web.xml, Spring configuration, SpringMVC configuration)
src/main/webapp/WEB-INF/web.xml contains: Spring context configuration, Shiro configuration, Charset encode filter, Durid configuration, Hessian configuration, SpringMVC configuration
spring-config.xml, spring-dao.xml, spring-common.xml, spring-shiro.xml
spring-mvc.xml