Examples of ServletConfig


Examples of javax.servlet.ServletConfig

  public PluginContextTest(String arg0) {
    super(arg0);
  }

  public void testDispatcher() throws ConfigException {
    ServletConfig config = new TestServletConfig("test");
    ControlModuleMapping mapping = new ControlModuleMapping("/test/*");
    ControlModuleContext module = new ControlModuleContext(config, mapping, null);
    PluginContext context = new PluginContext(module, DefaultAction.class, new DefaultDispatcher(module));
    DefaultDispatcher dispatcher = new DefaultDispatcher(context.getModuleContext());

View Full Code Here

Examples of javax.servlet.ServletConfig

    } catch (Exception e) {
    }
  }

  public void testFilterClass() throws ConfigException {
    ServletConfig config = new TestServletConfig("test");
    ControlModuleMapping mapping = new ControlModuleMapping("/test/*");
    ControlModuleContext module = new ControlModuleContext(config, mapping, null);
    PluginContext context = new PluginContext(module, DefaultAction.class, new DefaultDispatcher(module));

    assertNull(context.getFilterClass("foo"));
View Full Code Here

Examples of javax.servlet.ServletConfig

  public ControlModuleContextTest(String arg0) {
    super(arg0);
  }

  public void testBasics() throws ConfigException {
    ServletConfig config = new TestServletConfig("test");
    ControlModuleMapping mapping = new ControlModuleMapping("/test/*");
    ControlModuleContext context = new ControlModuleContext(config, mapping, null);
   
    assertSame("test", context.getName());
    assertSame(config.getServletContext(), context.getServletContext());
    assertEquals("/test/action", context.getPath("/action"));
  }
View Full Code Here

Examples of javax.servlet.ServletConfig

    assertSame(config.getServletContext(), context.getServletContext());
    assertEquals("/test/action", context.getPath("/action"));
  }

  public void testModuleAttributes() throws ConfigException {
    ServletConfig config = new TestServletConfig("test");
    ControlModuleMapping mapping = new ControlModuleMapping("/test/*");
    ControlModuleContext context = new ControlModuleContext(config, mapping, null);

    assertNull(context.getAttribute("foo"));
    context.setAttribute("foo", "bar");
View Full Code Here

Examples of javax.servlet.ServletConfig

        refFile = new File(thisDir, "reference/test-jsptaglibs.txt");
    }

    public void runTest() throws TemplateException {
        try {
            ServletConfig cfg = new MockServletConfig();
            FreemarkerServlet servlet = new FreemarkerServlet();
            servlet.init(cfg);
            MockRequest req = new MockRequest("test-jsptaglibs.txt");
            MockResponse resp = new MockResponse();
            servlet.doGet(req, resp);
View Full Code Here

Examples of javax.servlet.ServletConfig

    this.apiWriter.writeJavaScript(uri, printWriter, service);
  }

  public void scanResources(){

    ServletConfig config = getServletConfig();
    ServletContext servletContext = config .getServletContext();
    ResourceMethodRegistry registry = (ResourceMethodRegistry) servletContext
    .getAttribute(Registry.class.getName());
    ResteasyProviderFactory providerFactory =
      (ResteasyProviderFactory) servletContext.getAttribute(ResteasyProviderFactory.class.getName());
View Full Code Here

Examples of javax.servlet.ServletConfig

     * @throws ServletException
     */
    public void init(final FilterConfig filterConfig) throws ServletException {
        logger.info("AtmosphereServlet running as a Filter");

        as.init(new ServletConfig() {

            public String getServletName() {
                return filterConfig.getFilterName();
            }

View Full Code Here

Examples of javax.servlet.ServletConfig

        try {
            super.init(sc);

            ServletContextHolder.register(this);

            ServletConfig scFacade = new ServletConfig() {

                public String getServletName() {
                    return sc.getServletName();
                }
View Full Code Here

Examples of javax.servlet.ServletConfig

        // Fail fast if servlet already registered!
        registrations.addServlet(servlet);

        final ServletContext context = contextManager.getServletContext(
                httpContext, null);
        final ServletConfig config = new ServletConfigImpl(parameters, context);
        servlet.init(config);

        dispatcher = new RequestDispatcherImpl(alias, servlet, httpContext,
                                               lastModificationDate);
    }
View Full Code Here

Examples of javax.servlet.ServletConfig

    }

    public void destroy()
    {
        final Servlet servlet = dispatcher.getServlet();
        final ServletConfig cfg = servlet.getServletConfig();
        final ServletContext context = cfg != null ? cfg.getServletContext() : null;
        servlet.destroy();
        if (context != null) {
          contextManager.ungetServletContext(context);
        }
        registrations.removeServlet(servlet);
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.