I want to be able to access the jsp and html files in the WEB-INF folder of my web app which is running on a local glassfish server. How do I do this ? I know that it defeats the purpose of security. But, I want to try this.
Thanks.
I want to be able to access the jsp and html files in the WEB-INF folder of my web app which is running on a local glassfish server. How do I do this ? I know that it defeats the purpose of security. But, I want to try this.
Thanks.
Use ServletContext.getResource("/WEB-INF/resource-file")
to load the files in Java.
For direct access use some servlet mapping in your web.xml
<servlet>
<servlet-name>myFoo</servlet-name>
<jsp-file>myJSPfile.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>myFoo</servlet-name>
<url-pattern>/main</url-pattern>
</servlet-mapping>
See http://docs.oracle.com/cd/E11035_01/wls100/webapp/configurejsp.html#wp162442 for some more documentation.
You cannot directly read the files inside WEB-INF
, it is not public web space, what you can do is you can create a servlet which will forward your request to jsp inside WEB-INF/