本文整理汇总了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;
}
示例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;
}
示例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));
}
}
示例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));
}
}
}
示例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);
}