This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi all, I got a web application (ear/war file) deployed on Was 4. I want to read a static file (.txt) from a servlet, but I don't want this static file to be directly accessible from an URL. 1)According to your experience, what is the best place to put this static file ? A sub Directory of the context-root ? or of Web-inf ? 2)I planned to put it as a sub directory of the context-root. Then, how can I "reach it" the servlet. I would like to use only relative URL. 3)Last but definitively not least question, how can I secure this folder with my static file in order to prevent a user from seing it ? Thanks in advance for your precious contribution.
/ JeanLouis<br /><i>"software development has been, is, and will remain fundamentally hard" (Grady Booch)</i><br /> <br />Take a look at <a href="http://www.epfwiki.net/wikis/openup/" target="_blank" rel="nofollow">Agile OpenUP</a> in the Eclipse community
Joined: Nov 12, 2001
Hi all. The only solution I found to my problem is the following : (Load a static file from a servlet into an object property) String propPath = getServletContext().getResource("/WEB-INF/myPropFolder/myProp.props").toString(); /* I have to cut the 6 first characterrs which are "file:/"*/ /* and I don't know why these ccharacteres are here propPath = propPath.substring(6,propPath.length()); Properties props = new Properties(); prop.load(new FileInputStream(path));
Does this solution make sense for you ? Any better one to suggest me ??