I created the following java file, compiled it and got the .class file.
import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("<title>First Example</title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>Hello World!</h1>"); out.println("</body>"); out.println("</html>"); } }
Now I created the abc / WEB-INF / classes directory in the apache-tomcat-6.0.32 / webapps directory so my classFile Path: apache-tomcat-6.0.32 / webapps / abc / WEB-INF / classes / HelloWorld.class and trying access http: // localhost: 8080 / abc / WEB-INF / classes / HelloWorld , but get the error "The requested resource (/ abc / HelloWorld) is unavailable"
Where am I going wrong? or do I need to specify a different configuration?
source share