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
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply 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: 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
    
  13

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....
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to display validation error messages in JSP
 
Similar Threads
Help ASAP!
I can't see the error in this page
Display Validation Error Message
Accessing resource bundle in <h:inputText
how to get value of Label attribute of a textfield element in struts2