File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts Validator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Validator" Watch "Struts Validator" New topic
Author

Struts Validator

Anoop Retnakumar
Greenhorn

Joined: Feb 09, 2008
Posts: 1
Hi,
I have a struts application in which all the client side validations are done using Validator framework. For mandatory checks i will get a alert message in an alert box. Now I need to replace this message box and I need to display the message in the JSP page itself just beside of the mandatory fields. Please help me in this regard.
Thank you
Regards
Anoop
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 460
To get an alert box, you use the <html:javascript> tag to generate the validation javascript, and in your form you use the onsubmit attribute to call the validate method. To do what you want, you have to have the following
1- Remove the onsubmit attribute from the html form
2- Make sure that you have validate="true" in the struts-config's action you want to validate
3- Make sure that the input attribute of that action points to the JSP
4- Use <html:errors> to display the errors on the JSP page


Visit my blog: http://jnassef.blogspot.com/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts Validator
 
Similar Threads
Struts 1.2 vs 1.1
Custom alert box with struts validator
Dialog Boxes in Web Application
entry of a key for Struts validator
Error messages are not being displayed while using validator