本文整理汇总了Java中org.apache.jasper.compiler.JspUtil.escapeXml方法的典型用法代码示例。如果您正苦于以下问题:Java JspUtil.escapeXml方法的具体用法?Java JspUtil.escapeXml怎么用?Java JspUtil.escapeXml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.jasper.compiler.JspUtil
的用法示例。
在下文中一共展示了JspUtil.escapeXml方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: serviceJspFile
import org.apache.jasper.compiler.JspUtil; //导入方法依赖的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)
&& !options.getUsePrecompiled()) {
String includeRequestUri = (String)
request.getAttribute("javax.servlet.include.request_uri");
if (includeRequestUri != null) {
// Missing JSP resource has been the target of a
// RequestDispatcher.include().
// Throw an exception (rather than returning a
// 404 response error code), because any call to
// response.sendError() must be ignored by the
// servlet engine when issued from within an
// included resource (as per the Servlet spec).
throw new FileNotFoundException(
JspUtil.escapeXml(jspUri));
}
response.sendError(HttpServletResponse.SC_NOT_FOUND);
log.severe(Localizer.getMessage(
"jsp.error.file.not.found",
context.getRealPath(jspUri)));
return;
}
boolean isErrorPage = exception != null;
wrapper = new JspServletWrapper(config, options, jspUri,
isErrorPage, rctxt);
rctxt.addWrapper(jspUri,wrapper);
}
}
}
wrapper.service(request, response, precompile);
}
示例2: generateHtmlReport
import org.apache.jasper.compiler.JspUtil; //导入方法依赖的package包/类
/**
* @return a short HTML snippet suitable for describing the current
* status of the stream
*/
public String generateHtmlReport() {
return JspUtil.escapeXml(this.toString());
}