Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Working with GET and POST

 
Martin Simpao
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I inherited a ASP classic and Java application. The front end is ASP with Java applets and servlets in the back end. I am trying to set up a test environment in my desktop with the following: Windows XP, Apache Tomcat 5 and IIS. I have taken the code in our development environment and installed it on my desktop. I am able to get it to work partially. I keep getting the following message on trying to start the applet: "Server returned HTTP response code: 405 for URL: http://localhost/TEST/test1/claim."
I am aware that a response code of 405 usually means I am using a POST when I should be using a GET. In IIS I have added POST in some of the verbs associated with certain file extensions such as html, shtml, asp and aspx. This did not do any good, I still keep getting the same message in my out file. It seems in my code the original developers placed connection.setDoOutput(true) which uses POST instead of GET.

I would like to know if there is a way for my application to use GET instead of POST? Is there some setting I can change in Apache Tomcat? Please advise.
 
Nilesh Miskin
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not familiar with ASP development. But just one advice; if you want your code to use GET instead of POST, why don't you use a hyperlink to invoke a servlet?
e.g.
 
Prashant Hurria
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

It seems the servlet you are using has overridden the doGet Method. What you can is in the HTML form you can make the method="get" or just do not declare any method it takes get by default.
Or you can modify the servlet code to accept Post request as well for that you will have to simply have to override the doPost method and wither copy paste the code there or call another helper method.
 
Martin Simpao
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems the doPost method is set to its default setting, returning a not "allowed message".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic