wood burning stoves 2.0*
The moose likes Sockets and Internet Protocols and the fly likes Server returned HTTP response code: 505 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Server returned HTTP response code: 505" Watch "Server returned HTTP response code: 505" New topic
Author

Server returned HTTP response code: 505

Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636



I am getting following exception

java.io.IOException: Server returned HTTP response code: 505 for URL:http://localhost:8080/myapp/layout/imageHandler.jsp?logo=36161/31234/photos/1271065897805.jpg

How to resolve this issue?

My blood is tested +ve for Java.
Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 820

try encoding the URL
URLs use some characters for special use in defining their syntax. When these characters are not used in their special role inside a URL, they need to be encoded.


one of these is the forward slash. So,


http://localhost:8080/myapp/layout/imageHandler.jsp?logo=36161/31234/photos/1271065897805.jpg

should be encoded as
http://localhost:8080/myapp/layout/imageHandler.jsp?logo=36161%2F31234%2Fphotos%2F1271065897805.jpg
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19653
    
  18

For which you can use URLEncoder:


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
wood burning stoves
 
subject: Server returned HTTP response code: 505
 
Similar Threads
Tomcat url redirect problem
Can Desktop application communicate with Web Page?
Rest Client
HEAD, DELETE, PUT, OPTIONS, Requests
505 Error from tomcat 4.1.3