Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTTP Status 405 error comes

 
bhavesh bhatnagar
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
 
ujjwal soni
Ranch Hand
Posts: 403
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic