To answer your first question, redirect="false" will forward your request to a servlet/jsp/Action while preserving the request object. Setting redirect="true" tells Struts to send an HTTP redirect to the client which of course would terminate the current request therefore destroying any objects in the request scope.
I'm not sure that this is your problem though. Are you sure that the ActionForm that the request is being sent to has a field called "test"? Virtually, Andre Van Klaveren 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] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]