| Forums.Sureshkumar.net : A Perfect Place to Share Knowledge Blogs Games Magazines |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Rate Thread | Display Modes |
|
|
#1 (permalink) |
|
Junior Member
Join Date: Jan 2008
Posts: 4
Thanks: 0 Thanked 0 Times in 0 Posts Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
|
HTTP Status 405 - HTTP method GET is not supported by this URL
Hi
i ve written a simple servlet example which displays a message "Hello world". i am using Tomcat 6. when i run that servlet as http://localhost:9090/Temp/tempServlet i got error HTTP Status 405 - HTTP method GET is not supported by this URL can any one tell me wats going on there. thanks in advance. |
|
|
|
|
|
#2 (permalink) |
|
Junior Member
Join Date: Jul 2007
Posts: 22
Thanks: 0 Thanked 0 Times in 0 Posts Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 2
|
Re: HTTP Status 405 - HTTP method GET is not supported by this URL
Hi,
You need to implement the doGet() method for your servlet to support GET requests. and if u are using POST data from ur html then You could just delegate to doPost: ... doGet(...) { |
|
|
|
|
|
#4 (permalink) |
|
Member
Join Date: Mar 2008
Posts: 32
Thanks: 0 Thanked 0 Times in 0 Posts Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
|
Re: HTTP Status 405 - HTTP method GET is not supported by this URL
Hi,
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. public void doGet(HttpServletRequest req,HttpRequestResponse res) throws ServletException { doPost(HttpServletRequest req,HttpRequestResponse res); } public void doPost(HttpServletRequest req,HttpRequestResponse res) throws ServletException { //write ur logic } 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. Thanks.Comments r welcome. Regards, R.P.Karunakaran |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| J2EE - What is default http method in http servlet? | preethisingh | Java Interview / Technical Questions | 1 | 25-01-07 01:43 PM |
| ejb | bujjimadhu | JAVA Technologies | 4 | 10-09-06 10:15 PM |
| java JSP | naga | JAVA Technologies | 4 | 21-08-06 05:03 PM |
| JAVA collection | naga | JAVA Technologies | 0 | 21-02-06 06:01 AM |
| JAVA PART3 | naga | JAVA Technologies | 0 | 18-02-06 07:48 AM |