This question already has an answer here:
- HTTP Status 405 - HTTP method GET is not supported by this URL 2 answers
public class RoarHistoryUpdate extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException{
super.doGet(request, response);
System.out.println("do Get");
response.setContentType("text/html");
response.getOutputStream().print("Success");
}
}
This is my Servlet. And it is registerd in the web.xml like this:
<servlet>
<display-name>RoarHistoryUpdateServlet</display-name>
<servlet-name>RoarHistoryUpdateServlet</servlet-name>
<servlet-class>de.ulm.uni.vs.avid.roary.servlets.RoarHistoryUpdate</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>RoarHistoryUpdateServlet</servlet-name>
<url-pattern>/Roary/UpdateServlet</url-pattern>
</servlet-mapping>
When I go to the URL http://localhost:8080/Roary-JSP/Roary/UpdateServlet
It says HTTP Status 405 - HTTP method GET is not supported by this URL
Funny thing is I get the do Get
logged to my console. So it actually found the doGet
-method.
I am using a GlassFish Server Open Source Edition 3.1.2.2