Hi Stuart,

I have a regular servlet (the sample... public class HelloWorldServlet extends HttpServlet) running inside the same web context (in the same war).  In the HelloWorldServlet I can access the session object.  I ran that first, but when I run the non-blocking servlet, my reqctx still returns null.  

I'm running Wildfly 8.0.0 final, in case that matters.

So is everything hinging on:

public class ServletInitialHandler implements HttpHandler, ServletDispatcher {
...
public void handleRequest(final HttpServerExchange exchange) throws IOException, ServletException
...
exchange.putAttachment(ServletRequestContext.ATTACHMENT_KEY, servletRequestContext);
...





On Sun, Mar 9, 2014 at 12:55 PM, Stuart Douglas <sdouglas@redhat.com> wrote:
This will only be not null after the first servlet handler has run.
If your handler is executing outside the scope of the servlet deployment then you need to store a reference to the ServletContext somewhere (worst case = stick it in a static somewhere).
Stuart


Lightspoke Discussion wrote:
If you are running before the initial handler you need to store a reference to the servlet context or the Deployment somewhere.



--
--
Matthew Ma
http://www.lightspoke.com
Lightspoke Web Based Database