• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Re-populate form after DynaValidatorForm Fails

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Erap Estrada
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Follow up question:

Is it ok to use both JSTL and Struts taglib in the same application?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks merrill.

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

Thanks!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic