Meaningless Drivel is fun!
The moose likes Servlets and the fly likes Moving resources under WEB-INF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Moving resources under WEB-INF" Watch "Moving resources under WEB-INF" New topic

Moving resources under WEB-INF

Ronen Malka

Joined: Aug 23, 2012
Posts: 1
I have a web application that contains hundreds of html, js and image files. These files are located under the root directory:

These folders contain some subfolders.

From a security reason I need to move all these resources under the WEB-INF folder so they will not be directly accessible.

Currently JSP and servlet files are already under the WEB-INF folder.

What is the easiest method for me to safely move all html/js/images folders under the WEB-INF without breaking all links/forwarding to resources in these folders and make sure these resources are not directly accessible?

I am using Websphere and weblogic servers.
prasad guna
Ranch Hand

Joined: Feb 12, 2009
Posts: 46

Hi Ronan
while web page is loading Images,js and css files are getting downloaded to the browser .so if you restrict or providing the security to those files your web page will load without images,js and CSS. we cannot hide those from the server.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

Resources that must be loaded by the browser such as images, stylesheets and script files cannot be hidden under WEB-INF.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Moving resources under WEB-INF
It's not a secret anymore!