A, SpringMVC development environment to build
1. Create a project permission
2, the introduction pom.xml dependency, and use the properties version management version
Second, the environment configuration:
1, the configuration web.xml
With Spring beans configuration file path:
Configuration front controller:
Defaults to the spring-servlet.xml file in the WEB-INF
Configuring Character Sets, solve the garbage problem:
2, SpringMVC configuration file: spring-servlet.xml
Introducing springmvc context annotation configuration package and scanning controller, service two directories, and configure the front resolver
3, configuration applicationContext.xml
DB database configuration parameters and related parameters Druid
Connected to the database file corresponding to the configuration parameters: settings.xml
DB parameters:
4, arranged mybatis-config.xml
applicationContext.xml add sqlSessionFactory configuration:
mybatis-config.xml configuration: Close caching
5, transaction management configuration: applicationContext.xml
Transaction Manager:
Monitoring DB:
6, configuration druid, add configuration to achieve druid login authentication:
View source code:
7, log management configuration logback.xml
Three, SpringMVC development environment to verify:
1, create an interface: TestController
2, tomcat service configuration:
3, start the tomcat server, test interface: