在jboss portal中使用带有struts2和portlet的redirectAction时出错

时间:2009-09-21 13:43:37

标签: redirect struts2 jboss-portal

我有以下struts.xml:
<struts>
<package name="default" namespace="/view" extends="struts-portlet-default">
<action name="index" class="com.gigi.LoginAction">
<result type="redirectAction">
<param name="actionName">showAlerts</param>
<param name="namespace">/view</param>
<param name="portletMode">view</param>
</result>
<result name="error">/includes/error.jsp</result>
</action>
<action name="showAlerts" class="com.gigi.AlertsAction">
<result>/jsp/view/Alerts.jsp</result>
</action>
</package>
<package name="edit" namespace="/edit" extends="struts-portlet-default">
<action name="index" class="com.gigi.UpdateNameAction">
<result type="redirectAction">
<param name="actionName">index</param>
<param name="portletMode">view</param>
</result>
<result name="input">/jsp/edit/index.jsp</result>
</action>
</package>
</struts>

<struts>
<package name="default" namespace="/view" extends="struts-portlet-default">
<action name="index" class="com.gigi.LoginAction">
<result type="redirectAction">
<param name="actionName">showAlerts</param>
<param name="namespace">/view</param>
<param name="portletMode">view</param>
</result>
<result name="error">/includes/error.jsp</result>
</action>
<action name="showAlerts" class="com.gigi.AlertsAction">
<result>/jsp/view/Alerts.jsp</result>
</action>
</package>
<package name="edit" namespace="/edit" extends="struts-portlet-default">
<action name="index" class="com.gigi.UpdateNameAction">
<result type="redirectAction">
<param name="actionName">index</param>
<param name="portletMode">view</param>
</result>
<result name="input">/jsp/edit/index.jsp</result>
</action>
</package>
</struts>


and LoginAction has the following execute method:

我正在尝试从LoginAction到AlertsAction的重定向。每次我在jboss portal 2.7.1中打开portlet时,都会出现以下错误:

  

请求的资源(/ portlet / view / showAlerts)不可用

谁能告诉我我做错了什么? 我尝试用不同的方式编写重定向,但结果是一样的...... 感谢。

1 个答案:

答案 0 :(得分:0)

Alerts.jsp究竟在哪里?是在/ jsp还是/ WEB-INF / jsp?你可以从AlertsAction的execute()方法中记录一些东西吗?