need help with @RequestMapping
I just can't figure out how to resolve the application context with Request mapping.
The application (app.war) that runs in the context /app
I don't want to hardcode the context in the controller urls so that I can run the app under different contexts e.g. in root context.
Until now I was using relative urls like so
page url : /app/module/123
form action : doSomething/abc
controller method: @RequestMapping("module/doSomething/{abc}")
I want to include this jsp form on different modules but this means it must work in different paths and relative urls will be impossible to manage. How can I specify the application context to controller method .. something equivalent to this without hardcoding it.
controller method: @RequestMapping("{app}/module/doSomething/{abc}")
Caused by @Secured annotation failing..
Wow.. after some serious debugging it turns out it was failing because the @Secured tag on the method wasn't working for some reason. I removed this tag and it works. If I add any @Secured on the class or the method the Request mapping is not picked up (doesn't show up in mvc log output) and I get a 404 on the post.
Now i need to know why @Secured is failing .. anyone?? It works perfectly in other parts of the application. Anyone experience something like this. I will try to post more details as I investigate it a bit
One thing I found was that if I have @Secured on one of the other methods in the class then this url mapping fails (with a 404).
Quote:
Originally Posted by
lilolme
I just can't figure out how to resolve the application context with Request mapping.
The application (app.war) that runs in the context /app
I don't want to hardcode the context in the controller urls so that I can run the app under different contexts e.g. in root context.
Until now I was using relative urls like so
page url : /app/module/123
form action : doSomething/abc
controller method: @RequestMapping("module/doSomething/{abc}")
I want to include this jsp form on different modules but this means it must work in different paths and relative urls will be impossible to manage. How can I specify the application context to controller method .. something equivalent to this without hardcoding it.
controller method: @RequestMapping("{app}/module/doSomething/{abc}")