B
benh_usenet
I would like to be able to do something like the following in order to
get my welcome page and servlet pages to run though a filter, but
nothing that's in other directories.
<filter-mapping>
<filter-name>myFilterName</filter-name>
<url-pattern>/servlet/*</url-pattern> <!-- run filter on stuff in
servlet dir -->
<url-pattern>/</url-pattern> <!-- also apply this filter to
the root document -->
</filter-mapping>
I did try the following as well, but had no luck.
<filter-mapping>
<filter-name>myFilterName</filter-name>
<url-pattern>/servlet/*</url-pattern> <!-- run filter on stuff in
servlet dir -->
</filter-mapping>
<filter-mapping>
<filter-name>myFilterName</filter-name>
<url-pattern>/</url-pattern> <!-- also apply this filter to
the root document -->
</filter-mapping>
Does anyone have any suggestions as to how this might be actually
achieved, since the dtd won't allow multiple url-mapping elements?
I need to be able to do this because the root document in my
application actually forwards to a proper struts action in the servlet
directory, so I want to allow the filter to work on that, and stuff in
the servlet directory, but not on other servlets.
Thanks
-Ben
get my welcome page and servlet pages to run though a filter, but
nothing that's in other directories.
From web.xml...
<filter-mapping>
<filter-name>myFilterName</filter-name>
<url-pattern>/servlet/*</url-pattern> <!-- run filter on stuff in
servlet dir -->
<url-pattern>/</url-pattern> <!-- also apply this filter to
the root document -->
</filter-mapping>
I did try the following as well, but had no luck.
<filter-mapping>
<filter-name>myFilterName</filter-name>
<url-pattern>/servlet/*</url-pattern> <!-- run filter on stuff in
servlet dir -->
</filter-mapping>
<filter-mapping>
<filter-name>myFilterName</filter-name>
<url-pattern>/</url-pattern> <!-- also apply this filter to
the root document -->
</filter-mapping>
Does anyone have any suggestions as to how this might be actually
achieved, since the dtd won't allow multiple url-mapping elements?
I need to be able to do this because the root document in my
application actually forwards to a proper struts action in the servlet
directory, so I want to allow the filter to work on that, and stuff in
the servlet directory, but not on other servlets.
Thanks
-Ben