Results 1 to 4 of 4

Thread: POST and GET for same controller method ?? ambiguous mapping

Hybrid View

  1. #1

    Default POST and GET for same controller method ?? ambiguous mapping

    Hi,

    we are working on an app which works fine but we have a problem where we need some controller methods to support GET and POST

    So I am trying to make all all controller methods support GET and POST using the RequestMethod array option:


    @RequestMapping( value = "/xxx/yyy", method = { RequestMethod.GET, RequestMethod.POST } )
    public ModelAndView xxx( @RequestParam( ).... {


    but it doesnt seem to work, I get ambiguous mapping errors

    any ideas?

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    Post the logging... If you get this error it means the exact same @RequestMapping is used somewhere else... Enable debug logging and check which controller methods map to which URL.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3

    Default

    I dont think so. Are you sure @RequestMapping supports GET and POST at same time in its requestMethod array ?

    this is only mention of it I have found
    http://www.intertech.com/Blog/Post/S...r-Methods.aspx

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    I do think so ... Else having multiple methods on the @RequestMapping would be pretty useless... So yes it is supported and as mentioned check your logs (enable debugging) and you sould soon enough find the culprit...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •