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.
Originally posted by I Wayan Saryada: I think you can read it using a File or FileReader class. But first you need to get the path to your JSP files, and this can be done by getting the path from the servlet context.
If the file exists within the structure of the web app, using FileReader with getRealPath is a poor (or, at least, non-portable) choice.
getRealPath returns null if your application has been deployed as a packed war file. Using getResourceAsStream works the same way whether the app has been deployed as a packed war file or as an expanded file system.