wood burning stoves 2.0*
The moose likes Struts and the fly likes struts validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts validation" Watch "struts validation" New topic
Author

struts validation

Ajay Tickle
Greenhorn

Joined: Mar 16, 2008
Posts: 17
Hi,

I am using struts in my application. to validate users entry in jsp i have my validation method. and i am calling that method in action class. code is below I am not using struts' validations )






above code is working fine. Only problem is it is printing error messages in jsp in one line.

example: Enter Name. Enter Address.


I would like to show every error message on new line in jsp. is it possible.

in jsp i am using <html:errors/> to print message.


thank you for your time and solutions
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Struts has some pre-defined message keys that it will use before and after messages: errors.header, prefix, suffix, and footer. Header goes before all messages, and footer after all messages, while prefix goes before each message, and suffix after each message. So, if you want messages listed as part of a list, you could put the following:

If you want a line break between each message, then just specifying errors.suffix=<br> should do it.


Merrill
Consultant, Sima Solutions
Ajay Tickle
Greenhorn

Joined: Mar 16, 2008
Posts: 17
thanks Merrill it worked for.

thanks a lot for your help
 
Consider Paul's rocket mass heater.
 
subject: struts validation