Announcement Announcement Module
No announcement yet.
Spring Portlet MVC and friendly URLs in Liferay Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Portlet MVC and friendly URLs in Liferay


    I am working on a portlet to be deployed in Liferay 6.0.5 container. The portlet uses Spring Portlet MVC annotations. Among other annotations, my controller uses

    @ActionMapping(params = "action=performSearch")

    to mark the controller method used to handle the search action. The portlet works great.

    The portlet stops working when I try to use Liferay's mechanism for friendly URLs ( Instead of a long and ugly URL (generated in response to a form POST), which contains a dozen or so parameters, I create a mapping that shortens the URL considerably. The problem is that with the friendly URL the action handling in the controller no longer works.

    I tried many variations of the URL mapping. Originally the mapped URL did not have 'action' parameter (the mapping scheme seems to replace the URL parameters with path elements). Well, I changed the mapping to make sure that ActionMapping uses the request parameter which is part of the URL. Nothing works - the action method is not being invoked.

    Why would mapping the URL cause the action mapping to stop working in a portlet? Is there a way to debug action mapping? Is there a way to perform action mapping based on the URL path (like Grails uses /controller/action/id) rather than on URL parameters?

    Thank you,


  • #2
    Spring Portlet MVC and friendly URLs in Liferay

    Did you find a resolution to the problem?


    • #3
      Yes, I abandoned Spring Portlet MVC replacing it with Liferay's own framework :-(


      • #4
        Geez! .. I have opened up a ticket with Liferay .. will let you know what they say.


        • #5
          how to map multiple portlet controllers with @RequestMapping ?


          I have a question regarding mapping requests to different portlet controllers using spring mvc annotations.

          If I do have two portlet controllers, let's say portlet-A controller, Portlet-B controller how to map different portlets with @RequestMapping ? what are the configurations to use in *-portlet.xml .

          Thanks in advance.