users@grizzly.java.net

Re: Realm / Authentication & ServletContextListeners with grizzly servlet sebserver

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Fri, 04 Jun 2010 11:49:37 +0200

Hi Raphael,


> However, 2 things are missing to get further:
> * In my Jersey servlet, I have set some security constraints on my web
> resources, with the use of JAX-RS security annotation @RolesAllowed.
> This
> feature works fine under Tomcat with DIGEST based authentication /
> realm.
> However, I have not found a way to add a HTTP authentication (basic or
> digest) to a Grizzly server. Does it need a "filter" for it ? Where
> can I
> find an implementation of a simple authentication filter ?
Can you pls. show the code, how you process this annotation under
Tomcat? Or Jersey does it for you automatically?


> * I have a ServletContextListener registered in Tomcat to setup some
> stuff
> on startup. I have not been able to register it with Grizzly. I have
> seen a
> reference to a ServletAdapter.addServletContextListener() in the svn
> javadoc
> of 1.9.9-SNAPSHOT (which I use), but it does not appear to actually
> exist.
You're right, it's javadoc issue.
Please use ServletAdapter constructor [1] and pass classname(s) of
your ServletContextListener in the listeners parameter.

Thanks.

WBR,
Alexey.


[1]


     /**
      * Convenience constructor.
      *
      * @param publicDirectory The folder where the static resource
are located.
      * @param servletCtx {_at_link ServletContextImpl} to be used by new
instance.
      * @param contextParameters Context parameters.
      * @param servletInitParameters servlet initialization parameres.
      * @param listeners Listeners.
      */
     protected ServletAdapter(String publicDirectory,
ServletContextImpl servletCtx,
             HashMap<String,String> contextParameters,
HashMap<String,String> servletInitParameters,
             ArrayList<String> listeners)


>
> Thanks in advance for your help,
>
> Kind regards,
>
> Raphael
>
>
>
> --
> View this message in context: http://old.nabble.com/Realm---Authentication---ServletContextListeners-with-grizzly-servlet-sebserver-tp28768971p28768971.html
> Sent from the Grizzly - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>