This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Message box in my JSP.  RSS feed

 
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!!!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!