Hello,
comments below
On Wed, 2005-04-27 at 10:19, Scott Purcell wrote:
> Hello,
> I decided to try and implement a filter for my struts application. A filter
> that would check for a session object, and if it does not exist, send the
> user to a certain link.
>
> Anyway, I found an example in
Oh yes... I carefully looked at the code.
Apologies for misleading the list.
- Glenn
Dave Newton <[EMAIL PROTECTED]>
27/04/2005 10:42 AM
Please respond to
"Struts Users Mailing List"
To
Struts Users Mailing List
cc
Subject
Re: Filter Being Called Repeatedl
[EMAIL PROTECTED] wrote:
Umh... I believe that you don't need the return after the chain.doFilter
You do, otherwise the remaining code in the filter will be executed
after the request is finished being processed: filters _wrap_ a request.
This is how a gzipping filter works, for example.
Dav
Scott,
I recommend you use getRequestURI to check against the path
(context-relative) you want to protect. Also, it's possible you're seeing
hits against the images in your page (10 images will call your filter 10
times).
Thanks,
Paul
-Original Message-
From: Scott Purcell [mailto:[EMAIL
Scott Purcell wrote:
if (req.getServletPath().equals(onFailure)) {
[...]
resp.sendRedirect(req.getContextPath() + onFailure);
Are you sure that getServletPath() and getContextPath() + onFailure are
the same thing? My impression is that getServletPath() may not be
returning what you
Umh... I believe that you don't need the return after the chain.doFilter
if (req.getServletPath().equals(onFailure)) {
log.info(" equals ");
chain.doFilter(request, response);
remove --> return;
}
HTH,
Glenn
"Scott Purcell" <[EMAIL PROTECTED]>
27/04/2005 10:19
Hi,
I just looked briefly at your code, but could it be, that your filter
intercepts the calls to the error page as well? So you would be
redirecting, then interceptiong, redirecting, etc.
Maybe you could try a different URL pattern for the filter - something
like /protected/*
Hope this helps.
7 matches
Mail list logo