spring rest post?

@ModelAttribute("user")
@RequestMapping(value = "/", method = RequestMethod.POST)
public User saveUser( @RequestBody User user ) throws IOException {
        logger.debug(user);
        return user;
}

requestbody will convert the json into bean(pojo), is there required to use annotation @ModelAttribute("user") in this case?

Answers


@ModelAttribute is not required in this case. For more information on this subject, please see Keith Donald's blog: Ajax Simplifications in Spring 3.0


Need Your Help

Drupal is extremely slow handling simple AJAX calls

php ajax performance drupal

I wrote a simple AJAX callback function in Drupal that performs a query to the DB and returns a JSON formatted string. Nothing fancy, the standard AJAX declaration in the module with a modest amoun...

C Help: MSVC debugger gets an “error reading characters of string” error… but only sometimes

c string compiler-errors

I am making a 5 card poker game, but I keep getting an error when running the program in the debugger.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.