File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Servlet problem: error 405 HTTP Method GET Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet problem: error 405 HTTP Method GET" Watch "Servlet problem: error 405 HTTP Method GET" New topic
Author

Servlet problem: error 405 HTTP Method GET

Laurent Bagno
Greenhorn

Joined: Sep 13, 2013
Posts: 2
Hello,

I've the following error : "405 - HTTP method GET is not supported by this url".
But the 'doGet' method of my servlet is comment.

I would like to that my servlet does'nt launch when the application starts. Moreover, I would want that my servlet be called when I click on the validation button that I created in my index.jsp in order to my servlet does a check-in of the username and the password typed by the user and after the check-in, the servlet does a redirection to another jsp page.

Do you have any ideas ?

Thank you

This is my code architecture of my Maven Project with tomcat as application server:



Web.xml :


MyServlet.java :


index.jsp :
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

If you commented out your doGet() method, why are you surprised that it doesn't work?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Laurent Bagno
Greenhorn

Joined: Sep 13, 2013
Posts: 2
If doGet method is comment or not, it's the same result :

HTTP Status 405 - HTTP method GET is not supported by this URL
Arun Giridhar
Ranch Hand

Joined: Mar 10, 2012
Posts: 146

Laurent Bagno wrote:If doGet method is comment or not, it's the same result :

HTTP Status 405 - HTTP method GET is not supported by this URL


See 405 get fired if the method is not supported for example, using GET on a form which requires data to be presented via POST. In your case your passing Query String means you need to have doGet(req,res) and not doPost(req,res). If you change the method in the form it will be vice versa.


hate Professionalism
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

Why are the methods protected?
 
wood burning stoves
 
subject: Servlet problem: error 405 HTTP Method GET
 
Similar Threads
Servlet can't get the xmlhttp post request
how to print out the content of the HttpServletRequest
getHeader()
Midlet Download/Installation Status Codes via servlet/jsp
Not able to invalidate the scripts using the tags in web.xml