Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question about ActionError of Struts  RSS feed

 
Stephen Lee
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • 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
 
Sean MacLean
author
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • 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 ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!