Hi,

If your filter is called before the struts filter, then what about
preparing your own HttpServletRequest instance (some wrapper) and
passing it deeper into doFilter(..)?
You could copy all properties of the original request but change the
URI (or whatever property is responsible for it).
The next filter/servlet would be fooled by this switch and their
calculations (ie. finding what action should be executed) would be
done on data prepared by you.

Best regards
 Dariusz Wojtas, Poland

On 12/7/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Hi everybody,
I have experimented with a filter that triggers for keywords on the
request URL
and when found it should redirect to a struts action that processes the
keyword.

My dilemma is that I don't want to use:
response.sendRedirect("/some.action");
becoz redirect should be done internally in the servlet container, not
via browser.

I have tested:
request.getRequestDispatcher("/some.action").forward(request, response);
and it don't work. I guess becoz an action mapping is not a servlet, an
JSP page is.

Does anyone have an idea how to solve this? Any input welcome!

One approach could be to inherit:
org.apache.struts2.dispatcher.FilterDispatcher
and override doFilter() method and insert my keyword code. Kinda ugly
thou.

Regardings,
 Ove Oldberg, Sweden.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to