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

    说明

    <?xml version="1.0" encoding="UTF-8"?>
    <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"
    	xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
    		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-4.0.xsd">
    
    	<!-- 组件扫描 -->
    	<context:component-scan base-package="com.atguigu.springmvc"></context:component-scan>
    	
    	<!-- 视图解析器 -->
    	<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    		<property name="prefix" value="/WEB-INF/views/"></property>
    		<property name="suffix" value=".jsp"></property>
    	</bean>
    	<!-- 
    		将在 SpringMVC 上下文中定义一个 DefaultServletHttpRequestHandler,
    		它会对进入 DispatcherServlet 的请求进行筛查,如果发现是没有经过映射的请求,
    		就将该请求交由 WEB 应用服务器默认的 Servlet 处理,如果是由映射的请求,才由 DispatcherServlet 继续处理
    		
    		如果web应用服务器的默认的Serlvet的名字不叫"default",则需要通过default-servlet-name来进行指定.
    		
    		配置了default-serlvet-handler后,RequestMapping的映射会失效,需要加上annotation-driven的配置。		
    	 -->
    	<mvc:default-servlet-handler />
    	<!--  -->
    	<mvc:annotation-driven/>
    </beans>
    

      

  • 相关阅读:
    Session机制详解
    JDK各个版本比较 JDK5~JDK9
    CAS 自旋锁
    OAuth2.0认证和授权原理
    微信二维码登录原理
    Django Restframework 实践(一)
    ESXI 5.5卡在LSI_MR3.V00
    理解RESTful架构
    RESTful API 设计指南
    python 异步 select pooll epoll
  • 原文地址:https://www.cnblogs.com/liubosong/p/12034847.html
Copyright © 2011-2022 走看看