Jump to content

Recommended Posts

Posted

i have uploaded a simple demo servlet

It is working fine on my local server but not here

 

it is at www.cyberwolves.heliohost.org/servlet/Demo

 

code of it is

 

import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.ServletException;
import java.io.PrintWriter;
import java.io.IOException;
public class Demo implements Servlet
{
 public void init(ServletConfig sc)
 {
 System.out.println("init method called");
 }
 public void service(ServletRequest req,ServletResponse res)throws ServletException,IOException
 {
 PrintWriter pw=res.getWriter();
 pw.println("<body bgcolor=yellow>");
 pw.println("<h1> Demo of first servlet program</h1>");

 System.out.println("service method called");
 }
 public void destroy()
 {

 }
 public String getServletInfo()
 {
 return null;
 }
 public ServletConfig getServletConfig()
 {
 return null;
 }

}

Guest
This topic is now closed to further replies.
×
×
  • Create New...