Craig McClanahan <[EMAIL PROTECTED]> wrote on 09/09/2005 05:08:47 PM:

> > 
> > 
> First, you put your exclude patterns for /index.jsp and /logon.faces on 
the 
> *second* command rather than the first, so they weren't rejected by the 
> initial filter.
> 
> Second, not rejecting those patterns in the first filter is actually a 
good 
> thing :-). Otherwise, nobody would ever be able to log in to your app.
> 
> What you'll want to do is put some conditional logic that checks the 
path of 
> the current page inside your execute method that skips the test for 
those 
> pages.
> 
> Craig

I know, I was being an idiot. I had assumed (wrongly naturally) what 
"includes" and "excludes" meant. In my mind, I assumed it meant something 
like "for pages that follow the "includes" pattern, but not the "exclude" 
pattern, use the accept method in the filter (represnted by the class) to 
decide what to do... don't know if I'm explaining my misunderstanding just 
right. ..ok, never mind... :)

Anyways, after I burrowed into the code I did see I was way wrong in my 
assumption. I am glad to see what you said because it was sort of what i 
thought may be what i had to do. Once I do get this right, i shall post my 
code and maybe some other poor soul can stop tearing hair from head..:)

Just one thing though, and this may just be something to do with docs is 
all, AbstractRegExpFilter.java says: "If there are any include patterns, 
and the value matches one of
 *     these patterns, call <code>accept()</code> and return
 *     <code>false</code> to indicate request processing should continue."

However, the execute method has this code:
// Check for a match on the included list
        if (matches(value, includesPatterns, true)) {
            if (log.isTraceEnabled()) {
                log.trace("  accept(include)");
            }
            accept(webContext);
            return false;
        }

I am wondering if you don't want if (matches(value, includesPatterns, 
false)) instead..? Since the comment says *if* there are include patterns 
etc.. I mean therefore if there is an empty includes pattern this should 
not be the case maybe..? just wondering.. obviously I don't know for sure 
at all what the intent was.:)

Yet once again, thank you. I still dream of the day when maybe I won't 
need this much hand holding.:)
Geeta

Reply via email to