zoukankan      html  css  js  c++  java
  • spring mvc.xml配置文件

    <beans xmlns="http://www.springframework.org/schema/beans"
    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" 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/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">
    <!--扫描控制包-->
    <context:component-scan base-package="ssm.shiro.controller"></context:component-scan>
    <!--声明以注解的方式配置spring mvc-->
    <mvc:annotation-driven></mvc:annotation-driven>

    <!--restful风格:会默认的在web.xml中配置一个名叫default的servlet,这个servlet用来处理所有的静态资源,目前只能处理css资源,
    js可以单独配置-->
    <!--<mvc:default-servlet-handler></mvc:default-servlet-handler>-->

    <!--配置spring mvc的内置的视图解析器-->
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <!--配置视图的前缀-->
    <property name="prefix" value="/WEB-INF/jsp/"></property>
    <!--配置视图的后缀-->
    <property name="suffix" value=".jsp"></property>
    </bean>
    <!--开启aop-->
    <aop:config proxy-target-class="true"></aop:config>
    <!--声明以注解的方式授权-->
    <bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
    <property name="securityManager" ref="securityManager"></property>
    </bean>
    <!--配置统一的异常处理器-->
    <bean id="exceptionResolver" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
    <!--配置出异常后跳转的界面-->
    <property name="defaultErrorView" value="error"></property>
    </bean>
    </beans>

  • 相关阅读:
    gcc编译器如何生成指定的文件名
    文章如何做伪原创 SEO大神教你几招做"原创"网站文章的心得
    linux命令大全
    SDC文件模版
    lwip:网络数据包读取和解析过程
    离散时间信号与系统
    网络编程杂谈
    TCP segment of a reassembled PDU
    gdb: multiple process debug
    ntp.conf:很少有人提及的事
  • 原文地址:https://www.cnblogs.com/yinziqiang0909/p/11206004.html
Copyright © 2011-2022 走看看