Package javax.servlet

Examples of javax.servlet.ServletContext


     *
     * @return A Map of SshConnections, keyed by the connectionInfo String.
     */
    private Map getConnectionMap()
    {
        ServletContext context = session.getServletContext();
        Map sshConnections = (Mapcontext.getAttribute( session.getId() + SSH_CONNECTIONS );

        if( sshConnections == null )
        {
            sshConnections = new HashMap();
            context.setAttribute( session.getId() + SSH_CONNECTIONS, sshConnections );
        }

        return sshConnections;
    }
View Full Code Here


                     if (session.isNew())
                     {
                        cc = new Cookie(SESSION_COOKIE_NAME, sessionValue);
                        if (serve.expiredIn < 0)
                           cc.setMaxAge(Math.abs(serve.expiredIn) * 60);
                        ServletContext sc = ((AcmeSession) session).getServletContext();
                        try
                        {
                           String cp = (String) sc.getClass().getMethod("getContextPath", Utils.EMPTY_CLASSES)
                                   .invoke(sc, Utils.EMPTY_OBJECTS);
                           if (cp.length() == 0)
                              cp = "/";
                           cc.setPath(cp);
                        }
View Full Code Here

   private final static Logger logger = Logger.getLogger(GuiceResteasyBootstrapServletContextListener.class);

   public void contextInitialized(final ServletContextEvent event)
   {
      super.contextInitialized(event);
      final ServletContext context = event.getServletContext();
      final Registry registry = (Registry) context.getAttribute(Registry.class.getName());
      final ResteasyProviderFactory providerFactory = (ResteasyProviderFactory) context.getAttribute(ResteasyProviderFactory.class.getName());
      final ModuleProcessor processor = new ModuleProcessor(registry, providerFactory);
      final List<Module> modules = getModules(context);
      final Stage stage = getStage(context);
      if (stage == null)
      {
View Full Code Here

  private OAuthProvider provider;
  private OAuthValidator validator;

  public void init(FilterConfig config) throws ServletException {
    logger.info("Loading OAuth Filter");
    ServletContext context = config.getServletContext();
    provider = OAuthUtils.getOAuthProvider(context);
    validator = OAuthUtils.getValidator(context, provider);
  }
View Full Code Here

    throws ServletException {
    super.init(config);
    logger.info("Loading OAuth Servlet");
   
    // load the context-parameters
    ServletContext context = config.getServletContext();
    consumerRegistrationURL = context.getInitParameter(PARAM_CONSUMER_REGISTRATION_URL);
        if(consumerRegistrationURL == null)
            consumerRegistrationURL = "/consumer/registration";
   
        authorizationURL = context.getInitParameter(PARAM_TOKEN_AUTHORIZATION_URL);
        if(authorizationURL == null)
            authorizationURL = "/authorization";
       
    requestTokenURL = context.getInitParameter(PARAM_REQUEST_TOKEN_URL);
    if(requestTokenURL == null)
      requestTokenURL = "/requestToken";
    accessTokenURL = context.getInitParameter(PARAM_ACCESS_TOKEN_URL);
    if(accessTokenURL == null)
      accessTokenURL = "/accessToken";

    logger.info("Request token URL: "+ requestTokenURL);
    logger.info("Access token URL: "+ accessTokenURL);
View Full Code Here

    pageContext = new TestPageContext();
    HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
    // configure test module
    module = new TestModuleContext("test", pageContext.getServletContext());
    // configure module container
    ServletContext context = request.getSession().getServletContext();
    TestModuleGroup group = TestModuleGroup.getInstance(context);
    group.add(module);
    // install i18n support
    I18nSupport support = new TestI18nSupport();
    module.setAttribute(I18nSupport.I18N_SUPPORT_KEY, support);
View Full Code Here

    pageContext = new TestPageContext();
    HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
    // configure test module
    module = new TestModuleContext("test", pageContext.getServletContext());
    // configure module container
    ServletContext context = request.getSession().getServletContext();
    TestModuleGroup group = TestModuleGroup.getInstance(context);
    group.add(module);
    // select module
    group.setTestModuleContext(request, module);
  }
View Full Code Here

  protected void setUp() throws ServletException {
    pageContext = new TestPageContext(request);
    // configure test module
    module = new TestModuleContext("test", pageContext.getServletContext());
    // configure module container
    ServletContext context = request.getSession().getServletContext();
    TestModuleGroup group = TestModuleGroup.getInstance(context);
    group.add(module);
    // select module
    group.setTestModuleContext(request, module);
  }
View Full Code Here

  protected void setUp() throws ServletException {
    pageContext = new TestPageContext();
    HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
    // configure module container
    ServletContext context = request.getSession().getServletContext();
    TestModuleGroup group = TestModuleGroup.getInstance(context);
    // configure test modules
    module1 = new TestModuleContext("test1", pageContext.getServletContext());
    group.add(module1);
    module2 = new TestModuleContext("test2", pageContext.getServletContext());
View Full Code Here

  }

  protected void setUp() throws ServletException, ConfigException {
    pageContext = new TestPageContext();
    // configure module container
    ServletContext context = pageContext.getServletContext();
    TestModuleGroup group = TestModuleGroup.getInstance(context);
    // configure test module
    module = new TestModuleContext("test", pageContext.getServletContext());
    group.add(module);
    group.setTestModuleContext((HttpServletRequest)pageContext.getRequest(), module);
View Full Code Here

TOP

Related Classes of javax.servlet.ServletContext

Copyright © 2018 www.massapicom. 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.