• 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

Working with GET and POST

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems the doPost method is set to its default setting, returning a not "allowed message".
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic