zoukankan      html  css  js  c++  java
  • SimpleUrlHandlerMapping 根据定义转发请求,map from URLs to request handler beans

    <?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" class="com.spring.web.controller.LoginController"/>      
            
           
       <bean id="handlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">      
       <!-- 配置方法一      
         <property name="urlMap">      
             <map>      
                <entry key="/user/login.do" 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>    
  • 相关阅读:
    自考新教材-p173_3(1)
    自考新教材-p148_5(2)
    自考新教材-p148_5(1)
    自考新教材-p148_4
    自考新教材-p147_3
    自考新教材-p146_4(2)
    python 模块 chardet报错解决方法:下载及介绍
    第 52 讲:论一只爬虫的自我修养
    第 51 讲: _name_属性
    Python 培训第一讲
  • 原文地址:https://www.cnblogs.com/yume2015/p/3275218.html
Copyright © 2011-2022 走看看