[undertow-dev] Undertow servlet context

Rohan Emmanuel rohan.emmanuel07 at gmail.com
Wed Feb 15 05:34:31 EST 2017


I am using wildfly 10 and have a filter in my web application which will
set a attribute in the servlet context.



public void init(FilterConfig arg0)

    throws ServletException

  {

   ServletContext sc = arg0.getServletContext();

   System.out.println("setting the servlet context");

   sc.setAttribute("ha","ha is enabled for this application");

  }



I want to get this attribute in one of my httphandler.



ServletRequestContext servletreqcontext =
exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);

    System.out.println("servletreqcontext-="+servletreqcontext);



the above code is returing NULL.

Any idea how can i get a handle on the  servletContext in httphandler to
get this attribute?

-- 
Regards,
Rohan Emmanuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20170215/44c8d3c4/attachment-0001.html 


More information about the undertow-dev mailing list