Victor
Victor

Reputation: 17107

What is the use of @RequestMapping("VIEW") annotation in Spring Portlet MVC

In my Spring portlet controller class, I have this at the class level:

@Controller
@RequestMapping("VIEW")
public class myContoller extends AbstractController

Now the @RequestMapping is supposed to map a request url to an action handler(controller). But what is the use of saying @RequestMapping("VIEW").

In the portlet.xml, I have <portlet-mode>VIEW</portlet-mode> defined for this particular portlet controller.

Upvotes: 4

Views: 4425

Answers (1)

soulcheck
soulcheck

Reputation: 36777

Portlets can support different modes (default being VIEW, EDIT and HELP if I remember correctly).

<portlet-mode>VIEW</portlet-mode> in portlet.xml says that the portlet supports VIEW mode.

@Controller
@RequestMapping("VIEW") 
public class myContoller extends AbstractController

simply limits requests handled by @RequestMapping annotated methods of this controller to those sent in VIEW mode.

Upvotes: 3

Related Questions