Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

HTTP Status 405 error comes

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys i am learning Servlets ..

doing a Login & password page

on Index.http ..i have given

<form method ="post" action="LoginServlet">



on LoginXML.xml .. i have given


<servlet>
<servlet-name>Servlet1</servlet-name>
<servlet-class>LoginServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Servlet1</servlet-name>
<url-pattern>LoginServlet</url-pattern>
</servlet-mapping>



and on Servlet..
i have overriden doPost() Method.

but this error comes every time ..
HTTP Status 405 - HTTP method GET is not supported by this URL

i didnt understand.. whats wrong with this code
any help
 
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If client is requesting with get method,then we have to overide doGet() method.otherwise doPost() has to be overidden.If we couldnt predict which method is being used for requesting the servlet,you can overide both doGet and doPost() method.



If we go on this way,we dont need to bother about which method our browser supports or from method the client is requesting.Our servlet can respond for any kind of request coming from client.

 
bhavesh bhatnagar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your help
:
Program runs
 
A day job? In an office? My worst nightmare! Comfort me tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic