• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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: 3652
516
Android 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: 43026
76
  • 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: 43026
76
  • 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: 3652
516
Android 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: 43026
76
  • 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).
 
Hang a left on main. Then read this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic