If your goal is to retain a value from the time you prepare it in an
action, through to the JSP that's displayed, and all the way through
till the user submits the form on the JSP, simply using redirect=false
wouldn't be enough.  You'd want to either place the value in a hidden
field to be submitted with the rest of the form, or put the value in
session scope.

> However....now I want to query the record when I first display the
> form...saving my record object (actually a java DTO representing a
> record in my table) in the request scope.
> 
> Then when I hit submit, I want to retrieve that object.

When you hit submit, that generates a *new* request, and therefore
anything you placed in the scope of the *previous* request is no
longer accessible.

Hubert


On Tue, 22 Feb 2005 14:07:37 -0600, Lee Harrington <[EMAIL PROTECTED]> wrote:
> Which is the way to forward that preserves the request object?  Is it
> redirect="true" or redirect="false".
> 
> I'm having trouble setting a request variable on display of an edit
> screen....that is available for the process form action when I hit the
> form submit.
> 
> I'm trying to use the hibernate <timestamp...> feature.  Previously,
> in my processing of an edit forum...I just requeried the old record
> from the database, and copied the form variable onto it, then
> persisted back to the database.
> 
> However....now I want to query the record when I first display the
> form...saving my record object (actually a java DTO representing a
> record in my table) in the request scope.
> 
> Then when I hit submit, I want to retrieve that object.
> 
> Right now I'm getting nulls...even on a test variable...and I've tried
> both ways.
> 
> Here's code in my action class that displays the values for edit in an
> html form:
> 
> request.setAttribute("test","test value");
> 
> And here's the code I have in my action class that is supposed to
> process the recorde (saving it to the database)
> 
> String test = (String) request.getAttribute("test");
> log.info("the value of test is: " + test);
> 
> I'm getting a null value exception.
> 
> Lee
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to