File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 19538
    
  16

For which you can use URLEncoder:


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Server returned HTTP response code: 505
 
Similar Threads
HEAD, DELETE, PUT, OPTIONS, Requests
Tomcat url redirect problem
Rest Client
505 Error from tomcat 4.1.3
Can Desktop application communicate with Web Page?