struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dirk Hesse" <d.he...@intero-technologies.de>
Subject Re: strange behaviour or working as intended with ActionForm and namespaces?
Date Mon, 29 Jan 2007 11:49:38 GMT
Chris you made my day.

We never thought about an option like redirect. Problem resolved and best  
thanks to you.


with kind greetings from germany


Dirk Hesse

Am 26.01.2007, 20:08 Uhr, schrieb Christopher Schultz  
<chris@christopherschultz.net>:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Dirk,
>
> Dirk Hesse wrote:
>> On the detailview he is clicking the Cancel button and will be
>> redirected back to the listItemsAction with the listForm.
>
> When you press CANCEL, which action receives the request? I would
> imaging something like SaveDetailAction. When you check for cancel and
> redirect, are you sure that you are doing a REDIRECT and not a FORWARD?
>
> If you do a forward, things might get a bit messy.
>
>> Both forms are
>> different except in two cases...they have two fields with the same
>> name(employee and title) and these fields are filled from the detailForm
>> even though they was not before.
>> It seems as if the actionForm form is holding each propertyfield as long
>> as i stay on the same request.
>
> That's true. If you submit a request parameter like "name" and then
> process the request using SaveDetailAction (which uses DetailForm), then
> your DetailForm for the request will have DetailForm.setName() called.
> If you then forward (/not/ redirect) to ListThingsAction (which uses
> ListForm), then ListForm.setName() will be called in preparation for
> handling the form.
>
> What you want to do is REDIRECT from SaveDetailAction to
> ListThingsAction (use <forward name="cancel" path="..." redirect="true"
> />), and then you'll get a fresh request. Don't forget to add any
> necessary request parameters to get back to the same list view that you
> were seeing before.
>
> I hope that helps,
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFulGm9CaO5/Lv0PARAt8TAJ9+h0t8HVz2/t7JLzrTvDgVFw0RagCZARkA
> 8dn2HNi7QsUgX4E2ySDIOYI=
> =pg0N
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>



-- 
Intero Technologies
Dirk Hesse
Dipl. - Wirtschaftsinformatiker
Softwareentwickler
Mobil: +49 (0) 163 63 66 087
Email:d.hesse@intero-technologies.de

Intero Technologies GmbH
Gutshaus Klein Kordshagen, Hof 8
D 18442 Lüssow/ Stralsund
Tel:    +49 (0) 3831 – 44 55 722
Fax:   +49 (0) 3831 – 44 55 779

This eMail and its content is dedicated to the intended recipient only.
If you have received it in error please contact the sender immediately
by fax or return eMail. Please then delete the eMail and any copies of it.

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


Mime
View raw message