Exemplo n.º 1
0
 ContextHandler getContextHandler(AsyncContextEvent event) {
   if (event != null) {
     Context context = ((Context) event.getServletContext());
     if (context != null) return context.getContextHandler();
   }
   return null;
 }
  /* ------------------------------------------------------------ */
  public static SecurityHandler getCurrentSecurityHandler() {
    Context context = ContextHandler.getCurrentContext();
    if (context == null) return null;

    return context.getContextHandler().getChildHandlerByClass(SecurityHandler.class);
  }
Exemplo n.º 3
0
 /** Set servlet context attributes that can be used in jsp. */
 void setContextAttributes(Context ctx, Map<String, Object> contextAttrs) {
   for (Map.Entry<String, Object> e : contextAttrs.entrySet()) {
     ctx.setAttribute(e.getKey(), e.getValue());
   }
 }