Examples of CoyoteResponse


Examples of org.apache.coyote.tomcat5.CoyoteResponse

            // the StandardEngineValve
            return;
        }
       
        super.setContext(ctx);
        CoyoteResponse response = (CoyoteResponse) getResponse();
        // Assert response!=null
        if (response != null) {
            String[] cacheControls = ((PwcWebModule) ctx).getCacheControls();
            for (int i=0; cacheControls!=null && i<cacheControls.length; i++) {
                response.addHeader("Cache-Control", cacheControls[i]);
            }
        }

        sunWebXmlChecked = false;
    }
View Full Code Here

Examples of org.apache.coyote.tomcat5.CoyoteResponse

     */
    private static void proxyResponse(HttpConnection connection,
        Response response) throws IOException {
        // GLASSFISH Request/Response does not extend HttpRequest/Response so
        // we need to cast to Coyote Request/Response
        CoyoteResponse cResponse = (CoyoteResponse) response;

        boolean chunked = false;
        boolean forcedClose = false;
        int contentLength = -1;

        try {
            // Transfer the status code and message to the response.
            int code = setStatusCode(connection, response);

            if (code == CoyoteResponse.SC_CONTINUE) {
                cResponse.sendAcknowledgement();

                return;
            }

            // Parse headers
            MimeHeaders headers = cResponse.getCoyoteResponse().getMimeHeaders();

            while (true) {
                // Read a header line.
                String header = connection.readLine();

View Full Code Here

Examples of org.apache.coyote.tomcat5.CoyoteResponse

     */
    private static int setStatusCode(HttpConnection connection,
        Response response) throws IOException {
        // GLASSFISH Request/Response does not extend HttpRequest/Response so
        // we need to cast to Coyote Request/Response
        CoyoteResponse cResponse = (CoyoteResponse) response;

        String statusLine = readStatusLine(connection);

        try {
            Matcher matcher = statusLinePattern.matcher(statusLine);

            if (matcher.matches()) {
                int code = Integer.parseInt(matcher.group(1));
                String message = matcher.group(2);

                // Set the response code in the response to return.
                cResponse.getResponse().setStatus(code);
                cResponse.getCoyoteResponse().setMessage(message);

                return code;
            }
        } catch (NumberFormatException e) {
            // Fall through.
View Full Code Here

Examples of org.apache.coyote.tomcat5.CoyoteResponse

    private static void sendInternalError(Request request, Response response,
        HttpHost host) throws IOException {
        // GLASSFISH Request/Response does not extend HttpRequest/Response so
        // we need to cast to Coyote Request/Response
        CoyoteRequest cRequest = (CoyoteRequest) request;
        CoyoteResponse cResponse = (CoyoteResponse) response;

        // If the reponse is still not committed...
        if (!cResponse.isCommitted()) {
            // Failed to proxy this request, inform client.
            if (log.isLoggable(Level.FINE)) {
                log.log(Level.FINE,
                    "The attempt to proxy '" + cRequest.getRequestURL() +
                    "' to '" + host + "' failed. " +
                    "Responding with 500 Internal Server Error.");
            }

            cResponse.sendError(CoyoteResponse.SC_INTERNAL_SERVER_ERROR);
        }
    }
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.