I have a servlet defined as in web.xml:
<servlet-mapping>
<servlet-name>SessionRebindServlet</servlet-name>
<url-pattern>*.ppp</url-pattern>
</servlet-mapping>
Now when there is a request with extension .ppp it uses the above servlet.
But I want to have one exception here that if the file with name "popup.ppp" then don't call this servlet at all.
Is it possible?
UPDATE
I added a filter
<filter-mapping>
<filter-name>AppFilter</filter-name>
<url-pattern>*.ppp</url-pattern>
</filter-mapping>
and in filter code :
String url = ((HttpServletRequest) request).getRequestURI();
if (url.contains("popup.ppp")) {
} else {
chain.doFilter(request, response);
}
I use this for such cases:
String lPath = ((HttpServletRequest) request).getRequestURI();
if (lPath.startsWith("/supported")) {
chain.doFilter(request, response);
} else {
// not supported
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With