You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by "John D. Ament" <jo...@apache.org> on 2017/01/22 11:59:11 UTC

Automatically configured servlet environment

Hi,

I noticed that Shiro ships with servlet integration in the way of a web-fragment.xml.  I was wondering if that could be swapped out for an annotation based strategy?  master is already on Servlet 3.1, so all of the annotations are available.

John

Re: Automatically configured servlet environment

Posted by Brian Demers <br...@gmail.com>.
Tomcat and Undertow (and I assume Grizzly) support fragments as this was
part of the servlet 3.0 spec.  If you have found a problem with a specific
container, please let us know!

For CDI ideas take a look at:
https://github.com/apache/shiro/pull/56 - non shiro.ini based
https://github.com/apache/shiro/pull/24 - shiro.ini based

On Mon, Jan 23, 2017 at 10:25 PM, John D. Ament <jo...@apache.org>
wrote:

> Brian,
>
> You're right.  I'm trying to come up with a standardized CDI extension for
> Shiro.  One of the use cases I have is for it to work in embedded servlet
> containers.  Unfortunately, the only embedded container that handles
> web-fragment is Jetty.  Tomcat, Undertow, Grizzly don't support this.  In
> addition, if I produce a shaded JAR the concatenation of web-fragment.xml
> doesn't really work.  I can make annotation processing work pretty easily.
> I suppose with that I could extend the classes to add the annotations, or
> even come up with a service loader mechanism that does it.
>
> John
>
> On 2017-01-23 09:55 (-0500), Brian Demers <br...@gmail.com> wrote:
> > It isn't something that _needs_ to be swapped out, the servlet fragment
> xml
> > is in it's own jar, so if that jar isn't present on your classpath then
> you
> > can configure Shiro any way you want.
> >
> > https://github.com/apache/shiro/tree/master/support/servlet-plugin
> >
> > Is there a framework you are looking to use where annotations are a
> better
> > fit ?
> >
> >
> > On Sun, Jan 22, 2017 at 6:59 AM, John D. Ament <jo...@apache.org>
> > wrote:
> >
> > > Hi,
> > >
> > > I noticed that Shiro ships with servlet integration in the way of a
> > > web-fragment.xml.  I was wondering if that could be swapped out for an
> > > annotation based strategy?  master is already on Servlet 3.1, so all
> of the
> > > annotations are available.
> > >
> > > John
> > >
> >
>

Re: Automatically configured servlet environment

Posted by "John D. Ament" <jo...@apache.org>.
Brian,

You're right.  I'm trying to come up with a standardized CDI extension for Shiro.  One of the use cases I have is for it to work in embedded servlet containers.  Unfortunately, the only embedded container that handles web-fragment is Jetty.  Tomcat, Undertow, Grizzly don't support this.  In addition, if I produce a shaded JAR the concatenation of web-fragment.xml doesn't really work.  I can make annotation processing work pretty easily.  I suppose with that I could extend the classes to add the annotations, or even come up with a service loader mechanism that does it.  

John

On 2017-01-23 09:55 (-0500), Brian Demers <br...@gmail.com> wrote: 
> It isn't something that _needs_ to be swapped out, the servlet fragment xml
> is in it's own jar, so if that jar isn't present on your classpath then you
> can configure Shiro any way you want.
> 
> https://github.com/apache/shiro/tree/master/support/servlet-plugin
> 
> Is there a framework you are looking to use where annotations are a better
> fit ?
> 
> 
> On Sun, Jan 22, 2017 at 6:59 AM, John D. Ament <jo...@apache.org>
> wrote:
> 
> > Hi,
> >
> > I noticed that Shiro ships with servlet integration in the way of a
> > web-fragment.xml.  I was wondering if that could be swapped out for an
> > annotation based strategy?  master is already on Servlet 3.1, so all of the
> > annotations are available.
> >
> > John
> >
> 

Re: Automatically configured servlet environment

Posted by Brian Demers <br...@gmail.com>.
It isn't something that _needs_ to be swapped out, the servlet fragment xml
is in it's own jar, so if that jar isn't present on your classpath then you
can configure Shiro any way you want.

https://github.com/apache/shiro/tree/master/support/servlet-plugin

Is there a framework you are looking to use where annotations are a better
fit ?


On Sun, Jan 22, 2017 at 6:59 AM, John D. Ament <jo...@apache.org>
wrote:

> Hi,
>
> I noticed that Shiro ships with servlet integration in the way of a
> web-fragment.xml.  I was wondering if that could be swapped out for an
> annotation based strategy?  master is already on Servlet 3.1, so all of the
> annotations are available.
>
> John
>