Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Kamesh Sampath
Redirction to existing Struts Path via Struts Action Hook
October 22, 2011 8:40 AM
Answer

Kamesh Sampath

Rank: Regular Member

Posts: 159

Join Date: May 26, 2010

Recent Posts

Following this blog, i was able use the Struts Action hook to add new functionality to my existing hook . Now after doing my hook logic, i want to do a redirection or forward to an existing struts portal path, I am having a class which extends from BaseStrutsPortletAction and in a particular case i want to redirect to another existing path login/login .

can anyone tell me how to do that ?
Kowbathullah Gnaniyar
RE: Redirction to existing Struts Path via Struts Action Hook
May 29, 2012 6:01 AM
Answer

Kowbathullah Gnaniyar

Rank: Liferay Master

Posts: 608

Join Date: December 19, 2007

Recent Posts

Kamesh,

Hope you are calling the super method of originalStrutsPortletAction path to redirect from your Process or Render action of the hook which extended BaseStrutsPortletAction.

Try this:

1super.processAction(originalStrutsPortletAction, portletConfig, actionRequest,
2                actionResponse);


if it doesn't redirect properly, then try this if you are able to get the redirect path in StrutsAction hook.:

1actionResponse.sendRedirect(ParamUtil.getString(actionRequest, "redirect"));



or redirect to proper jsp file using response object.

1[b]actionResponse.setRenderParameter("jspPage", "<JSP-PATH>");[/b]


HTH

- Gnaniyar Zubair
Kamesh Sampath
RE: Redirction to existing Struts Path via Struts Action Hook
May 29, 2012 8:56 PM
Answer

Kamesh Sampath

Rank: Regular Member

Posts: 159

Join Date: May 26, 2010

Recent Posts

thanks for the response, i did implement that way long time back following the liferay sources.
Pablo Zapico
RE: Redirction to existing Struts Path via Struts Action Hook
June 26, 2013 11:37 PM
Answer

Pablo Zapico

Rank: Junior Member

Posts: 46

Join Date: June 2, 2010

Recent Posts

Good morning .. I followed suit and I work with them very well, but not quite understand how I have to do to redirect to another action. For example I want to run my action after display the edition of a containg
Jose Jimenez
RE: Redirction to existing Struts Path via Struts Action Hook
June 27, 2013 12:06 AM
Answer

Jose Jimenez

LIFERAY STAFF

Rank: Regular Member

Posts: 151

Join Date: August 22, 2012

Recent Posts

Hi Pablo,

Here you have the way to add or overwrite structs-actions https://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/lp-6-1-dgen06-overriding-and-adding-struts-actions-0

You only have to change the struts_action param for your custom path in order to run your new action.

I hope this will be helpful for you.

Kind regards!

Jose A.
Pablo Zapico
RE: Redirction to existing Struts Path via Struts Action Hook
June 27, 2013 3:11 AM
Answer

Pablo Zapico

Rank: Junior Member

Posts: 46

Join Date: June 2, 2010

Recent Posts

Jose Jiménez:
Hi Pablo,

Here you have the way to add or overwrite structs-actions https://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/lp-6-1-dgen06-overriding-and-adding-struts-actions-0

You only have to change the struts_action param for your custom path in order to run your new action.

I hope this will be helpful for you.

Kind regards!

Jose A.



Good morning.

Thank you very much for the help .. It has been very useful.

Sorry for my English
Jose Jimenez
RE: Redirction to existing Struts Path via Struts Action Hook
June 27, 2013 3:32 AM
Answer

Jose Jimenez

LIFERAY STAFF

Rank: Regular Member

Posts: 151

Join Date: August 22, 2012

Recent Posts

You are welcome emoticon