Announcement Announcement Module
Collapse
No announcement yet.
Inconsistent Behaviour of @RequestMapping Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Inconsistent Behaviour of @RequestMapping

    Hi springers,

    I have having some issue with the MVC Requestmapping annotation in terms of the behaviour of Spring processing the incoming request.

    Below are the 2 requestmapping defined.

    @RequestMapping(value = "/function/a1", method = { RequestMethod.POST })
    public ModelAndView functionA1(
    }

    @RequestMapping(value = "/function/a1", method = { RequestMethod.POST }, params = "removeRecord")
    public ModelAndView functionA2(
    }


    On my web page on local jetty server, i have a <input value="Remove Record" type="submit" class="action" name="removeRecord"/>. On clicking the button, Spring MVC call @RequestMapping(value = "/function/a1", method = { RequestMethod.POST }) instead of @RequestMapping(value = "/function/a1", method = { RequestMethod.POST },, params = "removeRecord").

    On another server, it is behaving correctly.

    Any idea why is this so?

  • #2
    Please use [ code][/code ] tags when posting code that way it remains readable...

    For the input type both specify the name and id... Depending on the browser it sometimes uses the id sometimes the name at least from my experience. I doubt it depends on the server.

    Comment

    Working...
    X