Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Message box in my JSP.

 
Jeff Dube
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic