• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

errors.header in struts2

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
In struts 1 there is an option to specify an error header and footer.
Ex. errors.header=<div class="errorMsg"><b>The following errors have occurred: </b><ul class="errorMsg">

I can't seem to find out how to do this in struts2. I tried the same thing but it doesn't seem to change the errors.

Any ideas?
Thanks!
Che
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There isn't equivalent functionality out-of-the-box.

You can check for the presence of errors and do it manually, though. Personally I never cared for putting HTML in the properties file so for me it's actually an improvement, but it may be slightly less convenient.
 
Che Frenz
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cool. Thanks for the response!
 
Che Frenz
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Me again. Dumb question - how do I check for errors? New to Struts 2 (obviously) and not sure how to format s:if to check for errors. Any suggestions are greatly appreciated!
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If your action extends ActionSupport (awfully convenient) then you have access to all its methods via OGNL, including hasActionErrors(), hasActionMessages(), and hasFieldErrors().
 
Che Frenz
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perfect! Thanks again!!!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic