I'm pretty new to servlets in Java and i was trying to deploy the following servlet with this GET method:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
response.setContentType("text/html");
out.println("");
out.println("Welcome!
");
out.println("");
}
I checked the console and it was deployed successfully, no errors. However, when i open my browser and go to:
http://localhost:8080/web1/AddPassenger
I get the HTTP Status 404 - Not Found error.
What could be the problem?
EDIT:
Content of glassfish-web.xml:
/Web1
Solved
I'm not sure what was the problem, but i installed a new version of Eclipse (Oxygen, i used Mars before that) and it worked!
Many thanks to everyone for their help!
Comments
Post a Comment