1. Method 1 – prop key

<beans ...>   <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="/welcome.htm">welcomeController</prop> <prop key="/*/welcome.htm">welcomeController</prop> <prop key="/helloGuest.htm">helloGuestController</prop> </props> </property> </bean>   <bean id="welcomeController" class="com.common.controller.WelcomeController" />   <bean id="helloGuestController" class="com.common.controller.HelloGuestController" />   </beans>

2. Method 1 – value

 
<beans ...>
 
	<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
	   <property name="mappings">
		<value>
		   /welcome.htm=welcomeController
		   /*/welcome.htm=welcomeController
		   /helloGuest.htm=helloGuestController
		</value>
	   </property>
	</bean>
 
	<bean id="welcomeController" 
		class="com.common.controller.WelcomeController" />
 
	<bean id="helloGuestController" 
		class="com.common.controller.HelloGuestController" />
 
</beans>


  1. /welcome.htm –> welcomeController.
  2. /{anything}/welcome.htm –> welcomeController.
  3. /helloGuest.htm –> helloGuestController.












 

신고
Posted by jeonguk