Difference between @ActionMapping, @RequestMapping, @Rendermapping

The differences between @RequestMapping, @ActionMappingand @RenderMappingI was not very clear. It seems that all of the above ultimately maps the request URL to the actual method in the controller. So what is the difference? What can be done with help @RenderMappingthat cannot be done with @RequestMapping?

+5
source share
1 answer

@RequestMappingallows you to specify the mode (EDIT, VIEW, etc.) and many other parameters (although not the state of the window). @RenderMappingit allows you to specify only query parameters and window status (MAXIMIZED, NORMAL, etc.) and is a convenient way to indicate the display of the Render request. You can use both annotations in the same class. For example, you can annotate at the class level with RequestMapping to indicate that it serves requests for VIEW mode, and then at the method level annotate handlers for specific requests with @RenderMapping(or @ActionMappingor @ResourceMapping).

It is probably useful to say something about the different types of queries.

Render queries are used to render HTML, so usually you should display a JSP or some other kind.

, , .. , . , , , , . .

, , .

. AJAX , JSON XML, .

.

Spring . , , , .

NB. @RequestMapping , , , @RenderMapping, @ActionMapping @ResourceMapping .

+11

All Articles