If I made a stupid mistake and asking a stupid question then my apologize. I have a servlet called HelloWorld - it is a simple servlet that implements the Servlet interface that is part of "1stapp" project. Its code is the following:
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.*;
public class helloworld implements Servlet
{
private ServletConfig config;
public void init(ServletConfig config)
throws ServletException {
this.config=config;
}
public void destroy(){}
public ServletConfig getServletConfig() {
return config;
}
public String getServletInfo() {
return "this is simple hello World Servlet";
}
public void service(ServletRequest request, ServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out=response.getWriter();
out.println("<html><head>");
out.println("<title>Simple Servlet</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Hello, World</h1>");
out.println("</body></html>");
out.close();
}
}
The HelloWorld servlet was successfully compiled into classes directory within WEB-INF. The deployment descriptor is the following:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
<web-app>
<servlet>
<servlet-name>hello</servlet-name>
<servlet-class>helloworld</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>hello</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
</web-app>
Now, when I type localhost:8080/1stapp/hello firefox geves me problem loading page message. Can anybody say what i did wrong?
web.xml