I would like to know how is possible to read a file placed in WEB-INF direct into a variable.
My intent is to load (and process a page) into a var, than save it to a file and besides that, use the same html result to be displayed (like included) directly into another JSP.
is it possible?
You can use a RequestDispatcher.include() method and buffered response. The latter you’ll have to write yourself by extending HttpServletResponseWrapper and overriding
getWriter()/getOutputStream()methods to return an internal buffer (based onStringWriter, for example). In your servlet, do something like: