• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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






 
Marshal
Posts: 4499
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which method in your servlet is handling the POST request?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
have substituted processsRequest with doPost but now getting the error "HTTP Status 500 - Internal Server Error"
 
Ron McLeod
Marshal
Posts: 4499
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Was there a stack trace as well?
 
Rooneyy Thomasyy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic