Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Servlets
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Servlets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 24th, 2004, 03:05 PM
Registered User
 
Join Date: Feb 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default http get method not allowed by URL

Hi,

I may have inadvertently sent a blank msg a minute ago. Sorry if so!

I am seeing this error: http get method not allowed by URL.
My html calls a Servlet which has both a doPost and a doGet method. The action in my html originally used method="post". I tried changing it to "get" and get same error. If I take out the method part out of the action completely, I still see the error. I saw the recent post on having args switched (req and resp) when calling the servlet and getting this error, but my args look ok. Any ideas?

Thanks


 
Old February 24th, 2004, 07:42 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Default

All Web servers can be configured to allow or disallow any method. For example if a Web server is 'read-only' (no client can modify URL resources on the Web server), then it could be set up to disallow the PUT and DELETE methods. Similarly if there is no user input (all the Web pages are static), then the POST method could be disallowed. So 405 errors can arise because the Web server is not configured to take data from the client at all. They can also arise if the client does not have sufficient authority to the particular URL resource identified on the request.
 
Old February 24th, 2004, 07:48 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can you post the code, including the url link?
 
Old February 25th, 2004, 06:48 PM
Registered User
 
Join Date: Feb 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Martyn,
Thanks for your reply. To try to get to the root of the problem, I stripped out all of my code not related to the GET/POST and now both get and post work with the URL. I have to admit I don't know exactly what caused the problem. Just for reference, you mention that POST/GET can be disallowed. Would this be done in the web.xml?

 
Old February 26th, 2004, 07:55 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Usually this will be a congifuration that will be undertaken by the web server administrator





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change file path to http url cJeffreywang BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 July 25th, 2007 12:18 AM
Error HTTP 405 - Resource not allowed shefali Classic ASP Basics 2 February 20th, 2006 06:47 PM
error HTTP 405 - Resource not allowed hastikeyvan Dreamweaver (all versions) 1 January 12th, 2006 12:11 PM
HTTP Status 405 - HTTP method GET .... nsakic Servlets 1 January 25th, 2004 04:50 PM
to get the url from the http packet du_aa C++ Programming 0 December 4th, 2003 03:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.