You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Paul Benedict <pb...@apache.org> on 2008/12/01 04:50:57 UTC

Re: Struts 1.3.8 : Cancel Button (and custom submit one)

Why would you want the cancel button go to a different action mapping?
That doesn't sound right to me. May I recommend you change your
approach?

Paul

On Wed, Nov 26, 2008 at 10:12 AM, zm <zz...@hotmail.com> wrote:
>
> Hi,
>
> I'm having a trouble setting this up:
>
> Let's imagine I have "Search.do" form, and clicking a link, it goes to
> "Result.do". Then I but an "<html:cancel>" element on the jsp pages (all of
> them), and set something like:
>
> <action path="/Welcome" forward="/pages/welcome.jsp" />
> <action
>        path="/Search"
>        type="com.something.SearchAction"
>        name="SearchForm"
>        scope="request"
>        validate="true"
>        input="/pages/search.jsp"
>        cancellable="true">
>        <forward name="back" path="/Welcome.do" />
> </action>
> <action
>        path="/Result"
>        type="com.something.ResultAction"
>        name="ResultForm"
>        scope="request"
>        validate="true"
>        input="/pages/result.jsp"
>        cancellable="true">
>        <forward name="back" path="/Search.do" />
> </action>
>
> I want that when a user clicks the cancel, the "result" will send to
> "search", but the "search" will sent to the "welcome" page (site's home
> page).
>
> It all works well, too well indeed ... so I now have a problem: since the
> "<html:cancel>" will generate:
>
> <input type="submit" name="org.apache.struts.taglib.html.CANCEL"
> value="Exit" onclick="bCancel=true;" />
>
> The struts framework (under RequestProcessor.processPopulate) will get this
> request property and set an attribute.
>
> Everything goes alright, but then my "ResultAction" catches the click,
> forwards to "SearchAction" but it also catches the cancel and re-forwards it
> to the Welcome page.
>
> Is there a way that I can remove the cancel data right before forwarding in
> "ResultAction"? So that it just make one back-forward?
>
>
> Thanks
> --
> View this message in context: http://www.nabble.com/Struts-1.3.8-%3A-Cancel-Button-%28and-custom-submit-one%29-tp20703999p20703999.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
>
>

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