Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Question about ActionError of Struts

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am now using Struts 1.0. I know that I can use <html:error/> to display error message. However, I want to highlight the field which has error in the JSP page at the same time. Is there any function in Struts that I can do it? Thanks!
Stephen Lee
 
author
Posts: 621
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the ApplicationResources.properties you can define these properties
errors.footer=<b>
errors.header=</b>
Or whatever html you want to wrap the errors in.
If you want to have a bit more control (i.e. not the same everywhere) you can use a logic tag.
<logic : present name=<%Action.ERROR_KEY%> property="yourError" >
<b><html:errors property="yourError"/></b>
</logic : present>
The Action.ERROR_KEY is the default name that the ActionErrors bean is stored in by Struts.
Hope this helps.
Sean
[ May 24, 2002: Message edited by: Sean MacLean ]
 
Sasparilla and fresh horses for all my men! You will see to it, won't you tiny ad?
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic