当前位置: 首页>>代码示例>>Java>>正文


Java SecurityUtil.filter方法代码示例

本文整理汇总了Java中org.apache.jasper.security.SecurityUtil.filter方法的典型用法代码示例。如果您正苦于以下问题:Java SecurityUtil.filter方法的具体用法?Java SecurityUtil.filter怎么用?Java SecurityUtil.filter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.jasper.security.SecurityUtil的用法示例。


在下文中一共展示了SecurityUtil.filter方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleMissingResource

import org.apache.jasper.security.SecurityUtil; //导入方法依赖的package包/类
private void handleMissingResource(HttpServletRequest request,
        HttpServletResponse response, String jspUri)
        throws ServletException, IOException {

    String includeRequestUri =
        (String)request.getAttribute(RequestDispatcher.INCLUDE_REQUEST_URI);

    if (includeRequestUri != null) {
        // This file was included. Throw an exception as
        // a response.sendError() will be ignored
        String msg =
            Localizer.getMessage("jsp.error.file.not.found",jspUri);
        // Strictly, filtering this is an application
        // responsibility but just in case...
        throw new ServletException(SecurityUtil.filter(msg));
    } else {
        try {
            response.sendError(HttpServletResponse.SC_NOT_FOUND,
                    request.getRequestURI());
        } catch (IllegalStateException ise) {
            log.error(Localizer.getMessage("jsp.error.file.not.found",
                    jspUri));
        }
    }
    return;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:27,代码来源:JspServlet.java

示例2: handleMissingResource

import org.apache.jasper.security.SecurityUtil; //导入方法依赖的package包/类
private void handleMissingResource(HttpServletRequest request, HttpServletResponse response, String jspUri)
		throws ServletException, IOException {

	String includeRequestUri = (String) request.getAttribute(RequestDispatcher.INCLUDE_REQUEST_URI);

	if (includeRequestUri != null) {
		// This file was included. Throw an exception as
		// a response.sendError() will be ignored
		String msg = Localizer.getMessage("jsp.error.file.not.found", jspUri);
		// Strictly, filtering this is an application
		// responsibility but just in case...
		throw new ServletException(SecurityUtil.filter(msg));
	} else {
		try {
			response.sendError(HttpServletResponse.SC_NOT_FOUND, request.getRequestURI());
		} catch (IllegalStateException ise) {
			log.error(Localizer.getMessage("jsp.error.file.not.found", jspUri));
		}
	}
	return;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:22,代码来源:JspServlet.java

示例3: handleMissingResource

import org.apache.jasper.security.SecurityUtil; //导入方法依赖的package包/类
private void handleMissingResource(HttpServletRequest request,
		HttpServletResponse response, String jspUri)
		throws ServletException, IOException {
	String includeRequestUri = (String) request.getAttribute("javax.servlet.include.request_uri");

	if (includeRequestUri != null) {
		String msg = Localizer.getMessage("jsp.error.file.not.found",jspUri);
		throw new ServletException(SecurityUtil.filter(msg));
	}
	try {
		throw new ServletException("JSP not found : "+jspUri);
	} catch (IllegalStateException ise) {
		logger.error(Localizer.getMessage("jsp.error.file.not.found",	jspUri));
	}
}
 
开发者ID:balancebeam,项目名称:puzzle,代码行数:16,代码来源:JspDispatcherFilter.java

示例4: handleMissingResource

import org.apache.jasper.security.SecurityUtil; //导入方法依赖的package包/类
private void handleMissingResource(HttpServletRequest request, HttpServletResponse response, String jspUri)
        throws ServletException, IOException {
    String includeRequestUri =
            (String) request.getAttribute("javax.servlet.include.request_uri");
    if (includeRequestUri != null) {
        String msg = Localizer.getMessage("jsp.error.file.not.found", jspUri);
        throw new ServletException(SecurityUtil.filter(msg));
    } else {
        try {
            response.sendError(HttpServletResponse.SC_NOT_FOUND, request.getRequestURI());
        } catch (IllegalStateException e) {
            log.error(Localizer.getMessage("jsp.error.file.not.found", jspUri));
        }
    }
}
 
开发者ID:kawasima,项目名称:sa-compojure,代码行数:16,代码来源:JspHandler.java

示例5: serviceJspFile

import org.apache.jasper.security.SecurityUtil; //导入方法依赖的package包/类
private void serviceJspFile(HttpServletRequest request,
                            HttpServletResponse response, String jspUri,
                            Throwable exception, boolean precompile)
    throws ServletException, IOException {

    JspServletWrapper wrapper =
        (JspServletWrapper) rctxt.getWrapper(jspUri);
    if (wrapper == null) {
        synchronized(this) {
            wrapper = (JspServletWrapper) rctxt.getWrapper(jspUri);
            if (wrapper == null) {
                // Check if the requested JSP page exists, to avoid
                // creating unnecessary directories and files.
                if (null == context.getResource(jspUri)) {
                    String includeRequestUri = (String)
                    request.getAttribute(
                            "javax.servlet.include.request_uri");
                    if (includeRequestUri != null) {
                        // This file was included. Throw an exception as
                        // a response.sendError() will be ignored
                        String msg = Localizer.getMessage("jsp.error.file.not.found", jspUri);
                        // Strictly, filtering this is an application
                        // responsibility but just in case...
                        throw new ServletException(SecurityUtil.filter(msg));
                    } else {
                        try {
                            response.sendError(
                                    HttpServletResponse.SC_NOT_FOUND,
                                    request.getRequestURI());
                        } catch (IllegalStateException ise) {
                            log.error(Localizer.getMessage(
                                    "jsp.error.file.not.found",
                                    jspUri));
                        }
                    }
                    return;
                }
                boolean isErrorPage = exception != null;
                wrapper = new JspServletWrapper(config, options, jspUri,
                                                isErrorPage, rctxt);
                rctxt.addWrapper(jspUri,wrapper);
            }
        }
    }

    wrapper.service(request, response, precompile);

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:49,代码来源:JspServlet.java


注:本文中的org.apache.jasper.security.SecurityUtil.filter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。