• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Show errors in new line

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have a jsp and on submit, I call the action class. Before submitting the information to database I do form validation and the all the errors are sent back t the jsp to show to the user. I have all these things working the way it should. But when the jsp shows the validation errors , it shows all the errors together which makes it very difficult to read.

How do I show these errors in new line.

Any insight would be greatful.

Thanks in advance.

p pro
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are a couple of options here. First, you can simply embed a <br> tag at the end of each message you define in your ApplicationResources.properties file. Any HTML tags you put in the message will be rendered on the page.

Another option is to use the <html:messages> tag rather than the <html:errors/> tag. The <html:messages> tags allows you more formatting options.

See the heading "Displaying Messages" in this link.

Here is another good link on messaging in struts:

http://www.systemmobile.com/articles/strutsMessageResources.html
 
Pam Theod
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Merrill,
<br> at the end of each message in properties file worked.

Thanks you very much!

P
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"p pro".

Welcome to JavaRanch. We don't have many rules here but we do have a naming policy that we strictly adhere to. Please re-read this naming convention and change your display name in order to comply. Thanks in advance.
reply
    Bookmark Topic Watch Topic
  • New Topic