Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

spring mvc - jsr 303, handling error level messages

 
gianluca gian
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello, actually I'm using jsr 303 feature to validate user input and on jsp page I'm using Spring library to display error messages. This is my validator class:



on the jsp i'm displaying error messages with spring like:



I'm looking a way to set on the validator code, some king of "flag" that could bring to client side, the the error level severity information (error, warning, info), so that I could style messages on jsp with different colour (es. red for error level, blue for warning one). Could you please help me? thank you
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is really for validation which is by definition an error maybe use redirect attributes instead.

 
gianluca gian
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello, at the end I resolved in this way, inside validator:



and within jsp:



not sure if it is formally correct. Thnak u. Bye
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic