欢迎光临
我们一直在努力

SSM框架怎么配置springmvc-config.xml文件

这篇“SSM框架怎么配置springmvc-config.xml文件”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“SSM框架怎么配置springmvc-config.xml文件”文章吧。

Springmvc的配置文件springmvc-config.xml

<beans xmlns="http://www.springframework.org/schema/beans" 
       xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance" 
       xmlns:mvc ="http://www .springframework.org/schema/mvc" 
       xmlns:context ="http://www.springframework.org/schema/context" 
       xmlns:aop ="http://www.springframework.org/schema/aop" 
       xmlns:tx ="http://www.springframework.org/schema/tx" 
       xsi:schemaLocation ="http://www.springframework.org/schema/beans
    网址:www.springframework.org/schema/beans/spring-beans-4.3.xsd 
    http:www.springframework.org/schema/mvc 
    http:www.springframework.org/schema/mvc/spring-mvc-4.3.xsd 
    http:www.springframework.org/schema/context 
    http:www.springframework.org/schema/context/spring-context-4.3.xsd 
    http:www.springframework.org/schema/aop 
    http:www.springframework.org/schema/aop/spring-aop-4.3.xsd 
    http:www.springframework.org/schema/tx 
    http:www.springframework.org/schema/tx/spring-tx-4.3.xsd">
    <!-- 加载属性文件 -->
    <context:property-placeholder location="classpath:resource.properties"/>
    <!-- 配置扫描仪-->
    <context:component-scan base- package ="com.ma.core.web.controller"/>
    <!-- 注解驱动:配置处理器映射器和适配器 -->
    <mvc:annotation-driven/>
    <!--配置静态资源的访问映射,此配置中的文件不会被前端控制器拦截-->
    <mvc:resources mapping="/js/**" location="/js/"/>
    <mvc:resources mapping="/css/**" location="/css/"/>
    <mvc:resources mapping="/fonts/**" location="/fonts/"/>
    <mvc:resources mapping="/images/**" location="/images/"/>
    <!-- 配置视图解释器ViewResolver -->
    <bean id="jspViewResolver"类="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/jsp/"/>
        <property name="suffix" value=".jsp"/>
    </豆>
    <!--配置拦截器-->
    <mvc:拦截器>
        <mvc:拦截器>
            <mvc:mapping path="/**"/>
            <bean class ="com.ma.core.interceptor.LoginInterceptor"/>
        </mvc:拦截器>
    </mvc:拦截器></beans>

以上就是关于“SSM框架怎么配置springmvc-config.xml文件”这篇文章的内容,相信大家都有了一定的了解,希望小编分享的内容对大家有帮助,若想了解更多相关的知识内容,请关注云搜网行业资讯频道。

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。