• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting HTTP Status 404 error in tomcat  RSS feed

 
Kiran Bichugatti
Greenhorn
Posts: 1
Chrome Eclipse IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Below is my Servletclass code

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;


public class MyFirstServlet extends HttpServlet {
public void Service(HttpServletRequest request,HttpServletResponse response)throws IOException
{
response.setContentType("text/html");
PrintWriter out=response.getWriter();
out.write("<html>");
out.write("<title>Welcome</title>");
out.write("<body bgcolor=blue>");
out.write("<h1>Hi Wassup</h1><br>");
out.write("<h2>Great that you are studying Java</h2>");
out.write("</body>");
out.write("</html>");


}

}

web.xml file contents below

<web-app>
<servlet>
<servlet-name>firstservlet</servlet-name>
<servlet-class>MyFirstServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>firstservlet</servlet-name>
<url-pattern>/homepage</url-pattern>]
</servlet-mapping>
</web-app>

I have configured tomcat7 in my ecclipse ide...

Please somebody help me to resolve the issue
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Work through the list in the ServletsFaq regarding this issue. I can see at least one thing that you did wrong.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!