Spring3:基于XML文件的Servlet配置

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 3     xmlns:p="http://www.springframework.org/schema/p" xmlns:mvc="http://www.springframework.org/schema/mvc"
 4     xmlns:context="http://www.springframework.org/schema/context"
 5     xsi:schemaLocation="
 6         http://www.springframework.org/schema/beans
 7         http://www.springframework.org/schema/beans/spring-beans.xsd
 8         http://www.springframework.org/schema/context
 9         http://www.springframework.org/schema/context/spring-context.xsd
10         http://www.springframework.org/schema/mvc
11         http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
12 
13     <mvc:annotation-driven />
14     <context:component-scan base-package="com.xxx.controller.**" />
15 
16     <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
17         <property name="viewClass">
18             <value>org.springframework.web.servlet.view.JstlView</value>
19         </property>
20         <property name="prefix">
21             <value>/page/</value>
22         </property>
23         <property name="suffix">
24             <value>.jsp</value>
25         </property>
26     </bean>
27     
28 </beans>

 

posted on 2013-10-15 09:46  月涛阑珊  阅读(228)  评论(0)    收藏  举报