• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DynaActionForm not working

 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I've created one form and trying to use dynamic form validation but instead any messages I'm getting "<ul><li></li></ul>".

In struts-config.xml



My AddressDynaAction class is as follows:


My DynaAddress.jsp file is as follows:


Please help.

[ November 20, 2007: Message edited by: Asha Pathik ]

[ November 20, 2007: Message edited by: Asha Pathik ]
[ November 20, 2007: Message edited by: Asha Pathik ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What's in your ApplicationResources.properties file? Do you have the following messages defined?

errors.invalid={0} is invalid.
errors.maxlength={0} can not be greater than {1} characters.
errors.minlength={0} can not be less than {1} characters.
errors.range={0} is not in the range {1} through {2}.
errors.required={0} is required.
errors.byte={0} must be an byte.
errors.date={0} is not a date.
errors.double={0} must be an double.
errors.float={0} must be an float.
errors.integer={0} must be an integer.
errors.long={0} must be an long.
errors.short={0} must be an short.
errors.creditcard={0} is not a valid credit card number.
errors.email={0} is an invalid e-mail address.



Did you define the validator plugin in your struts-config.xml file? Did you define validations in a validator.xml file?

For more details, read the Struts Validator Guide.

Also, if you're going to use JavaScript to display the errors (not recommended), you need to remove the errors.header, prefix, suffix, and footer.
[ November 21, 2007: Message edited by: Merrill Higginson ]
 
Asha Pathik
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My MessagesResource file is as follows:

And one more question, do we've to define anything in validation.xml file for "Dynamic validation"?
[ November 21, 2007: Message edited by: Asha Pathik ]
 
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
All Struts Validation Framework validations are by definitinon "dynamic validations". You must define each validation you want performed in the validation.xml file. If you don't know how to do this, click on the link for the Struts Validation Guide that I gave you in my previous post, and read it.
 
The world's cheapest jedi mind trick: "Aw c'mon, why not read this tiny ad?"
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic