Filters, Struts Actions, and Tomcat

R

rjweytens

I am trying to implement a filter in my struts web app, but I don't
know how to get the filter to forward to an action. I have tried a
RequestDispatcher class, but when it goes to the new page it doesn't
seem to pick up my style sheet specification.

My forward code looks like this:

String target = new String("/Search.do");
RequestDispatcher requestDispatcher =
request.getRequestDispatcher(target);
requestDispatcher.forward(request,response);

My web.xml's descriptors look like this:

<filter>
<filter-name>MyFilter</filter-name>
<display-name>MyFilter</display-name>
<description>Test Filter</display-name>
<filter-class>rfc.filter.MyFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>MyFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
I am using Tomcat 4.1.30.

Thanks,

Randy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top