I used the following Java EE Filter for some pages:
<filter-mapping>
<filter-name>MyFilter</filter-name>
<url-pattern>/index.jsp</url-pattern>
<url-pattern>/user/*</url-pattern>
<url-pattern>/article/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
I deployed my project on a domain, like www.mydomain.com
and I set as welcome page the file index.jsp
.
If I visit www.mydomain.com
, it shows the welcome page, but the filter doesn't work because it doesn't match with the rule.
If I visit www.mydomain.com/index.jsp
, everything is working well.
So, all I want to do is the filter matches when I visit www.mydomain.com
(because index.jsp
is being showed).
How could I do it?
Update: I tried the following pattern, but it didn't work:
<url-pattern>/</url-pattern>