首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

Spring Web MVC 的HandlerMapping的施用之-SimpleUrlHandlerMapping(有三种配法)

2012-09-13 
Spring Web MVC 的HandlerMapping的使用之-------SimpleUrlHandlerMapping(有三种配法)?xml version1.0

Spring Web MVC 的HandlerMapping的使用之-------SimpleUrlHandlerMapping(有三种配法)

<?xml version="1.0" encoding="UTF-8"?><beans    xmlns="http://www.springframework.org/schema/beans"    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">      <bean id="loginController" value-ref="loginController"/>         </map>     </property> -->  <!-- 配置方法二    <property name="mappings">       <bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">           <property name="location">              <value>urlMap.properties</value <!-- 此时urlMap.properties文件应放在WebRoot目录下! -->           </property>       </bean>    </property>   -->   <!-- 配置方法三 -->     <property name="mappings">        <props>           <prop key="/user/login.do">loginController</prop>        </props>     </property></bean>    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">     <property name="prefix"><value>/WEB-INF/jsp/</value></property>     <property name="suffix"><value>.jsp</value></property>     <property name="viewClass">       <value>        org.springframework.web.servlet.view.JstlView       </value>     </property>   </bean>     </beans>

热点排行