Announcement Announcement Module
Collapse
No announcement yet.
ControllerClassNameHandlerMapping Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ControllerClassNameHandlerMapping

    Should I just be able to swap the following:

    Code:
    <bean id="urlMapping"
    		class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    		<property name="mappings">
    			<props>
    				<prop key="/*">registerController</prop>
    			</props>
    		</property>
    	</bean>
    for this?

    Code:
    <bean id="urlMapping" class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"> 
    		<property name="order" value="1"/> 
    	</bean>
    The first works, the second doesn't. Any guesses would be appreciated.

    TIA.

  • #2
    You want to look at the BeanNameUrlHandlerMapping, for example

    Code:
    	<bean name="beanNameHandlerMapping" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping">
    		<property name="order" value="1"/>
    	</bean>
    This allows you to have beans names mapped as your controllers, which is what i think you are trying to achieve, for example

    Code:
    <bean name="/someControllerPath.htm" class="...">

    Comment


    • #3
      Thanks.

      What I'm trying to do is map from the URL to a Controller without individually specifying the mappings, just have it inferred.

      Comment

      Working...
      X