• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Validator not picking up error message resources

 
Mallika R Kumar
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a web application, wherein I'm using DynaValidatorForm.In validation.xml file, I set up required rules for few fields in 2 form beans, both of which are DynaValidator Forms. On one jsp page, I see the error message when I try to submit without entering a value for a required field. On the second jsp page, the rule is getting triggered, but the message is not being displayed on the jsp page. The message for both required rules in both forms come from the default validation error message : errors.required
In struts logs, for the first page, I see that the framework is getting the error message suffix, prefix, header, footer etc. But, when I invoke the second jsp page, I don't see logs about getting resources for the errors. How is it that on one jsp page, the errors are getting displayed, while on the other, they are not ?

Any hints will be very useful.

Thanks,
Mallika.
 
alan do
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check your case spellings. do side-by-side comparisons of the JSP's, action mappings, forms, etc.

make sure you have <html:errors/> added to the second jsp and the tag-lib declared. if you did both already, make sure the redirect attribute of your forward is set to 'false' if the action mapping specified to form to remain only in request.
 
Mallika R Kumar
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Alan - the redirect was not pointing to failure!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic