Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Http error status 405

 
Sophia Choi
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying a upload program which passes parameters to a servlet .
I have tried a long time but still not solve it.
Anyone knows how to do?
Thanks a lot.
The error is following:
HTTP Status 405 - HTTP method POST is not supported by this URL
message HTTP method POST is not supported by this URL
description The specified HTTP method is not allowed for the requested resource (HTTP method POST is not supported by this URL).
 
Praful Thakare
Ranch Hand
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
If you have and have defined you form tag as ..<form action="....." method=post>
then your servle must have doPost method
Cheers
Praful
 
Sophia Choi
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did. What other possibilities? Does it relate to the servlet configuration?
Thanks
public void doPost(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException{
....
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wait a minute. Are you doing upload program?
Do you have in form header:
method="post" enctype="multipart/form-data"
?
Do you use apache or some other implementation to parse parameters?
 
Sophia Choi
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
of course, my jsp has the enctype like the following:
form name="form1" enctype="multipart/form-data" method="post"
onSubmit="return validateForm(this)" action="/cfhc/servlet/UploadTest"
The program can work in the office.In my office, I have the Tomcat 4.1 only.
But, this cannot work at home. I have installed IIS and Tomcat. But they are in different port.I have changed the port of Tomcat to 8081.
Is it the source of the problem?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic