• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

struts validation

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ajay Tickle
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Merrill it worked for.

thanks a lot for your help
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic