struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt E <mgeuse...@yahoo.com>
Subject RE: Form Bean Help?
Date Tue, 29 Jul 2003 16:45:39 GMT
Mike,

The bean is stored in the Session scope (the bean
needs to be stored in the session scope, so that some
other data for it which is valid for the life of the
session stays around).

Even if it was a request scoped bean, I'd still like a
way to fill out the action form before hand, because
then things like Radio buttons could be "preselected"
based on what I loaded from the database.

Cheers.
--- "Mainguy, Mike" <MMainguy@kmart.com> wrote:
> My angle on this is to only load the data from the
> database when the user is
> submitted a request to "read" data.  If they are
> submitting an "update"
> action, I don't load the data from the database.
>  
> -----Original Message-----
> From: Matt E [mailto:mgeusenet@yahoo.com] 
> Sent: Tuesday, July 29, 2003 12:37 PM
> To: struts-user@jakarta.apache.org
> Subject: Form Bean Help?
> 
> Hello All,
> 
> I'm running into a little problem, maybe someone can
> help me fix it.
> 
> My application is driven by filling out web forms. 
> At
> one point, A user can click the "Save Form" button,
> which writes the form information to a Database. 
> When
> the user visits the page again, the action builds a
> DTO that contains all the information they had
> filled
> out and puts it in the session scope, then forwards
> to
> the JSP page that has the form on it.
> 
> I had been using the value property of the
> struts-html
> tags to fill in the data, but I've noticed that when
> the user hits submit, if there is a validation
> error,
> they are pushed back to the page, and the data they
> had enetered is replaced with what was in the DTO
> (which is now old data).  I've also run into the
> problem of filling in things like radio buttons,
> based
> on what was in the DTO.
> 
> It seems to me that what I want to do is not pass
> along the DTO with the action, but fill out parts of
> the Form Bean before forwarding to the page that
> displays it, at which point I could remove the value
> properties of the html tags, and have everything
> work.
> 
> My question is, how can I do this from the action? 
> Or
> do I want to attack this problem in another way?
> 
> Thanks!
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site
> design software
> http://sitebuilder.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 
> 
> This message and its contents (to include
> attachments) are the property of Kmart Corporation
> (Kmart) and may contain confidential and proprietary
> information. You are hereby notified that any
> disclosure, copying, or distribution of this
> message, or the taking of any action based on
> information contained herein is strictly prohibited.
> Unauthorized use of information contained herein may
> subject you to civil and criminal prosecution and
> penalties. If you are not the intended recipient,
> you should delete this message immediately.
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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


Mime
View raw message