Announcement Announcement Module
Collapse
No announcement yet.
Getting the value matched with @RequestMapping Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting the value matched with @RequestMapping

    I have an annotation "@RequestMapping("/*.xml")" and I'd like to do something with the value that matches. For instance, if someone is looking for "/blah.xml" I'd like to be able to look up that it matched on "blah.xml". My method is being called as it should but I'm thinking that this value should be accessible?

  • #2
    Hi thatzall,

    you could add a parameter to the controlloer method that handles your request, for instance like this:

    Code:
    public ModelAndView handleXml(Par 1, par 2, HttpServletRequest request) {
    
    String uri = request.getRequestURI();
    String url = request.getRequestURL();
    
    }
    some String processing and you should be done :-)

    HTH,

    Hamb

    Comment


    • #3
      Thanks. That was the approach that I had taken but was hoping that there would be a variable available without the string parsing.

      Thanks again

      Comment

      Working...
      X