Package org.jboss.dashboard.ui.controller

Examples of org.jboss.dashboard.ui.controller.RequestContext.consumeURIPart()


        // Check session expiration
        if (request.getRequestedSessionId() != null && !request.getRequestedSessionId().equals(session.getId())) {
            log.debug("Session expiration detected.");
            requestContext.setResponse(new RedirectToURLResponse(getExpirationRecoveryURL(request)));
            requestContext.consumeURIPart(requestContext.getURIToBeConsumed());
            return false;
        }
        return true;
    }
View Full Code Here


        // No JSP mapping -> nothing to do.
        if (!servletPath.startsWith(JSP_MAPPING)) return true;

        String contextPath = request.getContextPath();
        requestContext.consumeURIPart(JSP_MAPPING);
        String requestUri = request.getRequestURI();
        String relativeUri = requestUri.substring(contextPath == null ? 0 : (contextPath.length()));
        relativeUri = relativeUri.substring(servletPath == null ? 0 : (servletPath.length()));

        // Empty URI -> nothing to do.
View Full Code Here

        if (StringUtils.isBlank(relativeUri)) return true;

        // Set the JSP as the response.
        int paramIndex = relativeUri.indexOf("?");
        String jsp = paramIndex != -1 ? relativeUri.substring(0, paramIndex) : relativeUri;
        requestContext.consumeURIPart(jsp);
        requestContext.setResponse(new ShowScreenResponse(jsp));
        return true;
    }
}
View Full Code Here

            log.warn("Memory is running low ...");
            memoryProfiler.freeMemory();
            if (memoryProfiler.isLowMemory()) {
                RequestContext requestContext = RequestContext.lookup();
                requestContext.setResponse(new SendErrorResponse(503));
                requestContext.consumeURIPart(requestContext.getURIToBeConsumed());
                log.error("Memory is so low that the request had to be canceled - 503 sent. Consider increasing the JVM memory.");
                return false;
            }
        }
        return true;
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.