Examples of SlingHttpServletResponse


Examples of org.apache.sling.api.SlingHttpServletResponse

        assertEquals(resourceResolver, result);
    }

    @Test
    public void testFromSomethingElse() {
        SlingHttpServletResponse response = mock(SlingHttpServletResponse.class);

        Object result = injector.getValue(response, "resourceResolver", null, null, null);
        assertNull(result);
    }
View Full Code Here

Examples of org.apache.sling.api.SlingHttpServletResponse

     * {@link #DEFAULT_RESOURCERESOLVER_TYPE} for the resource resolver.
     * @return Sling script helper instance
     */
    public static SlingScriptHelper newSlingScriptHelper() {
        SlingHttpServletRequest request = new MockSlingHttpServletRequest(newResourceResolver());
        SlingHttpServletResponse response = new MockSlingHttpServletResponse();
        BundleContext bundleContext = MockOsgi.newBundleContext();
        return newSlingScriptHelper(request, response, bundleContext);
    }
View Full Code Here

Examples of org.apache.sling.api.SlingHttpServletResponse

            } else {
                dispatcher = request.getRequestDispatcher(path, opts);
            }

            if (dispatcher != null) {
                SlingHttpServletResponse response = new JspSlingHttpServletResponseWrapper(
                    pageContext);
                dispatch(dispatcher, request, response);
            } else {
                TagUtil.log(log, pageContext, "No content to include...", null);
            }
View Full Code Here

Examples of org.apache.sling.api.SlingHttpServletResponse

            ServletException {

        // we need a SlingHttpServletRequest/SlingHttpServletResponse tupel
        // to continue
        SlingHttpServletRequest cRequest = RequestData.toSlingHttpServletRequest(request);
        SlingHttpServletResponse cResponse = RequestData.toSlingHttpServletResponse(response);

        // get the request data (and btw check the correct type)
        final RequestData requestData = RequestData.getRequestData(cRequest);
        final ContentData oldContentData = requestData.getContentData();
        final ContentData contentData = requestData.setContent(resource, resolvedURL);
View Full Code Here

Examples of org.apache.sling.api.SlingHttpServletResponse

        // the previous filter may have wrapped non-Sling request and response
        // wrappers (e.g. WebCastellum does this), so we have to make
        // sure the request and response are Sling types again
        SlingHttpServletRequest slingRequest = toSlingRequest(request);
        SlingHttpServletResponse slingResponse = toSlingResponse(response);

        if (this.current < this.filters.length) {

            // continue filtering with the next filter
            Filter filter = this.filters[this.current];
View Full Code Here

Examples of org.apache.sling.api.SlingHttpServletResponse

     */
    public static SlingHttpServletResponse toSlingHttpServletResponse(
            ServletResponse response) {

        // unwrap to SlingHttpServletResponse
        SlingHttpServletResponse cResponse = unwrap(response);

        // check type of response, don't care actually for the response itself
        RequestData.unwrap(cResponse);

        // if the servlet response is actually the SlingHttpServletResponse, we
View Full Code Here

Examples of org.apache.sling.api.SlingHttpServletResponse

                // might throw an IOException of course
                pageContext.getOut().flush();
            }

            // wrap the response to get the correct output order
            SlingHttpServletResponse response = new JspSlingHttpServletResponseWrapper(
                pageContext);

            servlet.service(pageContext.getRequest(), response);

            return EVAL_PAGE;
View Full Code Here

Examples of org.apache.sling.api.SlingHttpServletResponse

                // might throw an IOException of course
                pageContext.getOut().flush();
            }

            // wrap the response to get the correct output order
            SlingHttpServletResponse response = new JspSlingHttpServletResponseWrapper(pageContext);

            tracker.startTimer(servletName);

            servlet.service(pageContext.getRequest(), response);
View Full Code Here

Examples of org.apache.sling.api.SlingHttpServletResponse

        // setting the Sling request and response
        final RequestData requestData = new RequestData(this, servletRequest,
            servletResponse);
        final SlingHttpServletRequest request = requestData.getSlingRequest();
        final SlingHttpServletResponse response = requestData.getSlingResponse();

        // record the request for the web console display
        RequestHistoryConsolePlugin.recordRequest(request);

        try {
View Full Code Here

Examples of org.apache.sling.api.SlingHttpServletResponse

        }
        final SlingScriptHelper sling = (SlingScriptHelper)slingObject;
        bindings.put(SLING, sling);

        if (request != null) {
          final SlingHttpServletResponse response = slingBindings.getResponse();
            if (response == null) {
                throw fail(RESPONSE, "Missing or wrong type");
            }

            Object resourceObject = slingBindings.get(RESOURCE);
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.