I am using a some filter mapping for my project . The following filter pattens hit the filter
<filter-mapping>
<filter-name>wygUserCheckFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>wygUserCheckFilter</filter-name>
<url-pattern>/myProject/MyDisplay.jsp</url-pattern>
</filter-mapping>
But the one below doesn’t hit the filter
<filter-mapping>
<filter-name>wygUserCheckFilter</filter-name>
<url-pattern>/myProject/*.jsp</url-pattern>
</filter-mapping>
Why is this so ?
Because * in the middle of the pattern matches only to the * character. Only matching url for /myProject/*.jsp-pattern is exactly same string. * does have special meaning only in the following cases (Servlet 2.4 Specification):