整合ssm框架之配置文件

ssm整合
一.applicationContext.xml
    1.配置数据源
    
        
        
        
        
    

    2.配置mybatis的sqlSessionFactory工厂
        
            //引用数据源
            //配置类的别名
            
            
                
                    classpath:cn/sxt/mapper/UserMapper.xml
                

            

        

    3
         
            
            
         

     4.
        
            
        

     5.
          //事物发生的连接点
            
                
                
            

         

     6.//事务发生的切入点
            
                
                
            

     7.配置mvc的视图解析器
                     class="org.springframework.web.servlet.view.UrlBasedViewResolver">
            
            
            
            
            
        

      8.配置处理器器和适配器的注解的集合
        
      9.配置扫描器
        //扫描此包下面的所有类
        

二.web.xml
    1.配置spring容器相关的资源文件和创建容器的监听类
        
        
            contextConfigLocation
            classpath:applicationContext.xml
        

        
        
            org.springframework.web.context.ContextLoaderListener//
        

     2.配置springmvc的核心servlet接管请求
        
                springmvc
                org.springframework.web.servlet.DispatcherServlet
                
                
                    contextConfigLocation
                    classpath:applicationContext.xml
                

             

         
                springmvc
                /
         

   

你可能感兴趣的:(ssm)