Package javax.servlet

Examples of javax.servlet.ServletContext.removeAttribute()


    // 2.
    request.removeAttribute("name1");
    expect(request.getSession(false)).andReturn(session);
    session.removeAttribute("name2");
    context.removeAttribute("name3");

    // 3.
    expect(request.getSession(false)).andReturn(null);

    replay(request);
View Full Code Here


               case WebAppLifeCycleEvent.ADDED:
                  context.setAttribute("ConsumerRegistry", consumerRegistry);
                  context.setAttribute("ProducerConfigurationService", producer.getConfigurationService());
                  break;
               case WebAppLifeCycleEvent.REMOVED:
                  context.removeAttribute("ConsumerRegistry");
                  context.removeAttribute("ProducerConfigurationService");
                  break;
            }
         }
      }
View Full Code Here

                  context.setAttribute("ConsumerRegistry", consumerRegistry);
                  context.setAttribute("ProducerConfigurationService", producer.getConfigurationService());
                  break;
               case WebAppLifeCycleEvent.REMOVED:
                  context.removeAttribute("ConsumerRegistry");
                  context.removeAttribute("ProducerConfigurationService");
                  break;
            }
         }
      }
   }
View Full Code Here

     * Removes the ConnectionMap from the Session (actually, the ServletContext).
     */
    void removeConnectionMap()
    {
        ServletContext context = session.getServletContext();
        context.removeAttribute( session.getId() + SSH_CONNECTIONS );
    }

    /**
     * Retrieve the ConnectionMap for this session.  The map is actually stored
     * in the ServletContext so it will be accessible by the SessionCleanup class
View Full Code Here

  public void contextDestroyed(ServletContextEvent event) {
    ServletContext context = event.getServletContext();
    // 1. Retrieves the scheduler from the context.
    Scheduler scheduler = (Scheduler) context.getAttribute(Constants.SCHEDULER);
    // 2. Removes the scheduler from the context.
    context.removeAttribute(Constants.SCHEDULER);
    // 3. Stops the scheduler.
    scheduler.stop();
  }

}
View Full Code Here

        ELInterpreter interpreter =
                ELInterpreterFactory.getELInterpreter(context);
        Assert.assertNotNull(interpreter);
        Assert.assertTrue(interpreter instanceof DefaultELInterpreter);

        context.removeAttribute(ELInterpreter.class.getName());

        context.setAttribute(ELInterpreter.class.getName(),
                SimpleELInterpreter.class.getName());
        interpreter = ELInterpreterFactory.getELInterpreter(context);
        Assert.assertNotNull(interpreter);
View Full Code Here

                SimpleELInterpreter.class.getName());
        interpreter = ELInterpreterFactory.getELInterpreter(context);
        Assert.assertNotNull(interpreter);
        Assert.assertTrue(interpreter instanceof SimpleELInterpreter);

        context.removeAttribute(ELInterpreter.class.getName());

        SimpleELInterpreter simpleInterpreter = new SimpleELInterpreter();
        context.setAttribute(ELInterpreter.class.getName(), simpleInterpreter);
        interpreter = ELInterpreterFactory.getELInterpreter(context);
        Assert.assertNotNull(interpreter);
View Full Code Here

        interpreter = ELInterpreterFactory.getELInterpreter(context);
        Assert.assertNotNull(interpreter);
        Assert.assertTrue(interpreter instanceof SimpleELInterpreter);
        Assert.assertTrue(interpreter == simpleInterpreter);

        context.removeAttribute(ELInterpreter.class.getName());

        ctx.stop();
        ctx.addApplicationListener(Bug54239Listener.class.getName());
        ctx.start();
View Full Code Here

        setState(LifecycleState.STOPPING);

        // Remove context attributes as appropriate
        ServletContext servletContext = context.getServletContext();
        servletContext.removeAttribute(Globals.CLASS_PATH_ATTR);

        // Throw away our current class loader
        if (classLoader != null) {
            ((Lifecycle) classLoader).stop();
        }
View Full Code Here

        ELInterpreter interpreter =
                ELInterpreterFactory.getELInterpreter(context);
        Assert.assertNotNull(interpreter);
        Assert.assertTrue(interpreter instanceof DefaultELInterpreter);

        context.removeAttribute(ELInterpreter.class.getName());

        context.setAttribute(ELInterpreter.class.getName(),
                SimpleELInterpreter.class.getName());
        interpreter = ELInterpreterFactory.getELInterpreter(context);
        Assert.assertNotNull(interpreter);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.