ssm环境搭建

一.数据库配置


.
二. maven project创建

  1. create a simple project() |group id com.ifacg | artifact id TestProject | war
  2. 导入project-parent existing maven project
  3. 获得parentid 填写到本项目中
  4. maven update
  5. 选择jar 和 配置Tomcat插件(配置在下面)
  6. goals tomcat7:run(需要先安装parent,run as> maven install)

	4.0.0
	
		
		
		0.0.1-SNAPSHOT
	
	
	
	
	1.0.0-SNAPSHOT
	war

	
		
		
			junit
			junit
			test
		
		
			org.springframework
			spring-webmvc
		
		
			org.springframework
			spring-jdbc
		
		
			org.springframework
			spring-aspects
		
		
		
			org.mybatis
			mybatis
		
		
			org.mybatis
			mybatis-spring
		
		
		
			mysql
			mysql-connector-java
		
		
			org.slf4j
			slf4j-log4j12
		
		
		
			com.fasterxml.jackson.core
			jackson-databind
		
		
		
			com.jolbox
			bonecp-spring
		
		
		
			jstl
			jstl
		
		
			javax.servlet
			servlet-api
			provided
		
		
			javax.servlet
			jsp-api
			provided
		
		
		
			org.apache.commons
			commons-lang3
		
		
			org.apache.commons
			commons-io
		
		
			com.github.pagehelper
			pagehelper
		
		
			com.github.jsqlparser
			jsqlparser
		
		
			com.github.abel533
			mapper
		
	

	
		
			
			
				org.apache.tomcat.maven
				tomcat7-maven-plugin
				
					80
					
					/
				
			
		
	

maven project parent pow


	4.0.0
	cn.parent
	parent
	0.0.1-SNAPSHOT
	pom

	
	
		4.10
		4.1.3.RELEASE
		3.2.8
		1.2.2
		1.2.15
		5.1.32
		1.6.4
		2.4.2
		1.0.9
		4.3.5
		1.2
		2.5
		2.0
		2.5
		3.3.2
		1.3.2
	

	
		
			
			
				junit
				junit
				${junit.version}
				test
			

			
			
				org.springframework
				spring-context
				${spring.version}
			
			
				org.springframework
				spring-beans
				${spring.version}
			
			
				org.springframework
				spring-webmvc
				${spring.version}
			
			
				org.springframework
				spring-jdbc
				${spring.version}
			
			
				org.springframework
				spring-aspects
				${spring.version}
			

			
			
				org.mybatis
				mybatis
				${mybatis.version}
			
			
				org.mybatis
				mybatis-spring
				${mybatis.spring.version}
			

			
			
				com.github.pagehelper
				pagehelper
				3.7.5
			
			
				com.github.jsqlparser
				jsqlparser
				0.9.1
			
			
			
				com.github.abel533
				mapper
				2.3.4
			

			
			
				mysql
				mysql-connector-java
				${mysql.version}
			

			
				org.slf4j
				slf4j-log4j12
				${slf4j.version}
			

			
			
				com.fasterxml.jackson.core
				jackson-databind
				${jackson.version}
			

			
			
				com.jolbox
				bonecp-spring
				0.8.0.RELEASE
			

			
			
				org.apache.httpcomponents
				httpclient
				${httpclient.version}
			

			
			
				jstl
				jstl
				${jstl.version}
			
			
				javax.servlet
				servlet-api
				${servlet-api.version}
				provided
			
			
				javax.servlet
				jsp-api
				${jsp-api.version}
				provided
			

			
			
				joda-time
				joda-time
				${joda-time.version}
			

			
			
				org.apache.commons
				commons-lang3
				${commons-lang3.version}
			
			
				org.apache.commons
				commons-io
				${commons-io.version}
			

		
	

	
		${project.artifactId}
		
			
			
				org.apache.maven.plugins
				maven-resources-plugin
				2.7
				
					UTF-8
				
			
			
			
				org.apache.maven.plugins
				maven-compiler-plugin
				3.2
				
					1.7
					1.7
					UTF-8
				
			
		
		
			
				
				
					org.apache.tomcat.maven
					tomcat7-maven-plugin
					2.2
				
			
		
	

三.创建web.xml

src\main\webapp\WEB-INF\web.xml



	
	project-name
	
	
		contextConfigLocation
		classpath:spring/applicationContext*.xml
		
	
	
		org.springframework.web.context.ContextLoaderListener
	
	
	
	
		encodingFilter
		org.springframework.web.filter.CharacterEncodingFilter
		
			encoding
			UTF8
		
	
	
		encodingFilter
		/*
	

	
	
        usermanage
        org.springframework.web.servlet.DispatcherServlet
        
        	contextConfigLocation
        	classpath:usermanage-servlet.xml
        
        
        1
    

    
        usermanage
        
        /rest/*
    
    
    
    	index.jsp
    


四.配置jdbc.properties

src\main\resources\jdbc.properties

jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://127.0.0.1:3306/mybatis?useUnicode=true&characterEncoding=utf8&autoReconnect=true&allowMultiQueries=true
jdbc.username=root
jdbc.password=root

五.配置spring

src\main\resources\spring
1.applicationContext.xml



	
	
		
		
		
		
		
		
			
				classpath:xxxx.properties
			
		
	
	
	
	

	 
	
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
	

2.applicationContext-transaction.xml
ioc一般用注解
aop一般用配置


	
	
	
	
		
	

	
	
		
			
			
			
			
		
	

	
		
		
		
		
	
	


六.配置springMVC

XML\XML catalog\add
location:E:\xxx\xxx.xsd
schema name:http://www.springframework.org/schema/context/spring-context-4.0.xsd




	
	
	
	
	
	
	
	
	
		
		
	


七.配置spring与mybatis

src\main\resources\mybatis mybatis-config.xml





src\main\resources\spring\applicationContext-mybatis.xml


	
	
		
		
		
		
		
		
		
		
	
	
	
	
		
	



你可能感兴趣的:(ssm环境搭建)