SSH框架搭建

导入相应的jar包

struts2

目前struts2已经升级到2.5.12(2017-07-22),x-work已经被合并到struts2-core里面去了。
同时还需要添加log4j-api相关jar包

spring4

hibernate5

mysql

配置XML

我的目录分布:

web.xml



    TBS
    
        struts
        org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
         
            config 
            struts-default.xml,struts-plugin.xml,../conf/struts.xml 
         
    
    
    
        struts
        /*
    
    
    
        org.springframework.web.context.ContextLoaderListener
    
    
    
        contextConfigLocation
        /WEB-INF/conf/applicationContext.xml
    
    
    
        index.html
        index.htm
        index.jsp
        default.html
        default.htm
        default.jsp
    

struts.xml




    
        
        
        
            /APIDoc.jsp
               
    
    
    
    
        
    

applicationContext.xml



    
    
    
    
    
        
        
        
        
        
        
        
        
        
        
        
        
    
    
    
    
        
        
            
                
                org.hibernate.dialect.MySQLDialect
                
                true
                
                true
                after_statement
                update
            
        
        
            classpath:/priv/dbs/model/*.hbm.xml
        
    
    
    
        
    
    
    
    
        
        
                     
                PROPAGATION_REQUIRED,readOnly
                PROPAGATION_REQUIRED
                PROPAGATION_REQUIRED
                PROPAGATION_REQUIRED
                PROPAGATION_REQUIRED
                PROPAGATION_REQUIRED
            
        
    
    
    
    
        
            *Dao
        
        
            transactionInterceptor
        
    
    
    
    
        
    
    
    
    
        
    
    
    
    
        
    

jdbc.properties

jdbc.url=jdbc:mysql\:///db?useUnicode\=true&characterEncoding\=UTF-8&useSSL\=false
jdbc.user=user
jdbc.password=password

你可能感兴趣的:(SSH框架搭建)