I have a Hello World servlet in webapps/hello/WEB-INF/class/HelloServlet.class
and I registered it as below in web.xml
:
Now you can just use annotations and it will be easier:
package com.yourpackage;
import java.io.IOException;
import java.util.ResourceBundle;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
/**
* Servlet implementation class HelloWorldServlet
*/
@WebServlet("/HelloWorldServlet")
public class HelloWorldServlet extends HttpServlet {
See WebServlet
Cheers!!