• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Server returned HTTP response code: 505

 
Chetan Parekh
Ranch Hand
Posts: 3640
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



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?
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20372
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For which you can use URLEncoder:
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic