resthub / springmvc-router

Adds route mapping capacity to any "Spring MVC based" webapp. Uses playframework.org Router implementation.

Home Page:http://resthub.github.com/springmvc-router/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handle multiple route files

bclozel opened this issue · comments

Modify HandlerMapping configuration to handle multiple route files (for modular projects).

Replace

<bean id="handlerMapping"
      class="org.springframework.web.servlet.mvc.router.RouterHandlerMapping">
    <property name="routeFile" value="routes.conf" />
    <property name="servletPrefix" value="" />
</bean>

With something like

<bean id="handlerMapping"
      class="org.springframework.web.servlet.mvc.router.RouterHandlerMapping">
    <property name="routeFile" value="routes.conf" />
    <property name="routeFiles">
      <list>
        <value>routes.conf</value>
        <value>plugin1-routes.conf</value>
      </list>
    </property>
    <property name="servletPrefix" value="" />
</bean>

Should we handle wildcards/regex for this?

<value>plugin*-routes.conf</value>

Warning: list order matters, handlerMapping bean should always append routes to Router.

Merged in master.
Support for wildcards not yet implemented.

Need to write more tests.

Wildcards support is fine by me.
Merged in master.