Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Massimiliano Segreto
GenereicPortlet does not fully implement JSR-286?
October 23, 2008 8:02 AM
Answer

Massimiliano Segreto

Rank: New Member

Posts: 1

Join Date: October 23, 2008

Recent Posts

I am trying to leverage the new JSr-286 @ProcessAction annotation:

In the JSP body there is the correct tag


1<a href="<portlet:actionURL name="showCompany" windowState="maximized" />">


This fragment work flawlessy and generate an url which containing the correct parameter (javax.portlet.action=showCompany)

The problem is in the portlet class.
I extentended javax.portlet.GenericPortlet WITHOUT overriding or implementing processAction:


 1
 2public class CompanyPortlet extends GenericPortlet {
 3
 4........
 5    
 6    @ProcessAction(name="showCompany")
 7        void processShowCompany(ActionRequest req, ActionResponse resp) 
 8         {
 9        System.out.println("showCompany fired!");   
10       
11        }
12
13........
14
15}


Once deployed in Liferay (5.1.5 bundle with Jboss Tomcat 4.2) when i use the link I get
1javax.portlet.PortletException: processAction method not implemented


It seems that the GenericPortlet in Liferay library there is no processAction method that should do a dispatch for the action based on the annotation.

I compile and build the servlet on Eclipse with 1.6.0 java, against potlet.jar in /server/default/lib/ext in the Liferay-JBoss-tomcat bundle

Any hints or suggestion? Where I am wrong?

Thanks in advance

Massimiliano Segreto
Oliver Bayer
RE: GenereicPortlet does not fully implement JSR-286?
June 29, 2009 2:02 AM
Answer

Oliver Bayer

Rank: Liferay Master

Posts: 883

Join Date: February 18, 2009

Recent Posts

Hi,

maybe you've found the solution on your own. But even it's an old question others may find it useful. I came across the same question and found the solution in the portlet 2.0 api in the following statement:
Note that the annotated methods needs to be public in order to be allowed to be called by GenericPortlet.

So all you have to do is to change your method to something like that:
1[b]public[/b] void processShowCompany(ActionRequest req, ActionResponse resp)

I'm using Liferay trunk combined with a tomcat 6 server and in my example form and portlet class it works as expected.

HTH