Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

Cancel-Redirect Action not working on Portlet

Kofford, C Todd

2010-03-15

Replies: Find Java Web Hosting

Author LoginPost Reply
I am using Struts 2.1.8.1 with the portlet plug-in, and my webapp, a
simple album database, is deployed on a tomcat 6 container.

When running this webapp stand-alone the cancel button action correctly
fires and calls the "cancelAlbum" action, but when running the same
webapp as a portlet in uPortal 3.1.2, the cancel button fires the action
defined for the form, "saveAlbum", not the redirected one that I defined
in the submit tag for the cancel button.

I have the following form defined in a JSP, for adding/editing an album:

<s:form action="saveAlbum" method="post">
<s:textfield name="album.artist" label="%{getText('label.artist')}"
size="40"/>
<s:textfield name="album.title" label="%{getText('label.title')}"
size="40"/>
<s:textfield name="album.releaseYear"
label="%{getText('label.releaseYear')}" size="20"/>
<s:select name="album.genre.genreId" list="genres" listKey="genreId"
listValue="name"/>
<s:hidden name="album.albumId"/>
<s:submit value="%{getText('button.label.submit')}"/>
<s:submit value="%{getText('button.label.cancel')}"
name="redirectAction:cancelAlbum"/>
</s:form>

I have the following actions defined in my struts.xml file, and my
action class, AlbumAction, implements the methods (list(), save(),
delete(), input(), cancel()):

  <package name="portlet-default" extends="struts-portlet-default"
namespace="/portlet">    
    <action name="index"
class="edu.ku.it.si.struts2portlet.action.AlbumAction" method="list">
       <result name="success">/jsp/albums.jsp</result>
    </action>
   
    <action name="*Album"
class="edu.ku.it.si.struts2portlet.action.AlbumAction" method="{1}">
       <result name="success">/jsp/albums.jsp</result>
       <result name="input">/jsp/albumForm.jsp</result>
       <result name="cancel">/jsp/albums.jsp</result>
       <result name="error">/jsp/error.jsp</result>
    </action>
  </package>

Anyone have any ideas why
<s:submit value="%{getText('button.label.cancel')}"
name="redirectAction:cancelAlbum"/>
is not working for a portlet?

Thanks in advance,

Todd Kofford
tkofford@(protected)
University of Kansas - IT


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 gg3721.com - Jax Systems, LLC, U.S.A.