This week's giveaway is in the Java/Jakarta EE forum.
We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line!
See welcome thread
Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

encodeURL for static image path  RSS feed

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
Boost this thread!