[Opensource] request being cleared on Transition.transition ???

Michael Rimov rimovm at centercomp.com
Wed Nov 6 16:36:58 PST 2002


At 12:05 PM 11/6/2002 -0600, you wrote:
>In the Transition.transition(request,response,false) method, the boolean
>actually refers to clearing the response object, not the request. So, there
>is no way to prevent clearing the request.

OH!  Duh... I misread your original email.  Sorry :)  There's a couple of 
ways this is done for what you want:

1 - Before transferring back call:  response.setFormCache();  Then in the 
display, you can query the default values from the form cache from your 
input. [It's an extra line of code per input, but I haven't gotten around 
to making it cleaner yet ]

2 - Transition.setParams(request.getParameters());
before you call the Transition.transition() method.  This will transfer all 
the parameters in the request into the Transition object, which will then 
have it appear in the target controller.

Either way, the reasoning behind this behavior is still the same, you don't 
want 'errant' parameters making it to a controller that isn't necessarily 
expecting them. However, I didn't realize the behavior was new for this 
release, so I'll get that into one of the older changelogs for Expresso 4.1 
ea-1.

HTH!
                                                 -Mike








>Can we make the boolean refer to clearing both the request and response? If
>so, I'll make the change...
>
>Mike
>
>-----Original Message-----
>From: opensource-admin at jcorporate.com
>[mailto:opensource-admin at jcorporate.com]On Behalf Of Michael Rimov
>Sent: Tuesday, November 05, 2002 10:19 PM
>To: opensource at jcorporate.com
>Subject: Re: [Opensource] request being cleared on Transition.transition
>???
>
>
>At 08:47 PM 11/5/2002 -0600, you wrote:
> >It seems that logic has been added to
> >Transition.transition(ControllerRequest, ControllerResponse, boolean) to
> >clear the old request object (Transition.java lines 864 & 884). Why was
>this
> >done?
> >
> >This is not good for my app because I handle states in this way:
> >1. disply statePrompt which transitions to stateProcess upon user input
> >2. stateProcess processes the data. If a validate error occurs, set some
> >errors outputs and Transition.transition to statePrompt
> >
> >Previously, this would work nicely. Now that the request is being cleared,
>I
> >no longer have the current values for the fields and the form will be blank
> >(except for the error messages).
>
>Mike,
>
>You can change your transition code
>to:  Transition.transition(request,response,false) [to not clear].
>
>I believe the clearing code was added because Transitions between
>controllers were often causing side-affects between controllers, so it was
>made this way so you only do it if "you're really sure"...
>
>HTH!
>                                                  -Mike
>
>
>
>
>_______________________________________________
>Opensource mailing list
>Opensource at jcorporate.com
>http://mail.jcorporate.com/mailman/listinfo/opensource
>Archives: http://mail.jcorporate.com/pipermail/opensource/
>
>_______________________________________________
>Opensource mailing list
>Opensource at jcorporate.com
>http://mail.jcorporate.com/mailman/listinfo/opensource
>Archives: http://mail.jcorporate.com/pipermail/opensource/





More information about the Opensource mailing list