I am developing a web application with Struts 1.3.10.
I have placed all the jsp files inside the WEB-INF folder.
Then only realised the problem of not able to access it directly.
So I have decided to move it outside the WEB-INF and but still I want the jsp not to be accessed directly.
So I have decided to use Servlet Filter to restrict it and can use it for security purpose also.
Now I have two questions:
1. Placing the jsp files outside the WEB-INF folder:
How to implement the Filter with Struts?
I have written a sample filter and configured it in web.xml
When I am invoking the below url: http://127.0.0.1:8080/Struts/reg.do, filter is not invoking and it goes to the actionservlet alone.
Whether any specific configuration setting is there for using Filter in Struts?
2. Placing the jsp files inside the WEB-INF folder:
I know we can't directly access the jsp files. But through the servlet we can get it. If suppose I am keeping the jsp files of header.jsp, footer.jsp and menu.jsp and I am trying to use frame for it. How can we get those pages?
Oh; if you're going to access *some* files outside of the framework then you'll either have to move those particular ones out of WEB-INF or access them via an action. You could also use a mechanism that loads those pages from the server side, like Tiles.
subject: How to use Servlet Filter in Struts Framework