Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HTTP Status 405 - HTTP method POST is not supported by this URL  RSS feed

 
Rooneyy Thomasyy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have googled this error but the solutions l get are not working. The JSP page is opening but the problem is if l click on the ADD or EDIT button l receive the 405 error
Iam using MySQL and glassfish server

web.xml


account.jsp


AccountServlet


session bean






 
Ron McLeod
Saloon Keeper
Posts: 1430
207
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which method in your servlet is handling the POST request?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... in other words, "processRequest" is not a method of the servlet API, so it will never be called. Did you mean to override "doPost" instead? You should get in the habit of using the "Override" annotation.
 
Rooneyy Thomasyy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Ron the method is

[code=java]request.getRequestDispatcher("account.jsp").forward(request, response); [code]
 
Rooneyy Thomasyy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Ulf Dittmer yes that was the idea. if it is wrong how can l implement using doPost and overrides
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Ron the method is
[code=java]request.getRequestDispatcher("account.jsp").forward(request, response); [code]

Since processRequest is never called, it is irrelevant what is inside of it.

@Ulf Dittmer yes that was the idea. if it is wrong how can l implement using doPost and overrides

Start by renaming "processRequest" to "doPost" and see what happens. By coincidence it seems to have the same method signature, apart from the method name.

And work through http://docs.oracle.com/javase/tutorial/java/annotations/predefined.html
 
Rooneyy Thomasyy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have substituted processsRequest with doPost but now getting the error "HTTP Status 500 - Internal Server Error"
 
Ron McLeod
Saloon Keeper
Posts: 1430
207
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Was there a stack trace as well?
 
Rooneyy Thomasyy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You just tried to post a URL as an image ... if there was a stack trace, post its text (not a screenshot).
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!