This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTTP Status 405 - HTTP method GET is not supported by this URL?

 
Bryan Scarbrough
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have written a servlet that will retrieve perform a SQL select and return the results in a table. I have updated the web.xml file to recognise the servlet, but every time I try to load it I get this error.

HTTP Status 405

HTTP method GET is not supported by this URL

The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL).

Here is the code I have:


Can anyone tell me why I am getting this error?

Thanks!
 
Yuriy Zilbergleyt
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
change this:


to this:


and the same thing for doPost

Also save yourself a lot of trouble and make "out" a method-local variable as well.

-Yuriy
[ August 11, 2005: Message edited by: Yuriy Zilbergleyt ]
 
Bryan Scarbrough
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, now I went from one error to another.
I did that and now I get the following error:

java.lang.NullPointerException
com.services.select.StudentInfoQueryHttp.doGet(StudentInfoQueryHttp.java:90)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Line 90 of the servlet is pointing to the results of another class. Do I need to first convert that result Object into a string?

If so, what will be the best way to do that (I have tried toString(), but it does not like that)?
 
Yuriy Zilbergleyt
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Line 90 of the servlet is pointing to the results of another class. Do I need to first convert that result Object into a string?

The error says that that result is null, so no conversion will help. You just have to make sure that either that class never returns a null value, or check the result once you get it and do something different when it's null.

-Yuriy
 
Bryan Scarbrough
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, working that now... Any clues? I have run the query in both MySQL and PHP My Admin with the same results, so I know it is not that.

Maybe the DatabaseUtilities method I am calling?
 
Bryan Scarbrough
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FIXED IT!!! Silly me...used the wrong Dbase password!!

Thanks for all your help!
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic