WebSphere Portal Server - Struts portlet Action and regular action - question

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > May 2006 > Struts portlet Action and regular action - question





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Struts portlet Action and regular action - question

2006-05-03, 7:15 pm

Hi,

Can anyone please clarify this question on websphere portal specific StrutsAction class and the regular Action class?

Appreciate your help in advance.


I have a portlet, which has regular struts components and portal specific struts components.

My basic action class extends from action class

class BasicAction extends Action{}

this is the first class that gets called before the portlet is rendered.

This "BasicAction" class calls some business helper to execute some business logic and depending on the results, it calls another action class.

Now this action class "MyStrutsPortletAction" extends from "StrutsAction" class

class MyStrutsPortletAction extends StrutsAction{}

!-- struts-config snippet --

<action path="/welcome" type="BasicAction">
<forward name="success" path="callStrutsAction.do"/>
</action>

<action path="/callStrutsAction" type="MyStrutsPortletAction">
<forward name="success" path="test.jsp"/>
</action>


Question---

1.) From my BasicAction class, when i try to forward to the "MyStrutsPorltetAction" class, it is never getting forwarded to that class.

I read somewhere that Websphere portal does not handle forwards and redirects to other action classes. And the article also mentioned that i need to use the "forward" method in the "PortletApiUtils" class to forward to a StrutsAction class.

so i did something like this in my BaiscAction class.
PortletApiUtil pau = PortletApiUtils.getUtilsInstance();
pau.forward("callStrutsAction.do")
this did not work.

Now i have a question here, since the execute method expects an ActionForward object as return, what should i return if i'm using the above statement


I also tried
pau.forward(pau. creatPortletURIWithStrutsURL(HTTPServlet
Request,"callStrutsAction.do").toString())

this also did not work.

I'm runnning out of ideas here. Can anyone please help?

thanks



2006-05-04, 7:15 pm

Hi,

Can anyone please tell me how to forward from a regular Action class to a (Portlet specific) StrutsAction class?

Appreciate your help
Thanks
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com