搭建Spring+Spring MVC+MyBatis+FreeMarker+Maven框架实战

阅读更多

实战讲解搭建Spring+Spring MVC+MyBatis+FreeMarker+Maven框架

 

一、项目结构如下:

搭建Spring+Spring MVC+MyBatis+FreeMarker+Maven框架实战_第1张图片

 

二、Maven pom.xml 配置如下:


  4.0.0
  com.xieke.test
  ssm-freemarker-demo
  0.0.1-SNAPSHOT
  war
  
   
        ssm-freemarker-demo
   

   
       
           junit
           junit
           4.11
           test
       

       
       
           org.springframework
           spring-core
           3.2.6.RELEASE
       
       
           org.springframework
           spring-context
           3.2.6.RELEASE
       
       
           org.springframework
           spring-context-support
           3.2.6.RELEASE
       
       
           org.springframework
           spring-tx
           3.2.6.RELEASE
       
       
           org.springframework
           spring-aop
           3.2.6.RELEASE
       
       
           org.springframework
           spring-beans
           3.2.6.RELEASE
       
       
           org.springframework
           spring-jdbc
           3.2.6.RELEASE
       

       
       
           org.springframework
           spring-web
           3.2.6.RELEASE
       
       
           org.springframework
           spring-webmvc
           3.2.6.RELEASE
       

       
       
           org.mybatis
           mybatis
           3.2.4
       

       
       
           org.mybatis
           mybatis-spring
           1.2.2
       

       
       
           mysql
           mysql-connector-java
           5.1.28
       
       
       
           commons-dbcp
           commons-dbcp
           1.4
       
       
           commons-pool
           commons-pool
           1.6
       

       
       
           log4j
           log4j
           1.2.17
       
       
           org.slf4j
           slf4j-api
           1.7.5
       
       
           org.slf4j
           slf4j-log4j12
           1.7.5
       

       
       
           org.freemarker
           freemarker
           2.3.20
       

       
       
           org.apache.tomcat
           servlet-api
           6.0.37
       
   
   

 

三、项目 web.xml配置如下:




	  
	  
	 log4jConfigLocation  
	 classpath:log4j.properties  
	  
	  
	 org.springframework.web.util.Log4jConfigListener  
	  

    
    
        CharacterEncodingFilter
        org.springframework.web.filter.CharacterEncodingFilter
        
            encoding
            UTF-8
        
        
            forceEncoding
            true
        
    
    
        CharacterEncodingFilter
        /*
    
   
    
    
        springmvc
        org.springframework.web.servlet.DispatcherServlet
           
		   contextConfigLocation  
		   classpath:spring/*.xml  
		   
        1
    
    
        springmvc
        /
    
    

 

四、Spring applicationContext.xml配置如下:



                        
      
      
      
      
      
          
          
          
          
      
   
      
      
          
          
          
      
   
      
      
          
      
      
     
      
      
          
          
          
      

 

五、Spring MVC springmvc-servlet.xml配置如下:




    
    
    
    
    
    
    
      

    
    
        
        
        
        
            org.springframework.web.servlet.view.freemarker.FreeMarkerView
        
    
    
      
    
        
            /WEB-INF/views/
        
        
            
                5
                UTF-8
                UTF-8
                yyyy-MM-dd HH:mm:ss
                HH:mm:ss
                0.####
                true,false
                true
                auto_detect
                UTF-8
            
        
    
    

   至此搭建完毕,以上是主要的配置文件,想详细了解的,可以下载查看源代码,下载地址为:       http://pan.baidu.com/s/1c7e8eM

 

转载请注明出处: http://xieke90.iteye.com/blog/2302912

 

  • 搭建Spring+Spring MVC+MyBatis+FreeMarker+Maven框架实战_第2张图片
  • 大小: 23.7 KB
  • 查看图片附件

你可能感兴趣的:(freemarker,spring,maven,spring,mvc,mybatis)