Package org.glassfish.grizzly.http

Examples of org.glassfish.grizzly.http.Method


        /*
         * Only for GET should the response actually contain the content.
         * Java Web Start uses HEAD to find out when the target was last
         * modified to see if it should ask for the entire target.
         */
        final Method methodType = gReq.getMethod();
        if (Method.GET.equals(methodType)) {
            writeData(instance.getText(), gResp);
        }
        logger.log(Level.FINE, "{0}Served dyn content for {1}: {2}{3}",
                new Object[]{logPrefix(), methodType, relativeURIString,
View Full Code Here


    @Override
    public void service(Request req, Response res) {

        bundle = getResourceBundle(req.getLocale());

        Method method = req.getMethod();
        if (!checkHttpMethodAllowed(method)) {
            res.setStatus(java.net.HttpURLConnection.HTTP_BAD_METHOD,
                    method.getMethodString() + " " + bundle.getString("http.bad.method"));
            res.setHeader("Allow", getAllowedHttpMethodsAsString());
            return;
        }
        if (!env.isDas()) {
            sendStatusNotDAS(req, res);
View Full Code Here

            super('m');
        }

        @Override
        StringBuilder format(StringBuilder builder, Request request, Response response, Date timeStamp, long responseNanos) {
            final Method method = request.getMethod();
            return builder.append(method == null ? "-" : method.toString());
        }
View Full Code Here

                // For GET and HEAD, we should respond with
                // 304 Not Modified.
                // For every other method, 412 Precondition Failed is sent
                // back.
                final Method method = request.getMethod();
                if (Method.GET.equals(method) || Method.HEAD.equals(method)) {
                    return HttpStatus.NOT_MODIFIED_304;
                } else {
                    return HttpStatus.PRECONDITION_FAILED_412;
                }
View Full Code Here

    @Override
    public void service(Request req, Response res) {

        bundle = getResourceBundle(req.getLocale());

        Method method = req.getMethod();
        if (!checkHttpMethodAllowed(method)) {
            res.setStatus(java.net.HttpURLConnection.HTTP_BAD_METHOD,
                    method.getMethodString() + " " + bundle.getString("http.bad.method"));
            res.setHeader("Allow", getAllowedHttpMethodsAsString());
            return;
        }
        if (!env.isDas()) {
            sendStatusNotDAS(req, res);
View Full Code Here

        /*
         * Only for GET should the response actually contain the content.
         * Java Web Start uses HEAD to find out when the target was last
         * modified to see if it should ask for the entire target.
         */
        final Method methodType = gReq.getMethod();
        if (Method.GET.equals(methodType)) {
            writeData(text, gReq.getResponse());
        }
        logger.log(Level.FINE, "{0}Served dyn content for {1}: {2}{3}",
                new Object[]{logPrefix(), methodType, relativeURIString,
View Full Code Here

    @Override
    public void service(Request req, Response res) {

        bundle = getResourceBundle(req.getLocale());

        Method method = req.getMethod();
        if (!checkHttpMethodAllowed(method)) {
            res.setStatus(java.net.HttpURLConnection.HTTP_BAD_METHOD,
                    method.getMethodString() + " " + bundle.getString("http.bad.method"));
            res.setHeader("Allow", getAllowedHttpMethodsAsString());
            return;
        }
        if (!env.isDas()) {
            sendStatusNotDAS(req, res);
View Full Code Here

                // For GET and HEAD, we should respond with
                // 304 Not Modified.
                // For every other method, 412 Precondition Failed is sent
                // back.
                final Method method = request.getMethod();
                if (Method.GET.equals(method) || Method.HEAD.equals(method)) {
                    return HttpStatus.NOT_MODIFIED_304;
                } else {
                    return HttpStatus.PRECONDITION_FAILED_412;
                }
View Full Code Here

    @Override
    public void service(Request req, Response res) {

        bundle = getResourceBundle(req.getLocale());

        Method method = req.getMethod();
        if (!checkHttpMethodAllowed(method)) {
            res.setStatus(java.net.HttpURLConnection.HTTP_BAD_METHOD,
                    method.getMethodString() + " " + bundle.getString("http.bad.method"));
            res.setHeader("Allow", getAllowedHttpMethodsAsString());
            return;
        }
        if (!env.isDas()) {
            sendStatusNotDAS(req, res);
View Full Code Here

        HttpRequestPacket requestPacket = requestCache.poll();
        if (requestPacket == null) {
            requestPacket = new HttpRequestPacketImpl();
        }
       
        final Method method = Method.valueOf(request.getMethod());
       
        requestPacket.setMethod(method);
        requestPacket.setProtocol(Protocol.HTTP_1_1);

        // Special handling for CONNECT.
View Full Code Here

TOP

Related Classes of org.glassfish.grizzly.http.Method

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.