You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Jeff Sheets <je...@gmail.com> on 2004/12/14 16:02:01 UTC

struts bridge submits twice

We are having an issue with the struts portals bridge, where a submit
is trying to go through the action class twice.  As soon as the action
is completed and the forward happens, the action is invoked again. 
Has anyone else seen this?  Does anyone have any tips?

Thanks,
-- Jeff

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


Re: struts bridge submits twice

Posted by Ate Douma <at...@douma.nu>.
This has been solved by Jeff himself, he mailed me directly.
The solution is to define the PortletRequestProcessor as controller in the struts-config file:

   <controller pagePattern="$M$P"
               inputForward="true"
               processorClass="org.apache.portals.bridges.struts.PortletRequestProcessor"/>

Without this, the Struts framework uses its own PortletRequestProcessor under certain
conditions (not always) with as result that the StrutsPorlet isn't informed about the end
state of the actionRequest. Then, it will use the original Struts page URL for the renderRequest
again, leading to the double processing of the action.

I'm currently working on some improvements and enhancements for the Struts Bridge which
I hope to commit in a few days or a week or so. I will then also provide proper usage documentation,
including a checklist and instructions to enable existing Struts applications as portlets.

Regards, Ate

Jeff Sheets wrote:
> Here are the debug statements showing the progression through the
> struts bridge.  Sorry to reply to my own message, but I wanted to
> relay this extra information.  It looks like the action is processed
> once for requestType ACTION and another time for requestType VIEW, but
> the action should really only be processed once.
> -- Jeff
> 
> DEBUG org.apache.portals.bridges.struts.StrutsPortlet.processRequest(StrutsPortl
> et.java:263) org.apache.portals.bridges.struts.StrutsPortlet : process
> path: /myService.do, query string: null, requestType: ACTION
> Start MyServiceAction
> End MyServiceAction
> DEBUG org.apache.portals.bridges.struts.PortletServletRequestDispatcher.invoke(P
> ortletServletRequestDispatcher.java:62) org.apache.portals.bridges.struts.Portle
> tServletRequestDispatcher : saving  dispatch to :/myViewer.jsp, from
> ACTION /myService.do
> DEBUG org.apache.portals.bridges.struts.StrutsPortlet.processRequest(StrutsPortl
> et.java:321) org.apache.portals.bridges.struts.StrutsPortlet : action render pag
> e: /myService.do
> WARN  org.apache.jetspeed.engine.AbstractEngine.getContainerService(AbstractEngi
> ne.java:382) org.apache.jetspeed.engine.AbstractEngine : No ContainerService def
> ined for org.apache.pluto.services.title.DynamicTitleService
> DEBUG org.apache.portals.bridges.struts.StrutsPortlet.processRequest(StrutsPortl
> et.java:263) org.apache.portals.bridges.struts.StrutsPortlet : process
> path: /myService.do, query string: null, requestType: VIEW
> Start MyServiceAction
> java.lang.Exception: Error: 
>    [stack trace cutout, but occurs since MyServiceAction entered twice
> on same request]
> DEBUG org.apache.portals.bridges.struts.PortletServletRequestDispatcher.invoke(P
> ortletServletRequestDispatcher.java:108) org.apache.portals.bridges.struts.Portl
> etServletRequestDispatcher : invoking   dispatch to :/errorPage.jsp, from VIEW /
> myService.do
> 
> 
> 
> On Tue, 14 Dec 2004 09:02:01 -0600, Jeff Sheets <je...@gmail.com> wrote:
> 
>>We are having an issue with the struts portals bridge, where a submit
>>is trying to go through the action class twice.  As soon as the action
>>is completed and the forward happens, the action is invoked again.
>>Has anyone else seen this?  Does anyone have any tips?
>>
>>Thanks,
>>-- Jeff
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
> 
> 
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


Re: struts bridge submits twice

Posted by Jeff Sheets <je...@gmail.com>.
Here are the debug statements showing the progression through the
struts bridge.  Sorry to reply to my own message, but I wanted to
relay this extra information.  It looks like the action is processed
once for requestType ACTION and another time for requestType VIEW, but
the action should really only be processed once.
-- Jeff

DEBUG org.apache.portals.bridges.struts.StrutsPortlet.processRequest(StrutsPortl
et.java:263) org.apache.portals.bridges.struts.StrutsPortlet : process
path: /myService.do, query string: null, requestType: ACTION
Start MyServiceAction
End MyServiceAction
DEBUG org.apache.portals.bridges.struts.PortletServletRequestDispatcher.invoke(P
ortletServletRequestDispatcher.java:62) org.apache.portals.bridges.struts.Portle
tServletRequestDispatcher : saving  dispatch to :/myViewer.jsp, from
ACTION /myService.do
DEBUG org.apache.portals.bridges.struts.StrutsPortlet.processRequest(StrutsPortl
et.java:321) org.apache.portals.bridges.struts.StrutsPortlet : action render pag
e: /myService.do
WARN  org.apache.jetspeed.engine.AbstractEngine.getContainerService(AbstractEngi
ne.java:382) org.apache.jetspeed.engine.AbstractEngine : No ContainerService def
ined for org.apache.pluto.services.title.DynamicTitleService
DEBUG org.apache.portals.bridges.struts.StrutsPortlet.processRequest(StrutsPortl
et.java:263) org.apache.portals.bridges.struts.StrutsPortlet : process
path: /myService.do, query string: null, requestType: VIEW
Start MyServiceAction
java.lang.Exception: Error: 
   [stack trace cutout, but occurs since MyServiceAction entered twice
on same request]
DEBUG org.apache.portals.bridges.struts.PortletServletRequestDispatcher.invoke(P
ortletServletRequestDispatcher.java:108) org.apache.portals.bridges.struts.Portl
etServletRequestDispatcher : invoking   dispatch to :/errorPage.jsp, from VIEW /
myService.do



On Tue, 14 Dec 2004 09:02:01 -0600, Jeff Sheets <je...@gmail.com> wrote:
> We are having an issue with the struts portals bridge, where a submit
> is trying to go through the action class twice.  As soon as the action
> is completed and the forward happens, the action is invoked again.
> Has anyone else seen this?  Does anyone have any tips?
> 
> Thanks,
> -- Jeff
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org