-
1. Re: processAction method not implemented
tsentih Mar 10, 2009 10:19 PM (in response to bjoernb)Hi,bjoernb
I had resolved this problem, I use the jboss portal 2.7.1
This is my event
@XmlRootElement
public class TestEvent implements Serializable {
private String id;
public TestEvent(String id)
{
System.out.println("Start Event");
this.id = id;
}
public String getId()
{
System.out.println("Start Event2");
return id;
}
}
And next is my set event method , I use the portlet to set event in actionlistener:
.....
ActionResponse actionResponse = (ActionResponse)responseObject;
System.out.println("aaaaaa");
QName QNAME = new QName("urn:dfi:portal:samples:event", "TestEvent");
TestEvent menueSelectionEvent = new TestEvent("start action event");
actionResponse.setEvent(QNAME, menueSelectionEvent);
...
Last, how to get the event:
@Override
public void processEvent(EventRequest request, EventResponse response)
throws PortletException, IOException {
// TODO Auto-generated method stub
System.out.println("get Event :1111111111111111111" );
TestEvent testEvent = (TestEvent) request.getEvent().getValue();
System.out.println("get Event :"+ testEvent.getId());
}
You can try it, it works...
as follow is part of my portle.xml setting :
C
<short-title>C</short-title>
</portlet-info>
<supported-processing-event>
<qname xmlns:jbp="urn:dfi:portal:samples:event">jbp:TestEvent
</supported-processing-event>
<event-definition>
<qname xmlns:jbp="urn:dfi:portal:samples:event">jbp:TestEvent
<value-type>dfi.portlet.event.TestEvent</value-type>
</event-definition> -
2. Re: processAction method not implemented
bjoernb Mar 13, 2009 3:30 AM (in response to bjoernb)hi tsentih,
thx for your post :) but that doesn't solve the problem. it just is another way to implement without the annotation :-/
here are again my 2 portlets
the sending
public class RestaurantSuche extends GenericPortlet {
@RenderMode(name="view")
public void viewNormal(RenderRequest request, RenderResponse response) throws PortletException, IOException {
getPortletContext().getRequestDispatcher("/jsp/RestaurantSuche.jsp").forward(request, response);
}
@ProcessEvent(qname="{http:sschmeckt.de/events}suchString")
public void processEvent1(EventRequest request, EventResponse response) throws PortletException, IOException {
String suchString = request.getParameter("suchString");
response.setEvent(new QName("http:sschmeckt.de/events", "suchString"), suchString);
}
}
and the receiving
public class RestaurantListe extends GenericPortlet {
@RenderMode(name="view")
public void viewNormal(RenderRequest request, RenderResponse response) throws PortletException, IOException {
getPortletContext().getRequestDispatcher("/jsp/RestaurantListe.jsp").forward(request, response);
}
/** This method processes received events with the following QName
*/
@ProcessEvent(qname="{http:sschmeckt.de/events}suchString")
public void processEvent1(EventRequest request, EventResponse response) throws PortletException, IOException {
// Let's store the event value into the portlet's session (we assume it is never null)
String eventValue = (String) request.getEvent().getValue();
request.getPortletSession().setAttribute("suchString", eventValue);
}
}
and my portlet.xml
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
version="2.0">
<portlet-name>RestaurantSuche</portlet-name>
<portlet-class>
de.sschmeckt.RestaurantSuche
</portlet-class>
<mime-type>text/html</mime-type>
<portlet-info>
Suche des Restaurants
</portlet-info>
<supported-publishing-event>
<qname xmlns:x="http:sschmeckt.de/events">x:suchString
</supported-publishing-event>
<portlet-name>RestaurantListe</portlet-name>
<portlet-class>
de.sschmeckt.RestaurantListe
</portlet-class>
<mime-type>text/html</mime-type>
<portlet-info>
Auflistung aller gefundenen Restaurants
</portlet-info>
<supported-publishing-event>
<qname xmlns:x="http:sschmeckt.de/events">x:suchString
</supported-publishing-event>
<event-definition>
<qname xmlns:x="http:sschmeckt.de/events">x:suchString
<value-type>java.lang.String</value-type>
</event-definition>
</portlet-app>
and still when i compile and publish i see both portlets and the are working... but when i want to send by pushing a button on the sending portlet
Suche:
i still get the following error
ERROR
Cause: javax.portlet.PortletException: processAction method not implemented
Message: processAction method not implemented
StackTrace:
javax.portlet.PortletException: processAction method not implemented
at javax.portlet.GenericPortlet.processAction(GenericPortlet.java:177)
at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl$Invoker.doFilter(PortletContainerImpl.java:557)
at org.jboss.portal.portlet.impl.jsr168.api.FilterChainImpl.doFilter(FilterChainImpl.java:109)
at org.jboss.portal.portlet.impl.jsr168.api.FilterChainImpl.doFilter(FilterChainImpl.java:72)
at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.dispatch(PortletContainerImpl.java:505)
at org.jboss.portal.portlet.container.ContainerPortletDispatcher.invoke(ContainerPortletDispatcher.java:42)
at org.jboss.portal.portlet.PortletInvokerInterceptor.invoke(PortletInvokerInterceptor.java:82)
at org.jboss.portal.core.aspects.portlet.TransactionInterceptor.org$jboss$portal$core$aspects$portlet$TransactionInterceptor$invokeNotSupported$aop(TransactionInterceptor.java:97)
at org.jboss.portal.core.aspects.portlet.TransactionInterceptor$invokeNotSupported_N6922078035659651697.invokeNext(TransactionInterceptor$invokeNotSupported_N6922078035659651697.java)
at org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)
[...]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)
can someone help ?
thanks