Announcement Announcement Module
Collapse
No announcement yet.
Recurring dynamic part of @RequestMapping: Best way to handle? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Recurring dynamic part of @RequestMapping: Best way to handle?

    Hi,

    I'm trying to figure out, how to handle a recurring dynamic part of a @RequestMapping. The dymamic part is always the first part of every url-path (e.g.: htt://myhost/hereComesADynamicString/search)

    @Controller
    @RequestMapping("hereComesADynamicString/search/*")
    public class SearchController
    {
    ...
    }

    Since this dymamic part is at the beginning of all my @RequestMappings I don't wanna cope with it in every Controller. I want to handle the dynamic-part somewhere before (and store this dynamic-part string in a ThreadLocal for my needs), so my controllers could look (kind of) like this:

    @Controller
    @RequestMapping("search/*")
    public class SearchController
    {
    ...
    }

    Any hints how I could achive this?

    Jonny
Working...
X