码迷,mamicode.com
首页 > 移动开发 > 详细

spring mvc 头部及配置HandlerMapping HandlerAdapter controller

时间:2016-12-05 13:59:29      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:scan   framework   spring   source   apt   ack   efi   c/s   simple   

<?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:aop="http://www.springframework.org/schema/aop"
	xmlns:c="http://www.springframework.org/schema/c" xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:util="http://www.springframework.org/schema/util" xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
		http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
	
	<!--扫描所有的注解类
	<context:component-scan base-package="controller"></context:component-scan>
	  -->
	
	<!--配置HandlerMapping  	-->
	<bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"></bean>

	<!--配置HandlerAdapter  	-->
	<bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter"></bean>

	<!-- 配置渲染器  
		p:prefix:设置路径的前缀 
	    p:suffix:设置路径的后缀 
	-->
	<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/" p:suffix=".jsp"></bean>
	
	<!-- 配置controller -->
	<bean name="/test.do" class="controller.controller"></bean>
	
	
	
</beans>

  

spring mvc 头部及配置HandlerMapping HandlerAdapter controller

标签:scan   framework   spring   source   apt   ack   efi   c/s   simple   

原文地址:http://www.cnblogs.com/benben123/p/6133365.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!