struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From theron.kou...@webmd.net
Subject Re: ActionForm Defaults/Updates Question
Date Fri, 15 Feb 2002 00:51:49 GMT

>  In the end, I've just grabbed the Form bean from the pageContext

Pardon my ignorance but can you tell me the syntax in your JSP page to do
just that above?    I think I'll need to be doing the same thing.

thanks,
Theron



                                                                                         
                             
                    Mark Woon                                                            
                             
                    <morpheus@SMI.Sta        To:     Struts Users Mailing List <struts-user@jakarta.apache.org>
       
                    nford.EDU>               cc:                                      
                                
                                             Subject:     Re: ActionForm Defaults/Updates
Question                     
                    02/14/02 02:22 PM                                                    
                             
                    Please respond to                                                    
                             
                    Struts Users                                                         
                             
                    Mailing List                                                         
                             
                                                                                         
                             
                                                                                         
                             



Tom.M.Brunner@dynegy.com wrote:

> 1. What is the best way to load default values into an ActionForm bean
that
> will show up the first time a user visits the site and pulls up a jsp
page?

You know, this question has come up a bunch of times, but I've never seen
any
good responses.

If I've got a form in which users enter contact information, the first time
the
user sees it, I'd like to set the default values for the form to whatever I
know
about the user.

Since I already have a User object, I would think that the best place to do
this
would be in the reset() method of the ActionForm, but there's no way to
pass the
ActionForm the User object (or any information that's not part of the
form)!  In
the end, I've just grabbed the Form bean from the pageContext and called a
setUser() method so that the reset() method will have something to pull
data
from.

Am I missing something?  Is there a better way to do this?

Thanks,
-Mark


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




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


Mime
View raw message