struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phillips1021 <bphill...@ku.edu>
Subject Problem Using Struts 2.1.8 Portlet Plugin With redirectAction
Date Thu, 01 Oct 2009 17:06:06 GMT

I have a Struts 2 portlet application that works fine using Struts 2.0.14.  

We could not get it to work using 2.1.6 and the 2.1.6 portlet plugin due to
the problem the 2.1.6 portlet plugin version had with the s:form tag (see 
http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tc23981728.html#a24117787
http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tc23981728.html#a24117787

(JIRA Issue WW-3164).

Now that Struts 2.1.8 is out I wanted to use that version in my Struts 2
portlet application.

After upgrading my pom.xml to 2.1.8 and adding the dependency for the 2.1.8
portlet plugin I rebuild and tested my Struts 2 portlet application.

Struts 2.1.8 portlet plugin fixed the issue with the s:form tag.  However,
now my actions for the portlet view that use type="redirectAction" fail. 
Struts displays the following:

The requested resource (/struts2crudportletexamplefinish/view/index.action)
is not available

You can download an example application (Maven 2, Eclipse) here:  
http://www.brucephillips.name/struts/Struts2CRUDPortletExample_Finish.zip
http://www.brucephillips.name/struts/Struts2CRUDPortletExample_Finish.zip  
if you want to see the entire source code or run the application.

Here is an excerpt from my struts.xml file:

<include file="struts-portlet-default.xml"/>

	<package name="view" extends="struts-portlet-default" namespace="/view">
	
		<action name="deleteEmployee"
class="com.struts2.tutorial.action.EmployeeAction" method="delete">
			<result name="success" type="redirectAction">
				index
			</result>
			<result name="input">/portlet/employeeFormPortlet.jsp</result>
		</action>

    </package>

Here is how I create the delete link that calls the deleteEmployee action:

<s:url portletMode="view" portletUrlType="action" action="deleteEmployee"
windowState="normal" id="url">
                    <s:param name="employee.employeeId" value="employeeId"/>
                </s:url>
                 <s:property value= ">Delete 

When clicking on the Delete link the deleteEmployee action is executed and
"success" is returned.  But the redirectAction is not completed successfully
(the index.action is not executed).

The message I get is:

The requested resource (/struts2crudportletexamplefinish/view/index.action)
is not available

but I can copy and past the part in parenthesis into my browser and the
action will execute.

I've searched through the mailing list and studied the portlet tutorial
example code (see: 
http://struts.apache.org/2.1.8/docs/struts-2-portlet-tutorial.html
http://struts.apache.org/2.1.8/docs/struts-2-portlet-tutorial.html ) but
cannot figure out why this is not working when it did work in 2.0.14

Any help would be greatly appreciated.

Bruce 

-- 
View this message in context: http://www.nabble.com/Problem-Using-Struts-2.1.8-Portlet-Plugin-With-redirectAction-tp25702898p25702898.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message