*
The moose likes Struts and the fly likes Re-populate form after DynaValidatorForm Fails Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Re-populate form after DynaValidatorForm Fails" Watch "Re-populate form after DynaValidatorForm Fails" New topic
Author

Re-populate form after DynaValidatorForm Fails

Erap Estrada
Ranch Hand

Joined: Nov 08, 2006
Posts: 92
Since using DynaValidatorForm will exclude creating a class form, how can i repopulate my form once it fails.

If there are multiple ways to do it, what's the best practice.

I prefer using EL and JSTL.

Thanks in advance.


SCJP with 98% by...
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The best practice in a Struts application is to use the struts html tags (html:form, html:text, etc). If you use these tags, Struts will automatically repopulate the values when a validation error causes the page to be redisplayed.


Merrill
Consultant, Sima Solutions
Erap Estrada
Ranch Hand

Joined: Nov 08, 2006
Posts: 92
Thanks Merrill.

Ive read in the book "Struts Design and Programming by Budi Kurniawan" that JSTL is more powerful than struts on tag libraries, so im just getting the suggestions.

Ive seen your posts on these forum and i believe you got pretty good experience with Struts.

Do you know any website or URL that can give me some best practices? Or maybe you can give me some quick points.

Thanks in advance!
Erap Estrada
Ranch Hand

Joined: Nov 08, 2006
Posts: 92
Follow up question:

Is it ok to use both JSTL and Struts taglib in the same application?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Originally posted by Erap Estrada:
Is it ok to use both JSTL and Struts taglib in the same application?


Yes, absolutely. Whenever both tag libraries perform the same function, I prefer to use JSTL. However, JSTL has no equivalent to the html:xxx tags. These were made specifically to interact with a Struts ActionForm bean, and there is nothing in JSTL that will do this.

As far as best practices go, just do some research on the web and you'll find plenty of good articles. Here are a few of my favorites:

http://www.javaworld.com/javaworld/jw-09-2004/jw-0913-struts.html
http://husted.com/struts/tips/index.html
http://wiki.apache.org/struts/
Erap Estrada
Ranch Hand

Joined: Nov 08, 2006
Posts: 92
Thanks merrill.

I have another question but ill create another thread. Hope you can help me there.

Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Re-populate form after DynaValidatorForm Fails
 
Similar Threads
Problem in Struts radio button
When is validate called on a DynaValidatorForm?
<bean:write name=?/%gt; in DynaValidatorForm
File Uploading With DynaValidatorForms
Strage: DynaValidatorActionForm vs DynaValidatorForm