Package io.undertow.server

Examples of io.undertow.server.DefaultResponseListener


    protected void handleRedirectBack(final HttpServerExchange exchange) {
        final Session session = Sessions.getSession(exchange);
        if (session != null) {
            final String location = (String) session.removeAttribute(LOCATION_ATTRIBUTE);
            if(location != null) {
                exchange.addDefaultResponseListener(new DefaultResponseListener() {
                    @Override
                    public boolean handleDefaultResponse(final HttpServerExchange exchange) {
                        FormAuthenticationMechanism.sendRedirect(exchange, location);
                        exchange.setResponseCode(FOUND);
                        exchange.endExchange();
View Full Code Here


        this.responseCodes = new HashSet<Integer>(Arrays.asList(responseCodes));
    }

    @Override
    public void handleRequest(final HttpServerExchange exchange) throws Exception {
        exchange.addDefaultResponseListener(new DefaultResponseListener() {
            @Override
            public boolean handleDefaultResponse(final HttpServerExchange exchange) {
                Set<Integer> codes = responseCodes;
                if (!exchange.isResponseStarted() && codes.contains(exchange.getResponseCode())) {
                    serveFile(exchange);
View Full Code Here

    public SimpleErrorPageHandler() {
    }

    @Override
    public void handleRequest(final HttpServerExchange exchange) throws Exception {
        exchange.addDefaultResponseListener(new DefaultResponseListener() {
            @Override
            public boolean handleDefaultResponse(final HttpServerExchange exchange) {
                if (!exchange.isResponseChannelAvailable()) {
                    return false;
                }
View Full Code Here

        this.responseCodes = new HashSet<Integer>(Arrays.asList(responseCodes));
    }

    @Override
    public void handleRequest(final HttpServerExchange exchange) throws Exception {
        exchange.addDefaultResponseListener(new DefaultResponseListener() {
            @Override
            public boolean handleDefaultResponse(final HttpServerExchange exchange) {
                Set<Integer> codes = responseCodes;
                if (!exchange.isResponseStarted() && codes.contains(exchange.getResponseCode())) {
                    serveFile(exchange);
View Full Code Here

    public SimpleErrorPageHandler() {
    }

    @Override
    public void handleRequest(final HttpServerExchange exchange) throws Exception {
        exchange.addDefaultResponseListener(new DefaultResponseListener() {
            @Override
            public boolean handleDefaultResponse(final HttpServerExchange exchange) {
                if (!exchange.isResponseChannelAvailable()) {
                    return false;
                }
View Full Code Here

    protected void handleRedirectBack(final HttpServerExchange exchange) {
        final Map<String, Cookie> cookies = exchange.getRequestCookies();
        if (cookies != null && cookies.containsKey(LOCATION_COOKIE)) {
            final String location = cookies.get(LOCATION_COOKIE).getValue();
            exchange.addDefaultResponseListener(new DefaultResponseListener() {
                @Override
                public boolean handleDefaultResponse(final HttpServerExchange exchange) {
                    FormAuthenticationMechanism.sendRedirect(exchange, location);
                    exchange.setResponseCode(FOUND);
                    exchange.endExchange();
View Full Code Here

    protected void handleRedirectBack(final HttpServerExchange exchange) {
        final Session session = Sessions.getSession(exchange);
        if (session != null) {
            final String location = (String) session.removeAttribute(LOCATION_ATTRIBUTE);
            if(location != null) {
                exchange.addDefaultResponseListener(new DefaultResponseListener() {
                    @Override
                    public boolean handleDefaultResponse(final HttpServerExchange exchange) {
                        FormAuthenticationMechanism.sendRedirect(exchange, location);
                        exchange.setResponseCode(StatusCodes.FOUND);
                        exchange.endExchange();
View Full Code Here

    public SimpleErrorPageHandler() {
    }

    @Override
    public void handleRequest(final HttpServerExchange exchange) throws Exception {
        exchange.addDefaultResponseListener(new DefaultResponseListener() {
            @Override
            public boolean handleDefaultResponse(final HttpServerExchange exchange) {
                if (!exchange.isResponseChannelAvailable()) {
                    return false;
                }
View Full Code Here

        this.responseCodes = new HashSet<>(Arrays.asList(responseCodes));
    }

    @Override
    public void handleRequest(final HttpServerExchange exchange) throws Exception {
        exchange.addDefaultResponseListener(new DefaultResponseListener() {
            @Override
            public boolean handleDefaultResponse(final HttpServerExchange exchange) {
                Set<Integer> codes = responseCodes;
                if (!exchange.isResponseStarted() && codes.contains(exchange.getResponseCode())) {
                    serveFile(exchange);
View Full Code Here

    protected void handleRedirectBack(final HttpServerExchange exchange) {
        final Map<String, Cookie> cookies = CookieImpl.getRequestCookies(exchange);
        if (cookies != null && cookies.containsKey(LOCATION_COOKIE)) {
            final String location = cookies.get(LOCATION_COOKIE).getValue();
            exchange.addDefaultResponseListener(new DefaultResponseListener() {
                @Override
                public boolean handleDefaultResponse(final HttpServerExchange exchange) {
                    FormAuthenticationMechanism.sendRedirect(exchange, location);
                    exchange.endExchange();
                    return true;
View Full Code Here

TOP

Related Classes of io.undertow.server.DefaultResponseListener

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.