In Spring MVC (2.0) how can you easily hook multiple pages/urls to use 1 controller?
Posted
by danny
on Stack Overflow
See other posts from Stack Overflow
or by danny
Published on 2010-04-12T17:19:36Z
Indexed on
2010/04/12
17:23 UTC
Read the original article
Hit count: 248
<!--dispatcher file-->
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/foo/bar/baz/boz_a.html">bozController</prop>
</props>
</property>
</bean>
<!--mappings file-->
<bean id="bozController" class="com.mycompany.foo.bar.baz.BozController">
<property name="viewPathA" value="foo/bar/baz/boz_a" />
<property name="viewPathB" value="foo/bar/baz/boz_b" />
...
<property name="viewPathZ" value="foo/bar/baz/boz_z" />
</bean>
how do I set it up so that when the user loads page boz_w.html
it uses the bozController, and sets the viewPath to use boz_w.jsp?
© Stack Overflow or respective owner