| Author |
How to display validation error messages in JSP
|
Vivek Kr Agrawal
Ranch Hand
Joined: Sep 08, 2012
Posts: 32
|
|
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!!
|
 |
jatan bhavsar
Ranch Hand
Joined: Jul 23, 2008
Posts: 296
|
|
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: 32
|
|
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: 296
|
|
Hi,
What you are going to achieve by doing this?
Regards
Jatan
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56168
|
|
|
id values are for use on the client by JavaScript.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
jatan bhavsar
Ranch Hand
Joined: Jul 23, 2008
Posts: 296
|
|
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: 32
|
|
|
Thanks....
|
 |
 |
|
|
subject: How to display validation error messages in JSP
|
|
|