File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Message box in my JSP. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Message box in my JSP." Watch "Message box in my JSP." New topic

Message box in my JSP.

Jeff Dube
Ranch Hand

Joined: Jun 14, 2001
Posts: 44
I made a form and i need to have a message box that inform the user if one or more field are empty.
I tried with the following:
if (" field is null.....")
this.showMessageDialog(null,"You need to enter a value...");
<%@ include file="Response.jsp" %>
But it does'nt work. Do i have to insert the showMessageDialog inside my bean with the parent.showMesageDialog()?
I know that i can do it with javascript but i prefer java.
Is it possible??
Thank you very much
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

JSP is *server side*. All JSP code is run on the server, and then sent back to the client. So even if you got it to work, where would it show up?
g2 bhai

Joined: Jul 11, 2001
Posts: 2
Please use Javascript for the validation since it runs on the Client side.
Remember JSP code runs at the web server...and not at the client!!!
I agree. Here's the link:
subject: Message box in my JSP.
It's not a secret anymore!