Package javax.servlet.http

Examples of javax.servlet.http.HttpServlet$NoBodyResponse


    public void testIntegration() throws Exception
    {
        MockControl contextControl = newControl(ServletContext.class);
        ServletContext context = (ServletContext) contextControl.getMock();

        HttpServlet servlet = new ServletFixture();

        // Create a non-strict control
        MockControl configControl = MockControl.createControl(ServletConfig.class);
        addControl(configControl);
        ServletConfig config = (ServletConfig) configControl.getMock();

        config.getInitParameter(ApplicationSpecificationInitializer.APP_SPEC_PATH_PARAM);
        configControl.setReturnValue(null);

        config.getServletContext();
        configControl.setReturnValue(context, 3);

        config.getServletName();
        configControl.setReturnValue("dino", 2);

        context.log("dino: init");

        context.getResource("/WEB-INF/dino/dino.application");
        contextControl.setReturnValue(getClass().getResource("ParseApp.application"), 2);

        replayControls();

        servlet.init(config);

        Registry registry = RegistryBuilder.constructDefaultRegistry();

        ApplicationInitializer ai = (ApplicationInitializer) registry.getService(
                "tapestry.init.ApplicationSpecificationInitializer",
View Full Code Here


    protected void loadBus(ServletConfig sc) {
        this.bus = BusFactory.newInstance().createBus();
    }
   
    private ServletController createServletController(ServletConfig servletConfig) {
        HttpServlet serviceListGeneratorServlet =
            new ServiceListGeneratorServlet(destinationRegistry, bus);
        ServletController newController =
            new ServletController(destinationRegistry,
                                  servletConfig,
                                  serviceListGeneratorServlet);       
View Full Code Here

       
        if (target instanceof HttpServiceInvoker) {
            HttpServiceInvoker invoker = (HttpServiceInvoker) target;
            invoker.invoke(request, response, null);
        } else if (target instanceof HttpServlet) {
            HttpServlet servlet = (HttpServlet) target;
            servlet.service(request, response);
        } else if (target instanceof Filter) {
            Filter filter = (Filter) target;
            filter.doFilter(request, response, filterChain);
        } else {
            logger.warn("invoke called with target " + (target != null ) + " which is not an instance of " + HttpServiceInvoker.class.getSimpleName() + ", " +
View Full Code Here

        FrameworkLockHolder frameworkLockHolder = moduleManagementFacade.getFrameworkLockHolder();
       
        try {
            frameworkLockHolder.writeLock();
            WebApplicationContext wac = createWebApplicationContext();
            HttpServlet delegateServlet = this;
        
            this.invoker = getInvoker(wac, delegateServlet, frameworkLockHolder, this.setThreadContextClassLoader);
           
            //FIXME this probably shouldn't automatically be being called. How to stop it from being called inappropriately
            //However, it must be called
View Full Code Here

            ServletContext context)
            throws ServletException, IOException {
       
        String moduleName = getModuleName(request);
       
        HttpServlet moduleServlet = null;
        if (moduleName != null) {
            moduleServlet = WebServletUtils.getModuleServlet(context, moduleName);
            if (moduleServlet != null) {
               
                //explicitly go through service method
                HttpServletRequest wrappedRequest = wrappedRequest(request, context, moduleName);
                moduleServlet.service(wrappedRequest, response);
            } else {
                logger.warn("No redirection possible for servlet path " + request.getServletPath() + ", module name " + moduleName);
            }
        } else {
            logger.warn("Not possible to figure out module name from servlet path " + request.getServletPath());
View Full Code Here

       
            //create the web application context
            WebApplicationContext wac = createContext();
           
            //make sure that the delegate servlet is available
            HttpServlet delegateServlet = ObjectUtils.cast(wac.getBean(delegateServletBeanName),
                    HttpServlet.class);
           
            if (delegateServlet == null) {
                throw new ConfigurationException("No Servlet registered under name " + delegateServletBeanName);
            }
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        servlet = new ModuleJspServlet();
        servletContext = new AttributeServletContext();
       
        delegate = new HttpServlet() {

            private static final long serialVersionUID = 1L;

            @Override
            protected void service(HttpServletRequest req,
View Full Code Here

       
            //create the web application context
            WebApplicationContext wac = createContext();
           
            //make sure that the delegate servlet is available
            HttpServlet delegateServlet = ObjectUtils.cast(wac.getBean(delegateServletBeanName),
                    HttpServlet.class);
           
            if (delegateServlet == null) {
                throw new ConfigurationException("No Servlet registered under name " + delegateServletBeanName);
            }
View Full Code Here

  @Override
  protected void doService(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    
    WebApplicationContext wac = this.getWebApplicationContext();
   
    HttpServlet delegateServlet = ObjectUtils.cast(wac.getBean(delegateServletBeanName),
        HttpServlet.class);
   
    if (delegateServlet == null) {
      throw new ConfigurationException("No Servlet registered under name " + delegateServletBeanName);
    }
View Full Code Here

    }
   
    public void testInvokeWithTrue() throws Exception {
        ClassLoader classLoader = new ModuleClassLoader(new File[]{new File("./")});
       
        HttpServlet servlet = new HttpServlet() {
            private static final long serialVersionUID = 1L;

            public void service(HttpServletRequest req, HttpServletResponse res)
                    throws ServletException, IOException {
                contextClassLoader = Thread.currentThread().getContextClassLoader();
View Full Code Here

TOP

Related Classes of javax.servlet.http.HttpServlet$NoBodyResponse

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.