why alert box is not appearing in servlets...?

why alert box is not appearing in servlets...?

//example.java

import java.io.*;  
import javax.servlet.*;  
import javax.servlet.http.*;

public class adduser extends HttpServlet {

public void init(ServletConfig config) throws ServletException
{  
     super.init(config);  
}  
public void doGet(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException
{ 
    res.setContentType("text/html");
    PrintWriter pw=res.getWriter();
            pw.println("<html><script language=javascript>window.alert('Click Ok to go to Index.jsp')</script></html>");
    res.sendRedirect("index.jsp");  
}

}

View Answers

May 30, 2012 at 6:01 PM

Please go through the following link:

Invoke Javascript in Servlet

The above link will provide you an example that will call javascript method prompt. Similarly, you can call alert method.









Related Tutorials/Questions & Answers:
why alert box is not appearing in servlets...?
change appearance of alert box
Advertisements
alert box in iphone
Java Alert Box
Flex Alert Box example
Alert Box in Flex
Name Display in alert box - JSP-Servlet
Display two alert box alternately by clicking on text
Display alert box on clicking link
how to use confirmation alert box before delete in jsp?
alert
jQuery alert()
How to set left and top positions of alert box using JQuery in the below code?
alert in jsp
alert for validation
JavaScript Alert YES NO
JavaScript display variable in alert
Alert in Servlet
JSP Alert
jQuery alert()
Why spring?
GETTING ALERT MESSAGE
Javascript alert message
javascript prompt alert
ModuleNotFoundError: No module named 'alert'
Why NSMutableDictionary
jQuery Hello World alert
GETTING AN ALERT MESSAGE
Why request.getParameter(
why this can't
javascript statement alert
how to create alert message after data submitted into database
Why this is not working...?
why jre in jdk
Information Save Alert
Alert Control in Flex4
ModuleNotFoundError: No module named 'aws-alert'
ModuleNotFoundError: No module named 'django-alert'
ModuleNotFoundError: No module named 'django-alert'
ModuleNotFoundError: No module named 'django-alert'
ModuleNotFoundError: No module named 'django-alert'
ModuleNotFoundError: No module named 'kotti-alert'
ModuleNotFoundError: No module named 'mail-alert'
ModuleNotFoundError: No module named 'nose-alert'
ModuleNotFoundError: No module named 'omsa-alert'
ModuleNotFoundError: No module named 'rabbitmq-alert'
ModuleNotFoundError: No module named 'slack-alert'
ModuleNotFoundError: No module named 'supervisor-alert'
ModuleNotFoundError: No module named 'timed-alert'
ModuleNotFoundError: No module named 'alert-grid'

Ads