Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

java.io.IOException: Server returned HTTP response code: 405

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All

I am facing problems in Applet-Servlet communication. I open a HttpURLConnection --> get outputstream --> write object on it.

Then i want to read the response from servlet on same connection after getting the input stream. BUT i face an exception doing this. Can someone help me out. Here is the code snippet along with the stacktrace.



Exception Stack trace:

java.io.IOException: Server returned HTTP response code: 405 for URL: http://localhost:8080/context/updateprofile.do
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
.
.
.

Thanks

[ UD: fixed formatting ]
[ March 13, 2008: Message edited by: Ulf Dittmer ]
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
405 means "method not allowed", indicating that the server does not implement whatever HTTP method the code uses. Does the server implement POST?
[ March 13, 2008: Message edited by: Ulf Dittmer ]
 
Ansar Shah
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf Dittmer for your help. Yes you are right and the problem resolved.
Thanks again.
 
CLUCK LIKE A CHICKEN! Now look at this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic