SSM框架分层开发配置文件

dao层配置文件

application.xml文件 

路径:resources->spring->application.xml

"1.0" encoding="UTF-8"?>
"http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

    "classpath:spring/jdbc.properties">

    "dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        "driverClassName" value="${jdbc.driver}"/>
        "url" value="${jdbc.sql.url}"/>
        "username" value="${jdbc.username}"/>
        "password" value="${jdbc.userpwd}"/>
    

    "sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        "dataSource" ref="dataSource"/>
        
        "plugins">
            
                class="com.github.pagehelper.PageInterceptor">
                    "properties">
                        
                            
                            "helperDialect">mysql
                        
                    
                
            
        
        
        
    

    class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        "basePackage" value="cn.kgc.dao"/>
    

 

jdbc.properpies文件

路径: resources->spring->jdbc.properpies

jdbc.driver:com.mysql.jdbc.Driver
jdbc.sql.url:jdbc:mysql://localhost:3306/travel
jdbc.username:root
jdbc.userpwd:admin

 

log4j2.xml文件

路径:resources->log4j2.xml



    
        
            
            
        
        
        
            
        
    

    
        
        
            
            
            
        

        
        
            
            
        

        
        
            
            
        
        
        
            
            
        
    


 

sqlMapConfig.xml文件

分页助手文件

路径:resources->sqlMapConfig.xml


DOCTYPE configuration
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">

    
        
    

 

service层配置文件

路径:resources->spring->spring.xml



       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/context
       http://www.springframework.org/schema/context/spring-context.xsd
       http://www.springframework.org/schema/tx
       http://www.springframework.org/schema/tx/spring-tx.xsd
       http://www.springframework.org/schema/aop
       http://www.springframework.org/schema/aop/spring-aop.xsd">



    package="cn.kgc.service"/>

    class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        
    

    
        
            
            
            
            
        
    

    
        
    

 

controller层配置文件

springMVC.xml文件

路径:resources->springMVC.xml



       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/context
       http://www.springframework.org/schema/context/spring-context.xsd
       http://www.springframework.org/schema/mvc
       http://www.springframework.org/schema/mvc/spring-mvc.xsd">

package="cn.kgc.controller">

class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    
    




default-servlet-handler>default-servlet-handler>

 

spring-security.xml文件

路径:resources->spring-security.xml

安全框架文件



       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:security="http://www.springframework.org/schema/security"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/security
       http://www.springframework.org/schema/security/spring-security.xsd">

    
    
    

    
    
    

    
        
        
        login
                login-page="/login.jsp"
                login-processing-url="/login"
                default-target-url="/index.jsp"
                authentication-failure-url="/login.jsp"
        />

        
        
        
        


    
    
    
        

            

                


        
    

    class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder"/>

 

转载于:https://www.cnblogs.com/liugaoyanging/p/11495385.html

你可能感兴趣的:(SSM框架分层开发配置文件)