This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
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: 43

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: 61064

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

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
jQuery in Action, 2nd edition
subject: Moving resources under WEB-INF