Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Jack Pardshe
Struts2 Portlet redirect action fails
February 22, 2011 9:08 AM
Answer

Jack Pardshe

Rank: New Member

Posts: 2

Join Date: February 22, 2011

Recent Posts

Hi all,

I'm currently trying to create my first portlet for Liferay using Struts2 using this tutorial:
https://cwiki.apache.org/confluence/display/WW/Struts+2+Portlet+Tutorial

However I have faced up with a problem when I had to the redirectionAction part: it fails ("The requested resource (/SimpleStrutsPorlet-portlet/edit/editIndex) is not available").

I've been searching during 2 days and the only response I found was to set action-url-redirect to true in liferay-portlet.xml, which I did but It didn't changed anything.


Thanks a lot for any help emoticon
Attachments: portlet.xml (1.8k), struts.xml (1.0k)
Jack Pardshe
RE: Struts2 Portlet redirect action fails
February 23, 2011 6:44 AM
Answer

Jack Pardshe

Rank: New Member

Posts: 2

Join Date: February 22, 2011

Recent Posts

Ok I finally found a solution, thanks to this post:
Liferay + struts2

I "just" needed to use Struts2 JSR286 portlet instead of JSR168 portlet.
That let me think that's there's a bug coming from Liferay6
Luis Rodríguez Fernández
RE: Struts2 Portlet redirect action fails
March 10, 2011 11:06 AM
Answer

Luis Rodríguez Fernández

Rank: Junior Member

Posts: 86

Join Date: June 26, 2009

Recent Posts

Hi Jack,

I am developing a portlet using struts2 over Liferay Portal (5.2.3 distribution over Apache Tomcat 6) I also want to redirect to Action2 from Action1.

I can do the redirect, but my problem is that when Action2 is processed the Action1 url remains, so if you push the f5 key the Action1 is executed. It seems that the sendRedirect() method doesn't work...

<action name="Action1" class="com.action.Action1">
<result name="input">/WEB-INF/view/action1.jsp</result>
<result type="redirectAction">
<param name="actionName">Action2</param>
<param name="portletMode">view</param>
<param name="namespace">/view</param>
</result>
</action>


<action name="Action2"
class="com.action.Action2">
<result name="input">/WEB-INF/view/action2.jsp</result>
</action>


By the way I am using org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher, mmm, I am going to try your solution...

Thanks in advance,

Luis
abhinav ladani
RE: Struts2 Portlet redirect action fails
September 7, 2011 10:19 PM
Answer

abhinav ladani

Rank: New Member

Posts: 4

Join Date: July 28, 2010

Recent Posts

Hi to all To redirect in struts2 portlet

u have to only emoticon just set <action-url-redirect>true</action-url-redirect>

in liferay-portlet.xml.

It works in latest liferay6.0.6 version.
Eric Tse
RE: Struts2 Portlet redirect action fails
November 8, 2011 11:43 PM
Answer

Eric Tse

Rank: New Member

Posts: 9

Join Date: August 5, 2011

Recent Posts

abhinav ladani:
Hi to all To redirect in struts2 portlet

u have to only emoticon just set <action-url-redirect>true</action-url-redirect>

in liferay-portlet.xml.

It works in latest liferay6.0.6 version.


Hi Abhinav,

Can you give me more detail how it can be done in 6.0.6 ? It seems to me that the type=redirectAction and type=redirect does not work in my configuration also.... can you give me some examples ?

Thanks,
Eric