3.2关于spring

一.学习spring的5个网站

1.spring官网

http://projects.spring.io/spring-framework/

2.spring-mvc-showcase

https://github.com/spring-projects/spring-mvc-showcase

3.spring宠物医院官方demo

https://github.com/spring-projects/spring-petclinic

4.spring下的绿房子

https://github.com/spring-projects/greenhouse

5.spring-boot

https://github.com/spring-projects/spring-boot

二.配置文件

5个配置文件:resources下的applicationContext.xml,applicationContext-datasource.xml,firstpro.properties;WEB_INF下的web.xml和dispatcher-servlet.xml

1.web.xml




    Archetype Created Web Application

    
    
    
        characterEncodingFilter
        org.springframework.web.filter.CharacterEncodingFilter
        
            encoding
            UTF-8
        
        
            forceEncoding
            true
        
    
    
        characterEncodingFilter
        /*
    
    
    
        org.springframework.web.context.request.RequestContextListener
    
    
    
    
        org.springframework.web.context.ContextLoaderListener
    
    
        contextConfigLocation
        
            classpath:applicationContext.xml
        
    
    
    
    
        dispatcher
        org.springframework.web.servlet.DispatcherServlet
        1
        
        
            
            
        
    
    
    
        dispatcher
        *.do
    




2.applicationContext.xml




    
    

    
    
    

    
    



3.applicationContext-datasource.xml




    
    
    
    
        
        
        
            
                classpath:datasource.properties
            
        
        
    
    
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
         
        
        
         
        
         
        
        

        
        
        
        
        
        
    

        
    
        
        
        

        
        
            
                
                    
                        
                            dialect=mysql
                        
                    
                
            
        

    
    
    
        
    

    
    
    
    
        
        
    

4.dispatcher-servlet.xml




    
    
    
    
        
            
                
                    
                        text/plain;charset=UTF-8
                        text/html;charset=UTF-8
                    
                
            
            
            
                
                
                    
                        
                    
                
                
                
                
                    
                        application/json;charset=UTF-8
                    
                
            
        
    



    
    
         
        
        
    




5.datasource.properties

db.driverLocation=F:\\developer\\mysql-connector-java-5.1.6.jar
db.driverClassName=com.mysql.jdbc.Driver
db.url=jdbc:mysql://localhost:3306/firstpro?characterEncoding=utf-8
db.username=root
db.password=root

db.initialSize = 20
db.maxActive = 50
db.maxIdle = 20
db.minIdle = 10
db.maxWait = 10
db.defaultAutoCommit = true
db.minEvictableIdleTimeMillis = 3600000

你可能感兴趣的:(3.2关于spring)