This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Struts and the fly likes Placing error message near text field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Placing error message near text field " Watch "Placing error message near text field " New topic

Placing error message near text field

Sandeep Ghosh
Ranch Hand

Joined: Jan 23, 2002
Posts: 145
Hi Friend ,
I am trying to place error message in side of the text field .For this near to the text field I have this code

<logic present name= "%=org.apache.struts.action.Action.ERROR_KEY% >" property="userName" >
<td align="left">
<html:errors property="userName"/>
</td >
</logic resent>
In the form class I have added this line
if ( userName == null )
errors.add ( "userName" ,new ActionError ( "errors.username.required" ) ) ;

Unfortunately nothing is showing up .When I am using <html:errors/> then message is showing .

Could you please tell me where I am going wrong. Is there any better way to do this. I am using struts 1.1
Thanks in adv
[ April 28, 2005: Message edited by: Nataraj Ramesh ]
I agree. Here's the link:
subject: Placing error message near text field
It's not a secret anymore!