aspose file tools*
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
Author

Message box in my JSP.

Jeff Dube
Ranch Hand

Joined: Jun 14, 2001
Posts: 44
Hi,
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 (".....one field is null.....")
{
this.showMessageDialog(null,"You need to enter a value...");
}
else
{
%>
<%@ 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
Jeff
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
Greenhorn

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!!!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Message box in my JSP.