java.io.IOException: Server returned HTTP response code: 505 for URL:http://localhost:8080/myapp/layout/imageHandler.jsp?logo=36161/31234/photos/1271065897805.jpg
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.