> After having a look at HiveMindFilter implementation, I was wondering why it
> seems so "complex", I mean: why do we need to store the same Registry in the
> request, why not store it directly in a static variable and make it
> available through a static method with no argument? Is there a problem to
> having the Registry as static?

Repeat after me: statics are evil. I'm joking, but there's some truth
in that. If you're deploying more than one web application, statics
will get you into trouble: the Registry class might be shared between
the web applications, and if you use a static variable to store it, it
will be shared by the two applications.

That being said, the current request really isn't the best place to
store the registry either. The servlet context would be more
appropriate, IMHO. Another good candidate is a JNDI directory.

> What should I do to work around this problem?

If you have a way to access the servlet context from the SecurityRealm
interface, write your own filter that stores the registry as a servlet
context attribute. If you don't, you should consider storing it in a
JNDI directory that you can access from the SecurityRealm.

-- Marcus Brito

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

Reply via email to