Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: struts form population from an object model...

Reply
Thread Tools

Re: struts form population from an object model...

 
 
Sudsy
Guest
Posts: n/a
 
      07-03-2003
flangelli wrote:
<snip>
> I have a business object model with attributes throughout that are
> mapped to different form beans. Every time that a form bean (jsp) is
> returned to the user's browser, I need to have a place to access my
> object model to retrieve the data from and populate the bean before it
> is displayed. So far it seems that the only time an action class is
> given "command" is AFTER the form submission, I need control on a page
> by page basis to retrieve the values from the object model into the
> bean so the jsp can render the beans values.....anyone had a problem
> similar to this? Thanks in advance - Flangelli


There's nothing which "requires" you to forward to a JSP; you could
just as easily forward to an action. The hitch here is that the
ActionForm will be populated according to the request parameters if
you just perform a forward. The solution is simply to specify
redirect="true" in the forwarding action so that the request
parameters get lost.
Just be careful in your validate method when using this mechanism:
you're users will be irked if the first time they see a page it
contains all manner of error messages. Since you often provide a
reset button on a form, the smart way to approach the situation is
to hold off generating errors if all form fields are blank (or
have the default value).
If this doesn't make perfect sense then repost and I'll dig up
some sample code. Or contact me off-line.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
math calculations, form population and submission vindictive27 Javascript 1 12-17-2007 03:33 PM
html form population Robert M. Gary Java 2 02-01-2006 06:27 AM
optparse object population Eric O. Angell Python 1 08-05-2004 07:30 AM
[Struts] Newbie - For ActionForm population, must I use Struts taglib? Pratap Das Java 2 04-05-2004 07:42 PM
Dynamic IFrame Population Scott Nichols ASP .Net 1 12-16-2003 08:46 PM



Advertisments