Spring3:基于XML文件的Servlet配置

来源:互联网 发布:java中get和set方法 编辑:程序博客网 时间:2024/05/14 22:21
<?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:p="http://www.springframework.org/schema/p" xmlns:mvc="http://www.springframework.org/schema/mvc"    xmlns:context="http://www.springframework.org/schema/context"    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-3.0.xsd">    <mvc:annotation-driven />    <context:component-scan base-package="com.xxx.controller.**" />    <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">        <property name="viewClass">            <value>org.springframework.web.servlet.view.JstlView</value>        </property>        <property name="prefix">            <value>/page/</value>        </property>        <property name="suffix">            <value>.jsp</value>        </property>    </bean>    </beans>

原创粉丝点击