1

I have a spring controller with method

@RequestMapping(value="/list", method=RequestMethod.POST)
public ModelAndView getList(NSomeObject someObject) 

but the query is something like localhost:8080/list?a=some_value&b=some_value

How to convert this to java object? Is there any counterpart of json and jackson?

shruti1810
  • 3,920
  • 2
  • 16
  • 28
Pylos
  • 11
  • 1
  • possible duplicate of http://stackoverflow.com/questions/13442678/spring-mvc-how-take-the-parameter-value-of-a-get-http-request-in-my-controller-m – Ranjitsinh Jun 11 '15 at 11:01
  • Check this URL http://www.studytrails.com/frameworks/spring/spring-mvc-controller-input.jsp – Ranjitsinh Jun 11 '15 at 11:01

1 Answers1

2

You should do the following:

@RequestMapping(value="/list", method=RequestMethod.POST)
public ModelAndView getList(@RequestParam("a") String a_value, @RequestParam("b") String b_value, @RequestBody NSomeObject someObject) 
shruti1810
  • 3,920
  • 2
  • 16
  • 28