I have a html file at some location in my environment, which I need to restrict from accessing from all users. So I am just trying to add a filter and restrict the html page or to redirect it to another page. Here is the code I am using,
<filter>
<filter-name>PageCheckFilter</filter-name>
<filter-class>com.src.filter.PageCheckFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>PageCheckFilter</filter-name>
<url-pattern>/app?asset=test&path=/xyz-0.1.2/page.html</url-pattern>
</filter-mapping>
I have tried many URL patterns to match this URL but all in vain. Please suggest me something so that I could restrict this page from accessing.
The way you are doing is not the correct way to achieve.
What you can do it write a filter which servers pages on proper Authentication. Write a authentication filter and map all your request to that filter.
So that the filter forwards the request if and only if valid user/client requested the particular page.
For ex: checking the logged in user in session or not.
Look at out Filter tag info, you can find a good example to start with a filter.
https://stackoverflow.com/tags/servlet-filters/info