SSH整合xml文件

一、导入jar包

 
    UTF-8
    1.7
    1.7

    
    3.1.1.RELEASE
    3.6.5.Final
    2.3.1

  

  
    
      junit
      junit
      4.11
      test
    

    
    
      javax.servlet
      jstl
      1.2
    
    
    
      org.springframework
      spring-core
      ${spring.version}
    
    
      org.springframework
      spring-context
      ${spring.version}
    
    
      org.springframework
      spring-jdbc
      ${spring.version}
    
    
      org.springframework
      spring-beans
      ${spring.version}
    
    
      org.springframework
      spring-web
      ${spring.version}
    
    
      org.springframework
      spring-expression
      ${spring.version}
    
    
      org.springframework
      spring-orm
      ${spring.version}
    
    
    
      cglib
      cglib-nodep
      2.2
    
    
    
      org.hibernate
      hibernate-core
      ${hibernate.version}
    
    
    
      org.apache.struts
      struts2-core
      ${struts2.version}
    
    
      org.apache.struts
      struts2-junit-plugin
      ${struts2.version}
      test
    
    
      org.apache.struts
      struts2-spring-plugin
      ${struts2.version}
    
    
    
      mysql
      mysql-connector-java
      5.0.5
    
    
    
      c3p0
      c3p0
      0.9.1.2
    
    
    
      com.alibaba
      fastjson
      1.2.47
    

  

 二、web.xml




  Archetype Created Web Application

  
  
    org.springframework.web.context.ContextLoaderListener
  
  
  
    contextConfigLocation
    classpath:applicationContext.xml
  

  
  
    struts2
    org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
  
  
    struts2
    /*
  

 三、applicationContext.xml



    
    

    
    
    
    
    
    

    
    
        
        
        
        
        
        
            50
        
        
        
            5
        
        
        
            5
        
        
        
            20
        
        
        
            50
        
        
        
            20
        

    

    
    
        
        
            
        
        
        
            
                
                org.hibernate.dialect.MySQLDialect
                
                true
                
                update
                
                true
                
                true
                
                true
                
                thread
                
                org.hibernate.cache.HashtableCacheProvider
                
                3
                
                jdbc:mysql://localhost:3306/emp
                
                com.mysql.jdbc.Driver
            

        

        
        
            
                com.test.po
            
        
        
            
                classpath:com/test/po/Dept.hbm.xml
                classpath:com/test/po/Emp.hbm.xml
                classpath:com/test/po/Dept.hbm.xml
            
        

    

    
    
        
    
    
    



四、db.properties 

database.database=mysql
database.driverClassName=com.mysql.jdbc.Driver
database.username=root
database.password=root
database.show_sql=true
database.url=jdbc:mysql://localhost:3306/emp?useUnicode=true&characterEncoding=UTF-8

五、 struts.xml




    
    
    
    

    

        
            {1}.jsp
        

    

 

你可能感兴趣的:(SSH)