Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between @RequestMapping and @RenderMapping

When should I use @RequestMapping instead of @RenderMapping and vice versa ?

For example what is the difference between the following where one method uses @RequestMapping and the other uses @RenderMapping

@Controller
@RequestMapping("VIEW")
public click myController {

@RequestMapping("VIEW")
public String showView(final ModelMap argMap, final RenderRequest argRequest) { 
    return "myView"
}

}

and :

@Controller
@RequestMapping("VIEW")
public click myController {

@RenderMapping("VIEW")
public String showView(final ModelMap argMap, final RenderRequest argRequest) { 
    return "myView"
}

}
like image 593
user701254 Avatar asked Dec 08 '25 13:12

user701254


1 Answers

@RenderMapping is a method level annotation which is used to map render requests to render methods of handler class.

The @RequestMapping annotation maps portlet requests to appropriate handlers and handler methods.

Please check this for more details

http://books.dzone.com/articles/spring-30-portlet-mvc-part-2

like image 92
Sajith Avatar answered Dec 10 '25 03:12

Sajith



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!