Forums.Sureshkumar.net : A Perfect Place to Share Knowledge         Blogs     Games    Magazines    

"Sharing knowledge does not lessen your store, often it gets you more. Sharing plays a key role in relationships and bonding, happens in small steps and is assisted through community membership."

Go Back   SURESHKUMAR.NET FORUMS > TECHNICAL DISCUSSIONS > JAVA Technologies
Register FAQ Members List Calendar Games Blogs Search Today's Posts Mark Forums Read

   

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 25-01-08, 12:13 PM   #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 ngovindakrishna is on a distinguished road
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.
ngovindakrishna is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 21-02-08, 02:49 PM   #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 JavaLang is on a distinguished road
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(...)
{
doPost(...);
}
JavaLang is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-03-08, 09:18 PM   #3 (permalink)
Banned
 
Join Date: Sep 2007
Age: 25
Posts: 88
Thanks: 0
Thanked 4 Times in 4 Posts
Thanks: 0
Thanked 4 Times in 4 Posts
Rep Power: 0 satya5321 is on a distinguished road
Re: HTTP Status 405 - HTTP method GET is not supported by this URL

tahnks. i am getting the same prblm
Free Downloadable Java,J2EE,Struts,XML EBooks


This Web page is a resource where you can download Java, Servlet, JSP, J2EE, RMI, JMS, EJB, JDBC, XML, XSL, CSS, JavaScript and WebServices books and tutorials.

satya5321 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 01-04-08, 02:40 PM   #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 writetokaruna@yahoo.com is on a distinguished road
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
writetokaruna@yahoo.com is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT +6.5. The time now is 02:55 AM.





Search Engine Optimization by vBSEO 3.1.0