Forums Register Login

Getting HTTP Status 404 error in tomcat

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
Work through the list in the ServletsFaq regarding this issue. I can see at least one thing that you did wrong.
I just had the craziest dream. This tiny ad was in it.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 548 times.
Similar Threads
Error when calling Servlet page
HTTP status 404 error on page
First Servlet in Tomcat
A problem in executing the servlet
Getting error "Oops! This link appears to be broken."
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 01:46:22.