Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

encodeURL for static image path

Udayan Kumar
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I had a question when to use encodeURL & when not to in case we are referring to images (in servlet code) which are residing on a dedicated(caching) server separate from the web/app server.
What I read in an article recently is we should be using encodeURL with fully-qualified URL's to reference images outside your web server only if they are not accessible to the client directly (say the caching server is firewall protected). But do not use encodeURL on the URL if the client can browse to the resource directly.

I did not get this one correctly. Can someone ellaborate how this impacts from servlet development point of view.

Correct me if I am wrong here if the dedicated server is accessible directly to the client is it that the load on the web server rendering the servlet is less & image is rendered to the client browser as a separate resource.

Do post your thoughts.

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic