Announcement Announcement Module
Collapse
No announcement yet.
How to get the value of controller level @RequestMapping (params) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to get the value of controller level @RequestMapping (params)

    can any one please send the code sample to get the controller level @RequestMapping attribute "params" values in to the controller methods ,to pass these values to dao etc classes,My controller looks like as follows,


    @Controller
    @RequestMapping(value = "get/projects", params = "username", method = RequestMethod.GET, produces = "application/json")
    public class ProjectsDataController {


    ...........public void xyz(){
    }
    .........
    }

    finally, I want the 'username' value in xyz() method.....

    Thanks in Advance

  • #2
    Please use [ code][/code ] tags when posting code.

    Judging by your code and question I suggest a read of the web chapter of the reference guide as I think you are missing some key concepts.

    Comment


    • #3
      Thank you Mr. Marten Deinum,
      could you please send me the best reference links to better understand about @RequestMapping attributes..
      I know how to use it at method level using the concept of @RequestParam,But I don't undrestand about the class level RequestParam values..Please follow the code sample..

      [ code]


      @Controller
      @RequestMapping(value = "get/projects", params = "username", method = RequestMethod.GET, produces = "application/json")
      public class ProjectsDataController {


      ...........public void xyz(){
      }
      .........
      }
      [/code ]

      finally, I want the 'username' value in xyz() method.....

      Thanks in Advance

      Comment


      • #4
        Again 'Please use [ code][/code ] tags when posting code.'

        There are no class level request params. The stuff you put in there is used for mapping not the retrieve values. So as I stated you seem to lack some basic concepts (or at least are confused at using them). YOu want to read chapter 16 of the reference guide which can be found that the springsource website.

        Comment

        Working...
        X