Package org.glassfish.web.util

Examples of org.glassfish.web.util.HtmlEntityEncoder


        if (message == null) {
            message = hresponse.getDetailMessage();
            if (message == null) {
                message = "";
            } else {
                HtmlEntityEncoder htmlEntityEncoder = new HtmlEntityEncoder();
                message = htmlEntityEncoder.encode(message);
            }
        }
        // END S1AS 4878272

        // Do nothing if there is no report for the specified status code
View Full Code Here


                }
            }
        }

        if (!exists) {
            HtmlEntityEncoder htmlEntityEncoder = new HtmlEntityEncoder();
            resp.sendError(HttpServletResponse.SC_NOT_FOUND,
                    htmlEntityEncoder.encode(path));
            return;
        }

        resp.setStatus(WebdavStatus.SC_MULTI_STATUS);
View Full Code Here

                              Integer.valueOf(statusCode));
            String message = ((HttpResponse) response).getMessage();
            if (message == null) {
                message = "";
            } else {
                HtmlEntityEncoder htmlEntityEncoder = new HtmlEntityEncoder();
                message = htmlEntityEncoder.encode(message);
            }
            sreq.setAttribute(RequestDispatcher.ERROR_MESSAGE, message);
        }

        if (custom(request, response, errorPage)) {
View Full Code Here

     *
     */
    protected void printServletEnvironment(ServletOutputStream out,
        HttpServletRequest req, HttpServletResponse res) throws IOException {

        printServletEnvironment(out, req, res, new HtmlEntityEncoder());
    }
View Full Code Here

        if (!cgiEnv.isValid()) {
            res.setStatus(404);
        }
        if (debug >= 10) {
            HtmlEntityEncoder htmlEntityEncoder = new HtmlEntityEncoder();
            ServletOutputStream out = res.getOutputStream();
            out.println("<HTML><HEAD><TITLE>$Name:  $</TITLE></HEAD>");
            out.println("<BODY>$Header$<p>");

            if (cgiEnv.isValid()) {
View Full Code Here

                    || !requestPath.equals(errorPage.getLocation())) {
                String message = reqFacHelper.getResponseMessage();
                if (message == null) {
                    message = "";
                } else {
                    HtmlEntityEncoder htmlEntityEncoder = new HtmlEntityEncoder();
                    message = htmlEntityEncoder.encode(message);
                }
                prepareRequestForDispatch(request,
                                          wrapper,
                                          errorPage.getLocation(),
                                          statusCode,
View Full Code Here

            message = reqFacHelper.getResponseMessage();
        }
        if (message == null) {
            message = "";
        } else {
            HtmlEntityEncoder htmlEntityEncoder = new HtmlEntityEncoder();
            message = htmlEntityEncoder.encode(message);
        }

        // Do nothing if there is no report for the specified status code
        String report = null;
        try {
View Full Code Here

         *
         * @return  HTML string containing CGI environment info
         *
         */
        public String toString() {
            return toString(new HtmlEntityEncoder());
        }
View Full Code Here

            // START SJSAS 6387790
            sb.append(RequestUtil.filter(stackTrace));
            // END SJSAS 6387790
            */
            // START GlassFish 823
            HtmlEntityEncoder htmlEntityEncoder = new HtmlEntityEncoder();
            sb.append(htmlEntityEncoder.encode(String.valueOf(throwable)));
            // END GlassFish 823
            sb.append("</pre></p>");

            while (rootCause != null) {
                /* GlassFish 823
                stackTrace = JdkCompat.getJdkCompat()
                    .getPartialServletStackTrace(rootCause);
                */
                sb.append("<p><b>");
                // START SJSAS 6412710
                String rootCauseInfo = rb.getString(ROOT_CAUSE_INFO);
                sb.append(rootCauseInfo);
                // END SJSAS 6412710
                sb.append("</b> <pre>");
                /* SJSAS 6387790
                sb.append(stackTrace);
                */
                /* GlassFish 823
                // START SJSAS 6387790
                sb.append(RequestUtil.filter(stackTrace));
                // END SJSAS 6387790
                */
                // START GlassFish 823
                sb.append(htmlEntityEncoder.encode(String.valueOf(rootCause)));
                // END GlassFish 823
                sb.append("</pre></p>");

                /* GlassFish 823
                // In case root cause is somehow heavily nested
View Full Code Here

        if (debug > 0)
            log("SSIServlet.requestHandler()\n" + "Serving "
                    + (buffered?"buffered ":"unbuffered ") + "resource '"
                    + path + "'");

        HtmlEntityEncoder htmlEntityEncoder = new HtmlEntityEncoder();
        // Exclude any resource in the /WEB-INF and /META-INF subdirectories
        // (the "toUpperCase()" avoids problems on Windows systems)
        if (path == null || path.toUpperCase(Locale.ENGLISH).startsWith("/WEB-INF")
                || path.toUpperCase(Locale.ENGLISH).startsWith("/META-INF")) {
            res.sendError(HttpServletResponse.SC_NOT_FOUND, htmlEntityEncoder.encode(path));
            log("Can't serve file: " + path);
            return;
        }
        URL resource = servletContext.getResource(path);
        if (resource == null) {
            res.sendError(HttpServletResponse.SC_NOT_FOUND, htmlEntityEncoder.encode(path));
            log("Can't find file: " + path);
            return;
        }
        String resourceMimeType = servletContext.getMimeType(path);
        if (resourceMimeType == null) {
View Full Code Here

TOP

Related Classes of org.glassfish.web.util.HtmlEntityEncoder

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.