Problem with filters in struts

Hi,

I tried to check the session for a struts application in a filter, but its not working, can any one please help me out.

Here is my web.xml

<filter>

<filter-name>AuthFilter</filter-name>

<filter-class>com.appl.struts.BasicFilter</filter-class>

</filter>

<filter-mapping>

<filter-name>AuthFilter</filter-name>

<url-pattern>Project/*.do</url-pattern>

</filter-mapping>

<servlet>

<servlet-name>action</servlet-name>

<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>

<init-param>

<param-name>config</param-name>

<param-value>/WEB-INF/struts-config.xml</param-value>

</init-param>

<init-param>

<param-name>debug</param-name>

<param-value>3</param-value>

</init-param>

<init-param>

<param-name>detail</param-name>

<param-value>3</param-value>

</init-param>

<load-on-startup>2</load-on-startup>

</servlet>

<!-- Action Servlet Mapping -->

<servlet-mapping>

<servlet-name>action</servlet-name>

<url-pattern>*.do</url-pattern>

</servlet-mapping>

I have written code for checking the session in Basic filter, but the filter is not invoked and have no idea why?

[1585 byte] By [Sowja] at [2007-11-27 6:28:55]
# 1

Most probably your URL pattern: <url-pattern>Project/*.do</url-pattern>

What is the "Project" part of the entry meant to be?

If you want to catch every struts request, your url pattern should probably copy the one for the struts servlet:

<url-pattern>*.do</url-pattern>

evnafetsa at 2007-7-12 17:52:37 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Thanks for your reply, Project here is the name of the struts project. and when I use

<url-pattern>*.do</url-pattern>

Its working but I have one more doubt can't we use

HttpServletResponse response = (HttpServletResponse)servletResponse;

System.out.println("filter");

HttpSession session = ((HttpServletRequest)servletRequest).getSession(false);

When I specify false, its giving me an error. can you please help me out with this, and also even after invalidating the session in logoff the session still exists. How can I handle this situation.

Sowja at 2007-7-12 17:52:37 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...