File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes JSP Custom Message / Warning box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP Custom Message / Warning box" Watch "JSP Custom Message / Warning box" New topic
Author

JSP Custom Message / Warning box

Soumil Shah
Ranch Hand

Joined: Jul 13, 2009
Posts: 54
Hi,

I want to create a custom message box to display warning / error message.

For instance, user wants to search particular customer's details, so he enters 'Last Name'.... but there some predefined criteria / validations .... like while searching, user has to enter both 'Last Name' AND 'First Name' / 'Last Name' AND 'DOB' etc.

So when user enters ONLY 'Last Name', i want to show error message box (not an alert box).

Please help me with this.
Nicola Garofalo
Ranch Hand

Joined: Apr 10, 2010
Posts: 308
For example: put a div tag somewhere in your jsp



In the calling servlet set a request attribute when the error condition occurs:





Bye,
Nicola
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61002
    
  65

Do you want to do this on the client before the submission, or on the server after the submission.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Soumil Shah
Ranch Hand

Joined: Jul 13, 2009
Posts: 54
What I am doing right now is.... Let's say on 'SearchCriteria.jsp" user enters only first name and clicks 'Submit' button... control goes to servlet, which validates the criteria, if failed sets the attribute and forwards it to 'error.jsp' where I am simply displaying it on the page using What I want is, instead of displaying on page, a warning / error box will be displayed with an error message.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61002
    
  65

Then that is something you will have to build with JavaScript. You might want to look into jQuery UI which provides a handy dialog widget.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP Custom Message / Warning box