Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa WebSevices why alert box is not appearing in servlets...?
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Vinod Kumar Chilaka
why alert box is not appearing in servlets...?
1 Answer(s)      2 years and 7 months ago
Posted in : WebSevices


//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");  
}

}


Advertisement
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:
Advertisements
 

 

 

DMCA.com