Quantcast
Channel: Active questions tagged servlets - Stack Overflow
Viewing all articles
Browse latest Browse all 714

Using @WebServlet on Tomcat 7.0 returns HTTP 404 [duplicate]

$
0
0

I am developing an example servlet on Tomcat 7.0.37 & Eclipse 3.7. My current problem is to get it runnable

//...imports and so on...@WebServlet(value="/Hello")public class AdminServlet extends HttpServlet{    private static final long serialVersionUID = -1139419481702036147L;    @Override    protected void doGet(HttpServletRequest req, HttpServletResponse resp)            throws ServletException, IOException {        super.doGet(req, resp);        PrintWriter writer = resp.getWriter();        writer.write("HelloWorld");        writer.close();    }}

When I call the URL http://localhost:8080/{webappname}/Hello, the window turned to

"Status 404 - Resource not available".

Is there anything wrong?

It is like in the most Servlet 3.0 examples.


Viewing all articles
Browse latest Browse all 714

Trending Articles