• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet complling

 
Siddheh Desai
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good Evening Sir....!!
I am using Resin3.0.14 server. I have succesfulluy comlpied HelloServlet.java and added HelloServlet.class to link below

C:\Resin\resin-3.0.14\webapps\WEB-INF\classes

I am getting 404- Page not found error. I Request you to help to over come this problem.

The code is as below.



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

public class HelloServlet extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String docType =
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
"Transitional//EN\">\n";
out.println(docType +
"<HTML>\n" +
"<HEAD><TITLE>Hello</TITLE></HEAD>\n" +
"<BODY BGCOLOR=\"#FDF5E6\">\n" +
"<H1>Hello</H1>\n" +
"</BODY></HTML>");
}
}
 
Neeraj Dheer
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have you added this servlet to the web.xml file??
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!