掲示板

Struts2 Portlet redirect action fails

13年前 に Jack Pardshe によって更新されました。

Struts2 Portlet redirect action fails

New Member 投稿: 2 参加年月日: 11/02/22 最新の投稿
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
13年前 に Jack Pardshe によって更新されました。

RE: Struts2 Portlet redirect action fails

New Member 投稿: 2 参加年月日: 11/02/22 最新の投稿
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
thumbnail
13年前 に Luis Rodríguez Fernández によって更新されました。

RE: Struts2 Portlet redirect action fails

Junior Member 投稿: 86 参加年月日: 09/06/26 最新の投稿
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
thumbnail
12年前 に abhinav ladani によって更新されました。

RE: Struts2 Portlet redirect action fails

New Member 投稿: 4 参加年月日: 10/07/29 最新の投稿
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.
thumbnail
12年前 に Eric Tse によって更新されました。

RE: Struts2 Portlet redirect action fails

New Member 投稿: 9 参加年月日: 11/08/05 最新の投稿
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