Spring 3 MVC Annotations using JSON - XML Version

ImmoreGeott

New Member
We are using Spring 3.0 with annotations when suddenly, we were asked to used pure XML instead. I can't continue on the part where our controllers are using RequestMappings. It doesn't seem easy to find anything in the internet since most search results lead me back to annotations.
In my Controller class, I have methods of something like this:
@RequestMapping(value = "http://stackoverflow.com/save_data.json", method=RequestMethod.POST)
public @ResponseBody DataVO saveSkill(@RequestParam String name, @RequestParam String description, @RequestParam long id){
      DataVO myVO = new DataVO();
      //Do something here
      return myVO;
}

In JS we have something like this (for the controller method above)
$.ajax({
     type: "POST",
     url: "save_data.json",
     data: {name: "hello", description: "world", id: 100},
     success: function(data, status, XmlHttpRequest){
                //Do something here
     },
     error: function(XmlHttpRequest){
               //Do something here
     },
     dataType: "json"
});
What xml configuration will do the same thing as what the annotations currently do (like being able to map the url and the method type per method of the Controller class for html and json calls)?
If someone can give me the xml version for this, it will be of great help!
 
Back
Top