aspose file tools*
The moose likes JSP and the fly likes How to display validation error messages in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to display validation error messages in JSP " Watch "How to display validation error messages in JSP " New topic
Author

How to display validation error messages in JSP

Vivek Kr Agrawal
Ranch Hand

Joined: Sep 08, 2012
Posts: 51

Hi,
I am trying to do a server side validation and then trying to pass the error message in the same jsp.
The flow will be like index.jsp to servlet(validation) and then to same index.jsp with error message.
Right now I am using this code.


Now I just want to display this label during runtime by jsp coding.

Thanks in advance!!


Vivek Agrawal
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 297

Hi Vivek,

You can add the error messages from servlet in the request object and send them back to jsp and display the error messages.
Regards
Jatan
Vivek Kr Agrawal
Ranch Hand

Joined: Sep 08, 2012
Posts: 51

Hi Jatan,
Thanks for answering. Now I am able to set error messages through request setAttribute method.But can there be a solution through which one can access id of an element via jsp?

Again thanks for giving your valuble time and suggestion.

With Regards,
Vivek
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 297

Hi,

What you are going to achieve by doing this?


Regards
Jatan
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

id values are for use on the client by JavaScript.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 297

Hi,

No only values are submitted in the request and you can get those values from request object doing request.getparameter().
id is to identify the control in javascript.

Regards
Jatan
Vivek Kr Agrawal
Ranch Hand

Joined: Sep 08, 2012
Posts: 51

Thanks....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to display validation error messages in JSP