From: markt Date: Thu, 27 Nov 2008 21:40:05 +0000 (+0000) Subject: Add doPrivileged block required for Servlet TCK to pass when running with a security... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=da4ea85c10138f9c7a3a5bc126f382ef2b1af0b4;p=tomcat7.0 Add doPrivileged block required for Servlet TCK to pass when running with a security manager git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@721286 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/jasper/runtime/JspFactoryImpl.java b/java/org/apache/jasper/runtime/JspFactoryImpl.java index f06a49d54..f9852b3f9 100644 --- a/java/org/apache/jasper/runtime/JspFactoryImpl.java +++ b/java/org/apache/jasper/runtime/JspFactoryImpl.java @@ -196,7 +196,17 @@ public class JspFactoryImpl extends JspFactory { } - public JspApplicationContext getJspApplicationContext(ServletContext context) { - return JspApplicationContextImpl.getInstance(context); + public JspApplicationContext getJspApplicationContext( + final ServletContext context) { + if (Constants.IS_SECURITY_ENABLED) { + return AccessController.doPrivileged( + new PrivilegedAction() { + public JspApplicationContext run() { + return JspApplicationContextImpl.getInstance(context); + } + }); + } else { + return JspApplicationContextImpl.getInstance(context); + } } }