java - Spring mvc:view-controller and component-scan setting priority -


in spring mvc context have following mappings (there more give general idea). <mvc:view-controller path="/echo" view-name="echo"/>

<context:component-scan base-package="com.myapp.controllers"/>

the issue running have annotated controller @requestmapping(value = "/e{number}". in same controller request mapping have redirect dumps user "home" if @pathvariable not integer.

however not want them dumped home if matching path/echo. tried setting <property name="order" value="0" /> on view resolve however, without order on context, still taking priority.

how can set priority on component scan, or force view-resolver matched first before annotated controllers.

having view resolver in front of controllers sounds terrible idea (if it's able done), particularly since urlbasedviewresolver (or something) , subclasses throw exceptions if don't find match rather passing through chain. if want controller step in when path variable integer should use pattern matching option requestmapping, /e{number:\d+} should steer in right direction google search.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -