SimpleUrlHandlerMapping

来自ling
跳转至: 导航搜索
  <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>