views:

131

answers:

2

I reading spring 3.0.x reference but I don't know how to use ,can you paste a full example?

A: 

If you do a search for

spring @ResponseBody lang:java

and

@RequestBody lang:java

in Google Code Search, you can see numerous usages of @ResponseBody and @RequestBody there that might help you understand it better.

Bytecode Ninja
+1  A: 

Use @ResponseBody if you want to return the content directy whitout any JSPs.

@RequestMapping("blubber")
@ResponseBody
public String blubber() {

    return "<html><body>Hello World</body></html>
}
Ralph