【笔记】SpringMVC系列框架 [ 3 ]

处理器映射器HandlerMapping:BeanNameUrlHandlerMapping、SimpleUrlHandlerMapping

【springmvc.xml】


<beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:mvc="http://www.springframework.org/schema/mvc"
      xsi:schemaLocation="      
      http://www.springframework.org/schema/beans 
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

      http://www.springframework.org/schema/context
      http://www.springframework.org/schema/context/spring-context-3.0.xsd
      http://www.springframework.org/schema/mvc   
      http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd      
      ">



      <bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping" />

      <bean name="/login.do" class="com.athl.Controller.MyController" />


      <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">

        
        <property name="mappings">
            <props>
                <prop key="/login.do">myControllerprop>
                <prop key="/getAll.do">myControllerprop>
                <prop key="/delete.do">myControllerprop>
            props>
        property>

        
        <property name="urlMap">
            <map>
                <entry key="/login.do" value="myController" />
                <entry key="/getAll.do" value="myController" />
                <entry key="/delete.do" value="myController" />
            map>
        property>

      bean>

      <bean id="myController" class="com.athl.Controller.MyController" />

beans>

你可能感兴趣的:(Java,EE,框架,SpringMVC)