Package dk.brics.jwig

Examples of dk.brics.jwig.WebSite.sendError()


                String error_url = (String) request.getAttribute("javax.servlet.error.request_uri");
                log.info("Status code " + status_code);
                ThreadContext.set(new ThreadContext(request, response, error_url));
                switch (status_code) { // TODO: need to cover more status codes? (should match web.xml)
                    case HttpServletResponse.SC_NOT_FOUND:
                        website.sendError(status_code, "The requested resource is not found: " + error_url);
                        ThreadContext.get().getResponse().write(request, response);
                        break;
                    case HttpServletResponse.SC_FORBIDDEN:
                        website.sendError(status_code, "Access to the requested resource is forbidden: " + error_url);
                        ThreadContext.get().getResponse().write(request, response);
View Full Code Here


                    case HttpServletResponse.SC_NOT_FOUND:
                        website.sendError(status_code, "The requested resource is not found: " + error_url);
                        ThreadContext.get().getResponse().write(request, response);
                        break;
                    case HttpServletResponse.SC_FORBIDDEN:
                        website.sendError(status_code, "Access to the requested resource is forbidden: " + error_url);
                        ThreadContext.get().getResponse().write(request, response);
                        break;
                    default:
                        log.error("Unexpected status code " + status_code);
                }
View Full Code Here

            String method = request.getMethod();
            ThreadContext.set(new ThreadContext(request, response, url));
            log.info(method + " from " + getClient(request) + ": " + url);
            if (!ALLOWED_METHODS.contains(method)) {
                log.info("HTTP method not allowed: " + method);
                website.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "HTTP method " + method + " not allowed.");
                ThreadContext.get().getResponse().write(request, response);
                return;
            }
            //url = URLEncoding.decode(url);
            String path = request.getRequestURI().substring(request.getContextPath().length());
View Full Code Here

            // try all request managers until one takes the request

            if (process(path, url, request, response)) {
                if (!response.isCommitted()) {
                    log.error("No response generated");
                    website.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "No response.");
                    ThreadContext.get().getResponse().write(request, response);
                }
                log.info("Completed");
                return;
            }
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.