I'm trying the following:

{code}
  int port = 9999;
        Server server = new Server(port);

        ServletContextHandler siteContext = new
ServletContextHandler(server, "/site", ServletContextHandler.SESSIONS
| ServletContextHandler.SECURITY);
        ServletHolder servletHolder = new ServletHolder(new
HttpServletDispatcher());
        servletHolder.setInitParameter("javax.ws.rs.Application",
MySite.class.getName());
        siteContext.addServlet(servletHolder, "/*");
        server.setHandler(siteContext);

        server.start();
        server.join();
}

public class MySite extends Application {

    @Context ServletContext config;
}
{code}


config always ends up being null.

On 6/19/13, Bill Burke <bbu...@redhat.com> wrote:
> You should be able to.  Would be cool to also state in your email if you
> actually tried it and on what version of resteasy.
>
> On 6/18/2013 9:20 PM, buko wrote:
>> I can't seem to find a definitive answer to this but is it possible to
>> @Context inject a ServletContext or ServletConfig into a
>> javax.ws.rs.core.Application implementation when RestEasyis deployed
>> into a Servlet container?
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by Windows:
>>
>> Build for Windows Store.
>>
>> http://p.sf.net/sfu/windows-dev2dev
>>
>>
>>
>> _______________________________________________
>> Resteasy-users mailing list
>> Resteasy-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>>
>
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev
> _______________________________________________
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users

Reply via email to