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

Ads

 
 

Share on Google+Share on Google+

Vinod Kumar Chilaka
why alert box is not appearing in servlets...?
1 Answer(s)      4 years and 11 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");  
}

}

Ads
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.


Ads









Tutorials   
Java Spring Hibernate Struts Training 6 SaaS Software Solutions Every Business Owner Should Consider WebServices Study Material What is the use of MySQL, MS SQL in Web Hosting paradigm? What do you understand by Domain Parking? What is difference between UNIX Hosting and Window Hosting? Expalin the Web Hosting Bandwidth/Space/Transfer What do you understand by Virtual Hosting? How to Upload Site Online? How to register domain name for my Company? How to track how many hits my website gets? create plugins to detect suspicious ajax chrome extension what timing attack {practically}??? any one can help me in my Ph.d thesis Accessing your site How to develope web service with exachanging xml message between computers using SOAP How to Convert SOAP Web service to REST Web service In Java ? add a new wcf service code to TFS and make it available to create an MSI. of its How we can integrate ASP .net website to payment gateway using SOAP xml request and response using wsdl. input fields to reject all inconsistent characters in webconfig Search operation in JSP page Where can I find reviews of IT solutions company in India to choose from? help regarding creation of last year project Select Box question Web Services Tutorials What is SOA and Webservices? PHP webdesign Pinting restful webservice request on UI. asp.net MaxClients apache httpd.conf max connections Large File reading through Axis2 Web service reg tutorial http://www.roseindia.net/webservices/netbeans/JAX-RPCAdvanceConcepts.shtml What is Web Development? Get GMT from IP WEB SERVICES Create a Web Service in Java using Apache Axis2 and Eclipse with Oracle database driven local host sharing on same network compute Internet and Web related questions for Web Master. web technology What is webservices? wifi problem wifi problem Overriding jaxb binding at client side? How to connect one application to some othe application through Rest json Database with dotnet while playing youtube in iphone appliation, coming black screen in iphone project? programming questions Web Analytics Java Runtime Exception: 0x4F4F:524A 0x4120:5445 0x4348:0D0A Restful webservice

Ads

 
Advertisement null

Ads