zoukankan      html  css  js  c++  java
  • ssm的整合

      <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:config/spring/applicationContext.xml</param-value>
      </context-param>
    
      <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener
        </listener-class>
      </listener>

    用来加载spring的主配置文件

    <servlet>
        <servlet-name>springDispatcherServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:config/springmvc/springmvc.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
       </servlet>
        
       <servlet-mapping>
         <servlet-name>springDispatcherServlet</servlet-name>
         <url-pattern>/</url-pattern>
       </servlet-mapping>

    用来加载springmvc的配置文件

    <context:component-scan base-package="com.ischoolbar.programmer">
            <context:include-filter type="annotation" expression="org.springframework.stereotype.Component"/>
            <context:include-filter type="annotation" expression="org.springframework.stereotype.Service"/>
            <context:include-filter type="annotation" expression="org.springframework.stereotype.Repository"/>
        </context:component-scan>
        
        <context:property-placeholder location="classpath:config/db.properties"/>
        
        <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
            <property name="driverClass" value="${datasource.connection.driver_class}"/>
            <property name="jdbcUrl" value="${datasource.connection.url}"/>
            <property name="user" value="${datasource.connection.username}"/>
            <property name="password" value="${datasource.connection.password}"/>
        </bean>
        
        <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
            <property name="dataSource" ref="dataSource"></property>
            <property name="mapperLocations" value="classpath:config/mybatis/admin/*.xml"></property>
            <property name="typeAliasesPackage" value="com.ischoolbar.programmer.entity"></property>
        </bean>
        
        <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
            <property name="basePackage" value="com.ischoolbar.programmer.dao"></property>
            <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>
        </bean>
    <context:component-scan base-package="com.ischoolbar.programmer.controller">
        <context:include-filter type="annotation"
            expression="org.springframework.stereotype.Controller" />
        </context:component-scan>
    
        <!-- 启动 mvc 注解驱动 -->
        <mvc:annotation-driven></mvc:annotation-driven>
        
        <!-- 静态资源处理 -->
        <mvc:default-servlet-handler/>
        
        <!-- 配置视图解析器 -->
        <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="prefix" value="/WEB-INF/views/"></property>
            <property name="suffix" value=".jsp"></property>
        </bean>
        
        <!-- 文件上传 -->
        <bean id="multipartResolver" 
            class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
            <!-- 上传文件大小限制 -->
            <property name="maxUploadSize">  
                <value>10485760</value>  
            </property>  
            <!-- 请求的编码格式, 和 jsp 页面一致 -->
            <property name="defaultEncoding">
                <value>UTF-8</value>
            </property>
        </bean>
        <mvc:interceptors>
            <mvc:interceptor>
                <mvc:mapping path="/**"/>
                <mvc:mapping path="/*"/>
                <mvc:exclude-mapping path="/login"/>
                <mvc:exclude-mapping path="/get_cpacha"/>
                <mvc:exclude-mapping path="/resources/**"/>
                <bean class="com.ischoolbar.programmer.interceptor.admin.LoginInterceptor"></bean>
            </mvc:interceptor>
        </mvc:interceptors>
        
  • 相关阅读:
    在Winform框架界面中改变并存储界面皮肤样式
    基于主从表数据录入的处理
    使用ew完成多场景下内网代理穿透
    内网渗透中的端口转发——工具很全
    内网渗透常见端口转发方式——lcx netsh rinetd warthworm regeorg msf portfwd sccat metasploit socks4a tunna
    内网渗透代理和转发
    内网渗透代理——reGeorg 利用 webshell 建立一个 socks 代理进行内网穿透,本质上就是在webshell上做了一个代理转发而已
    内网渗透代理——内网的防火墙只配置了入站规则比如只有80端口
    web未授权访问漏洞总结——mongodb、redis、memcache、jboss、vnc、docker、zk、rsync
    web未授权访问漏洞总结——非常全而细致 redis、mongodb、jenkins、zk、es、memcache、hadoop、couchdb、docker
  • 原文地址:https://www.cnblogs.com/lzh66/p/13771548.html
Copyright © 2011-2022 走看看