The source code of ServletNameCheck.java : import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class ServletNameCheck extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { response.setContentType("text/html") ; PrintWriter out = response.getWriter() ; out.println("<!DOCTYPE HTML PUBLIC " +"\"-//W3C//DTD HTML 4.01 " +"Transitional//EN\">") ; out.println("<html>") ; out.println(" <head>") ; out.println(" <title>Checking servlet naming</title>") ; out.println(" </head>") ; out.println(" <body><ul>") ; out.println(" <li> getServletName() : " + getServletName()) ; out.println(" <li> request.getServletPath() : " + request.getServletPath()) ; out.println(" ") ; out.println(" </ul></body>") ; out.println("</html>") ; } }