PageRenderTime 23ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 1ms

/projects/tomcat-7.0.2/java/org/apache/catalina/core/StandardContext.java

https://gitlab.com/essere.lab.public/qualitas.class-corpus
Java | 1854 lines | 681 code | 455 blank | 718 comment | 38 complexity | 159a8a46e1de1f93566e8e15d895f7c6 MD5 | raw file
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. package org.apache.catalina.core;
  18. import java.io.BufferedReader;
  19. import java.io.File;
  20. import java.io.IOException;
  21. import java.io.InputStream;
  22. import java.io.InputStreamReader;
  23. import java.net.URL;
  24. import java.util.ArrayList;
  25. import java.util.Arrays;
  26. import java.util.HashMap;
  27. import java.util.Hashtable;
  28. import java.util.Iterator;
  29. import java.util.LinkedHashMap;
  30. import java.util.List;
  31. import java.util.Map;
  32. import java.util.Set;
  33. import java.util.Stack;
  34. import java.util.TreeMap;
  35. import javax.management.ListenerNotFoundException;
  36. import javax.management.MBeanNotificationInfo;
  37. import javax.management.Notification;
  38. import javax.management.NotificationBroadcasterSupport;
  39. import javax.management.NotificationEmitter;
  40. import javax.management.NotificationFilter;
  41. import javax.management.NotificationListener;
  42. import javax.management.ObjectName;
  43. import javax.naming.NamingException;
  44. import javax.naming.directory.DirContext;
  45. import javax.servlet.FilterConfig;
  46. import javax.servlet.ServletContainerInitializer;
  47. import javax.servlet.ServletContext;
  48. import javax.servlet.ServletContextAttributeListener;
  49. import javax.servlet.ServletContextEvent;
  50. import javax.servlet.ServletContextListener;
  51. import javax.servlet.ServletException;
  52. import javax.servlet.ServletRequestAttributeListener;
  53. import javax.servlet.ServletRequestListener;
  54. import javax.servlet.descriptor.JspConfigDescriptor;
  55. import javax.servlet.http.HttpSessionAttributeListener;
  56. import javax.servlet.http.HttpSessionListener;
  57. import org.apache.catalina.Authenticator;
  58. import org.apache.catalina.Container;
  59. import org.apache.catalina.ContainerListener;
  60. import org.apache.catalina.Context;
  61. import org.apache.catalina.Engine;
  62. import org.apache.catalina.Globals;
  63. import org.apache.catalina.Host;
  64. import org.apache.catalina.InstanceListener;
  65. import org.apache.catalina.Lifecycle;
  66. import org.apache.catalina.LifecycleException;
  67. import org.apache.catalina.LifecycleListener;
  68. import org.apache.catalina.LifecycleState;
  69. import org.apache.catalina.Loader;
  70. import org.apache.catalina.Manager;
  71. import org.apache.catalina.Pipeline;
  72. import org.apache.catalina.Valve;
  73. import org.apache.catalina.Wrapper;
  74. import org.apache.catalina.deploy.ApplicationParameter;
  75. import org.apache.catalina.deploy.ErrorPage;
  76. import org.apache.catalina.deploy.FilterDef;
  77. import org.apache.catalina.deploy.FilterMap;
  78. import org.apache.catalina.deploy.Injectable;
  79. import org.apache.catalina.deploy.InjectionTarget;
  80. import org.apache.catalina.deploy.LoginConfig;
  81. import org.apache.catalina.deploy.MessageDestination;
  82. import org.apache.catalina.deploy.MessageDestinationRef;
  83. import org.apache.catalina.deploy.NamingResources;
  84. import org.apache.catalina.deploy.SecurityCollection;
  85. import org.apache.catalina.deploy.SecurityConstraint;
  86. import org.apache.catalina.loader.WebappLoader;
  87. import org.apache.catalina.session.StandardManager;
  88. import org.apache.catalina.startup.TldConfig;
  89. import org.apache.catalina.util.CharsetMapper;
  90. import org.apache.catalina.util.ExtensionValidator;
  91. import org.apache.catalina.util.LifecycleBase;
  92. import org.apache.catalina.util.RequestUtil;
  93. import org.apache.catalina.util.URLEncoder;
  94. import org.apache.juli.logging.Log;
  95. import org.apache.juli.logging.LogFactory;
  96. import org.apache.naming.ContextBindings;
  97. import org.apache.naming.resources.BaseDirContext;
  98. import org.apache.naming.resources.DirContextURLStreamHandler;
  99. import org.apache.naming.resources.FileDirContext;
  100. import org.apache.naming.resources.ProxyDirContext;
  101. import org.apache.naming.resources.WARDirContext;
  102. import org.apache.tomcat.InstanceManager;
  103. import org.apache.tomcat.JarScanner;
  104. import org.apache.tomcat.util.modeler.Registry;
  105. import org.apache.tomcat.util.scan.StandardJarScanner;
  106. /**
  107. * Standard implementation of the <b>Context</b> interface. Each
  108. * child container must be a Wrapper implementation to process the
  109. * requests directed to a particular servlet.
  110. *
  111. * @author Craig R. McClanahan
  112. * @author Remy Maucherat
  113. * @version $Id: StandardContext.java 978840 2010-07-24 10:17:45Z markt $
  114. */
  115. public class StandardContext extends ContainerBase
  116. implements Context, NotificationEmitter {
  117. private static final Log log = LogFactory.getLog(StandardContext.class);
  118. // ----------------------------------------------------------- Constructors
  119. /**
  120. * Create a new StandardContext component with the default basic Valve.
  121. */
  122. public StandardContext() {
  123. super();
  124. pipeline.setBasic(new StandardContextValve());
  125. broadcaster = new NotificationBroadcasterSupport();
  126. }
  127. // ----------------------------------------------------- Class Variables
  128. /**
  129. * The descriptive information string for this implementation.
  130. */
  131. private static final String info =
  132. "org.apache.catalina.core.StandardContext/1.0";
  133. /**
  134. * Array containing the safe characters set.
  135. */
  136. protected static URLEncoder urlEncoder;
  137. /**
  138. * GMT timezone - all HTTP dates are on GMT
  139. */
  140. static {
  141. urlEncoder = new URLEncoder();
  142. urlEncoder.addSafeCharacter('~');
  143. urlEncoder.addSafeCharacter('-');
  144. urlEncoder.addSafeCharacter('_');
  145. urlEncoder.addSafeCharacter('.');
  146. urlEncoder.addSafeCharacter('*');
  147. urlEncoder.addSafeCharacter('/');
  148. }
  149. // ----------------------------------------------------- Instance Variables
  150. /**
  151. * The alternate deployment descriptor name.
  152. */
  153. private String altDDName = null;
  154. /**
  155. * Lifecycle provider.
  156. */
  157. private InstanceManager instanceManager = null;
  158. /**
  159. * Associated host name.
  160. */
  161. private String hostName;
  162. /**
  163. * The antiJARLocking flag for this Context.
  164. */
  165. private boolean antiJARLocking = false;
  166. /**
  167. * The antiResourceLocking flag for this Context.
  168. */
  169. private boolean antiResourceLocking = false;
  170. /**
  171. * The set of application listener class names configured for this
  172. * application, in the order they were encountered in the web.xml file.
  173. */
  174. private String applicationListeners[] = new String[0];
  175. private final Object applicationListenersLock = new Object();
  176. /**
  177. * The set of instantiated application event listener objects</code>.
  178. */
  179. private Object applicationEventListenersObjects[] =
  180. new Object[0];
  181. /**
  182. * The set of instantiated application lifecycle listener objects</code>.
  183. */
  184. private Object applicationLifecycleListenersObjects[] =
  185. new Object[0];
  186. /**
  187. * The ordered set of ServletContainerInitializers for this web application.
  188. */
  189. private Map<ServletContainerInitializer,Set<Class<?>>> initializers =
  190. new LinkedHashMap<ServletContainerInitializer,Set<Class<?>>>();
  191. /**
  192. * The set of application parameters defined for this application.
  193. */
  194. private ApplicationParameter applicationParameters[] =
  195. new ApplicationParameter[0];
  196. private final Object applicationParametersLock = new Object();
  197. /**
  198. * The broadcaster that sends j2ee notifications.
  199. */
  200. private NotificationBroadcasterSupport broadcaster = null;
  201. /**
  202. * The Locale to character set mapper for this application.
  203. */
  204. private CharsetMapper charsetMapper = null;
  205. /**
  206. * The Java class name of the CharsetMapper class to be created.
  207. */
  208. private String charsetMapperClass =
  209. "org.apache.catalina.util.CharsetMapper";
  210. /**
  211. * The URL of the XML descriptor for this context.
  212. */
  213. private URL configFile = null;
  214. /**
  215. * The "correctly configured" flag for this Context.
  216. */
  217. private boolean configured = false;
  218. /**
  219. * The security constraints for this web application.
  220. */
  221. private SecurityConstraint constraints[] = new SecurityConstraint[0];
  222. private final Object constraintsLock = new Object();
  223. /**
  224. * The ServletContext implementation associated with this Context.
  225. */
  226. protected ApplicationContext context = null;
  227. /**
  228. * Compiler classpath to use.
  229. */
  230. private String compilerClasspath = null;
  231. /**
  232. * Should we attempt to use cookies for session id communication?
  233. */
  234. private boolean cookies = true;
  235. /**
  236. * Should we allow the <code>ServletContext.getContext()</code> method
  237. * to access the context of other web applications in this server?
  238. */
  239. private boolean crossContext = false;
  240. /**
  241. * Encoded path.
  242. */
  243. private String encodedPath = null;
  244. /**
  245. * The "follow standard delegation model" flag that will be used to
  246. * configure our ClassLoader.
  247. */
  248. private boolean delegate = false;
  249. /**
  250. * The display name of this web application.
  251. */
  252. private String displayName = null;
  253. /**
  254. * Override the default context xml location.
  255. */
  256. private String defaultContextXml;
  257. /**
  258. * Override the default web xml location.
  259. */
  260. private String defaultWebXml;
  261. /**
  262. * The distributable flag for this web application.
  263. */
  264. private boolean distributable = false;
  265. /**
  266. * The document root for this web application.
  267. */
  268. private String docBase = null;
  269. /**
  270. * The exception pages for this web application, keyed by fully qualified
  271. * class name of the Java exception.
  272. */
  273. private HashMap<String, ErrorPage> exceptionPages =
  274. new HashMap<String, ErrorPage>();
  275. /**
  276. * The set of filter configurations (and associated filter instances) we
  277. * have initialized, keyed by filter name.
  278. */
  279. private HashMap<String, ApplicationFilterConfig> filterConfigs =
  280. new HashMap<String, ApplicationFilterConfig>();
  281. /**
  282. * The set of filter definitions for this application, keyed by
  283. * filter name.
  284. */
  285. private HashMap<String, FilterDef> filterDefs =
  286. new HashMap<String, FilterDef>();
  287. /**
  288. * The set of filter mappings for this application, in the order
  289. * they were defined in the deployment descriptor with additional mappings
  290. * added via the {@link ServletContext} possibly both before and after those
  291. * defined in the deployment descriptor.
  292. */
  293. private final ContextFilterMaps filterMaps = new ContextFilterMaps();
  294. /**
  295. * Ignore annotations.
  296. */
  297. private boolean ignoreAnnotations = false;
  298. /**
  299. * The set of classnames of InstanceListeners that will be added
  300. * to each newly created Wrapper by <code>createWrapper()</code>.
  301. */
  302. private String instanceListeners[] = new String[0];
  303. private final Object instanceListenersLock = new Object();
  304. /**
  305. * The login configuration descriptor for this web application.
  306. */
  307. private LoginConfig loginConfig = null;
  308. /**
  309. * The mapper associated with this context.
  310. */
  311. private org.apache.tomcat.util.http.mapper.Mapper mapper =
  312. new org.apache.tomcat.util.http.mapper.Mapper();
  313. /**
  314. * The naming context listener for this web application.
  315. */
  316. private NamingContextListener namingContextListener = null;
  317. /**
  318. * The naming resources for this web application.
  319. */
  320. private NamingResources namingResources = null;
  321. private ObjectName onameNamingResources;
  322. /**
  323. * The message destinations for this web application.
  324. */
  325. private HashMap<String, MessageDestination> messageDestinations =
  326. new HashMap<String, MessageDestination>();
  327. /**
  328. * The MIME mappings for this web application, keyed by extension.
  329. */
  330. private HashMap<String, String> mimeMappings =
  331. new HashMap<String, String>();
  332. /**
  333. * Special case: error page for status 200.
  334. */
  335. private ErrorPage okErrorPage = null;
  336. /**
  337. * The context initialization parameters for this web application,
  338. * keyed by name.
  339. */
  340. private HashMap<String, String> parameters = new HashMap<String, String>();
  341. /**
  342. * The request processing pause flag (while reloading occurs)
  343. */
  344. private boolean paused = false;
  345. /**
  346. * The public identifier of the DTD for the web application deployment
  347. * descriptor version we are currently parsing. This is used to support
  348. * relaxed validation rules when processing version 2.2 web.xml files.
  349. */
  350. private String publicId = null;
  351. /**
  352. * The reloadable flag for this web application.
  353. */
  354. private boolean reloadable = false;
  355. /**
  356. * Unpack WAR property.
  357. */
  358. private boolean unpackWAR = true;
  359. /**
  360. * The default context override flag for this web application.
  361. */
  362. private boolean override = false;
  363. /**
  364. * The original document root for this web application.
  365. */
  366. private String originalDocBase = null;
  367. /**
  368. * The privileged flag for this web application.
  369. */
  370. private boolean privileged = false;
  371. /**
  372. * Should the next call to <code>addWelcomeFile()</code> cause replacement
  373. * of any existing welcome files? This will be set before processing the
  374. * web application's deployment descriptor, so that application specified
  375. * choices <strong>replace</strong>, rather than append to, those defined
  376. * in the global descriptor.
  377. */
  378. private boolean replaceWelcomeFiles = false;
  379. /**
  380. * The security role mappings for this application, keyed by role
  381. * name (as used within the application).
  382. */
  383. private HashMap<String, String> roleMappings =
  384. new HashMap<String, String>();
  385. /**
  386. * The security roles for this application, keyed by role name.
  387. */
  388. private String securityRoles[] = new String[0];
  389. private final Object securityRolesLock = new Object();
  390. /**
  391. * The servlet mappings for this web application, keyed by
  392. * matching pattern.
  393. */
  394. private HashMap<String, String> servletMappings =
  395. new HashMap<String, String>();
  396. private final Object servletMappingsLock = new Object();
  397. /**
  398. * The session timeout (in minutes) for this web application.
  399. */
  400. private int sessionTimeout = 30;
  401. /**
  402. * The notification sequence number.
  403. */
  404. private long sequenceNumber = 0;
  405. /**
  406. * The status code error pages for this web application, keyed by
  407. * HTTP status code (as an Integer).
  408. */
  409. private HashMap<Integer, ErrorPage> statusPages =
  410. new HashMap<Integer, ErrorPage>();
  411. /**
  412. * Set flag to true to cause the system.out and system.err to be redirected
  413. * to the logger when executing a servlet.
  414. */
  415. private boolean swallowOutput = false;
  416. /**
  417. * Amount of ms that the container will wait for servlets to unload.
  418. */
  419. private long unloadDelay = 2000;
  420. /**
  421. * The watched resources for this application.
  422. */
  423. private String watchedResources[] = new String[0];
  424. private final Object watchedResourcesLock = new Object();
  425. /**
  426. * The welcome files for this application.
  427. */
  428. private String welcomeFiles[] = new String[0];
  429. private final Object welcomeFilesLock = new Object();
  430. /**
  431. * The set of classnames of LifecycleListeners that will be added
  432. * to each newly created Wrapper by <code>createWrapper()</code>.
  433. */
  434. private String wrapperLifecycles[] = new String[0];
  435. private final Object wrapperLifecyclesLock = new Object();
  436. /**
  437. * The set of classnames of ContainerListeners that will be added
  438. * to each newly created Wrapper by <code>createWrapper()</code>.
  439. */
  440. private String wrapperListeners[] = new String[0];
  441. private final Object wrapperListenersLock = new Object();
  442. /**
  443. * The pathname to the work directory for this context (relative to
  444. * the server's home if not absolute).
  445. */
  446. private String workDir = null;
  447. /**
  448. * Java class name of the Wrapper class implementation we use.
  449. */
  450. private String wrapperClassName = StandardWrapper.class.getName();
  451. private Class<?> wrapperClass = null;
  452. /**
  453. * JNDI use flag.
  454. */
  455. private boolean useNaming = true;
  456. /**
  457. * Filesystem based flag.
  458. */
  459. private boolean filesystemBased = false;
  460. /**
  461. * Name of the associated naming context.
  462. */
  463. private String namingContextName = null;
  464. /**
  465. * Caching allowed flag.
  466. */
  467. private boolean cachingAllowed = true;
  468. /**
  469. * Allow linking.
  470. */
  471. protected boolean allowLinking = false;
  472. /**
  473. * Cache max size in KB.
  474. */
  475. protected int cacheMaxSize = 10240; // 10 MB
  476. /**
  477. * Cache object max size in KB.
  478. */
  479. protected int cacheObjectMaxSize = 512; // 512K
  480. /**
  481. * Cache TTL in ms.
  482. */
  483. protected int cacheTTL = 5000;
  484. /**
  485. * List of resource aliases.
  486. */
  487. private String aliases = null;
  488. /**
  489. * Non proxied resources.
  490. */
  491. private DirContext webappResources = null;
  492. private long startupTime;
  493. private long startTime;
  494. private long tldScanTime;
  495. /**
  496. * Name of the engine. If null, the domain is used.
  497. */
  498. private String j2EEApplication="none";
  499. private String j2EEServer="none";
  500. /**
  501. * Attribute value used to turn on/off XML validation
  502. */
  503. private boolean webXmlValidation = Globals.STRICT_SERVLET_COMPLIANCE;
  504. /**
  505. * Attribute value used to turn on/off XML namespace validation
  506. */
  507. private boolean webXmlNamespaceAware = Globals.STRICT_SERVLET_COMPLIANCE;
  508. /**
  509. * Attribute value used to turn on/off TLD processing
  510. */
  511. private boolean processTlds = true;
  512. /**
  513. * Attribute value used to turn on/off XML validation
  514. */
  515. private boolean tldValidation = Globals.STRICT_SERVLET_COMPLIANCE;
  516. /**
  517. * Attribute value used to turn on/off TLD XML namespace validation
  518. */
  519. private boolean tldNamespaceAware = Globals.STRICT_SERVLET_COMPLIANCE;
  520. /**
  521. * Should we save the configuration.
  522. */
  523. private boolean saveConfig = true;
  524. /**
  525. * The name to use for session cookies. <code>null</code> indicates that
  526. * the name is controlled by the application.
  527. */
  528. private String sessionCookieName;
  529. /**
  530. * The flag that indicates that session cookies should use HttpOnly
  531. */
  532. private boolean useHttpOnly = true;
  533. /**
  534. * The domain to use for session cookies. <code>null</code> indicates that
  535. * the domain is controlled by the application.
  536. */
  537. private String sessionCookieDomain;
  538. /**
  539. * The path to use for session cookies. <code>null</code> indicates that
  540. * the path is controlled by the application.
  541. */
  542. private String sessionCookiePath;
  543. /**
  544. * The Jar scanner to use to search for Jars that might contain
  545. * configuration information such as TLDs or web-fragment.xml files.
  546. */
  547. private JarScanner jarScanner = null;
  548. /**
  549. * Should Tomcat attempt to null out any static or final fields from loaded
  550. * classes when a web application is stopped as a work around for apparent
  551. * garbage collection bugs and application coding errors? There have been
  552. * some issues reported with log4j when this option is true. Applications
  553. * without memory leaks using recent JVMs should operate correctly with this
  554. * option set to <code>false</code>. If not specified, the default value of
  555. * <code>false</code> will be used.
  556. */
  557. private boolean clearReferencesStatic = false;
  558. /**
  559. * Should Tomcat attempt to terminate threads that have been started by the
  560. * web application? Stopping threads is performed via the deprecated (for
  561. * good reason) <code>Thread.stop()</code> method and is likely to result in
  562. * instability. As such, enabling this should be viewed as an option of last
  563. * resort in a development environment and is not recommended in a
  564. * production environment. If not specified, the default value of
  565. * <code>false</code> will be used.
  566. */
  567. private boolean clearReferencesStopThreads = false;
  568. /**
  569. * Should Tomcat attempt to terminate any {@link java.util.TimerThread}s
  570. * that have been started by the web application? If not specified, the
  571. * default value of <code>false</code> will be used.
  572. */
  573. private boolean clearReferencesStopTimerThreads = false;
  574. /**
  575. * Should Tomcat attempt to clear any ThreadLocal objects that are instances
  576. * of classes loaded by this class loader. Failure to remove any such
  577. * objects will result in a memory leak on web application stop, undeploy or
  578. * reload. It is disabled by default since the clearing of the ThreadLocal
  579. * objects is not performed in a thread-safe manner.
  580. */
  581. private boolean clearReferencesThreadLocals = false;
  582. /**
  583. * Should the effective web.xml be logged when the context starts?
  584. */
  585. private boolean logEffectiveWebXml = false;
  586. private int effectiveMajorVersion = 3;
  587. private int effectiveMinorVersion = 0;
  588. private JspConfigDescriptor jspConfigDescriptor =
  589. new ApplicationJspConfigDescriptor();
  590. // ----------------------------------------------------- Context Properties
  591. public int getEffectiveMajorVersion() {
  592. return effectiveMajorVersion;
  593. }
  594. public void setEffectiveMajorVersion(int effectiveMajorVersion) {
  595. this.effectiveMajorVersion = effectiveMajorVersion;
  596. }
  597. public int getEffectiveMinorVersion() {
  598. return effectiveMinorVersion;
  599. }
  600. public void setEffectiveMinorVersion(int effectiveMinorVersion) {
  601. this.effectiveMinorVersion = effectiveMinorVersion;
  602. }
  603. public void setLogEffectiveWebXml(boolean logEffectiveWebXml) {
  604. this.logEffectiveWebXml = logEffectiveWebXml;
  605. }
  606. public boolean getLogEffectiveWebXml() {
  607. return logEffectiveWebXml;
  608. }
  609. public Authenticator getAuthenticator() {
  610. if (this instanceof Authenticator)
  611. return (Authenticator) this;
  612. Pipeline pipeline = getPipeline();
  613. if (pipeline != null) {
  614. Valve basic = pipeline.getBasic();
  615. if ((basic != null) && (basic instanceof Authenticator))
  616. return (Authenticator) basic;
  617. Valve valves[] = pipeline.getValves();
  618. for (int i = 0; i < valves.length; i++) {
  619. if (valves[i] instanceof Authenticator)
  620. return (Authenticator) valves[i];
  621. }
  622. }
  623. return null;
  624. }
  625. public JarScanner getJarScanner() {
  626. if (jarScanner == null) {
  627. jarScanner = new StandardJarScanner();
  628. }
  629. return jarScanner;
  630. }
  631. public void setJarScanner(JarScanner jarScanner) {
  632. this.jarScanner = jarScanner;
  633. }
  634. public InstanceManager getInstanceManager() {
  635. return instanceManager;
  636. }
  637. public void setInstanceManager(InstanceManager instanceManager) {
  638. this.instanceManager = instanceManager;
  639. }
  640. public String getEncodedPath() {
  641. return encodedPath;
  642. }
  643. @Override
  644. public void setName( String name ) {
  645. super.setName( name );
  646. encodedPath = urlEncoder.encode(name);
  647. }
  648. /**
  649. * Is caching allowed ?
  650. */
  651. public boolean isCachingAllowed() {
  652. return cachingAllowed;
  653. }
  654. /**
  655. * Set caching allowed flag.
  656. */
  657. public void setCachingAllowed(boolean cachingAllowed) {
  658. this.cachingAllowed = cachingAllowed;
  659. }
  660. /**
  661. * Set allow linking.
  662. */
  663. public void setAllowLinking(boolean allowLinking) {
  664. this.allowLinking = allowLinking;
  665. }
  666. /**
  667. * Is linking allowed.
  668. */
  669. public boolean isAllowLinking() {
  670. return allowLinking;
  671. }
  672. /**
  673. * Set cache TTL.
  674. */
  675. public void setCacheTTL(int cacheTTL) {
  676. this.cacheTTL = cacheTTL;
  677. }
  678. /**
  679. * Get cache TTL.
  680. */
  681. public int getCacheTTL() {
  682. return cacheTTL;
  683. }
  684. /**
  685. * Return the maximum size of the cache in KB.
  686. */
  687. public int getCacheMaxSize() {
  688. return cacheMaxSize;
  689. }
  690. /**
  691. * Set the maximum size of the cache in KB.
  692. */
  693. public void setCacheMaxSize(int cacheMaxSize) {
  694. this.cacheMaxSize = cacheMaxSize;
  695. }
  696. /**
  697. * Return the maximum size of objects to be cached in KB.
  698. */
  699. public int getCacheObjectMaxSize() {
  700. return cacheObjectMaxSize;
  701. }
  702. /**
  703. * Set the maximum size of objects to be placed the cache in KB.
  704. */
  705. public void setCacheObjectMaxSize(int cacheObjectMaxSize) {
  706. this.cacheObjectMaxSize = cacheObjectMaxSize;
  707. }
  708. /**
  709. * Return the list of resource aliases.
  710. */
  711. public String getAliases() {
  712. return this.aliases;
  713. }
  714. /**
  715. * Add a URL for a JAR that contains static resources in a
  716. * META-INF/resources directory that should be included in the static
  717. * resources for this context.
  718. */
  719. public void addResourceJarUrl(URL url) {
  720. if (webappResources instanceof BaseDirContext) {
  721. ((BaseDirContext) webappResources).addResourcesJar(url);
  722. } else {
  723. log.error(sm.getString("standardContext.noResourceJar", url,
  724. getPath()));
  725. }
  726. }
  727. /**
  728. * Set the current alias configuration. The list of aliases should be of the
  729. * form "/aliasPath1=docBase1,/aliasPath2=docBase2" where aliasPathN must
  730. * include a leading '/' and docBaseN must be an absolute path to either a
  731. * .war file or a directory.
  732. */
  733. public void setAliases(String aliases) {
  734. this.aliases = aliases;
  735. }
  736. /**
  737. * Add a ServletContainerInitializer instance to this web application.
  738. *
  739. * @param sci The instance to add
  740. * @param classes The classes in which the initializer expressed an
  741. * interest
  742. */
  743. public void addServletContainerInitializer(
  744. ServletContainerInitializer sci, Set<Class<?>> classes) {
  745. initializers.put(sci, classes);
  746. }
  747. /**
  748. * Return the "follow standard delegation model" flag used to configure
  749. * our ClassLoader.
  750. */
  751. public boolean getDelegate() {
  752. return (this.delegate);
  753. }
  754. /**
  755. * Set the "follow standard delegation model" flag used to configure
  756. * our ClassLoader.
  757. *
  758. * @param delegate The new flag
  759. */
  760. public void setDelegate(boolean delegate) {
  761. boolean oldDelegate = this.delegate;
  762. this.delegate = delegate;
  763. support.firePropertyChange("delegate", oldDelegate,
  764. this.delegate);
  765. }
  766. /**
  767. * Returns true if the internal naming support is used.
  768. */
  769. public boolean isUseNaming() {
  770. return (useNaming);
  771. }
  772. /**
  773. * Enables or disables naming.
  774. */
  775. public void setUseNaming(boolean useNaming) {
  776. this.useNaming = useNaming;
  777. }
  778. /**
  779. * Returns true if the resources associated with this context are
  780. * filesystem based.
  781. */
  782. public boolean isFilesystemBased() {
  783. return (filesystemBased);
  784. }
  785. /**
  786. * Return the set of initialized application event listener objects,
  787. * in the order they were specified in the web application deployment
  788. * descriptor, for this application.
  789. *
  790. * @exception IllegalStateException if this method is called before
  791. * this application has started, or after it has been stopped
  792. */
  793. public Object[] getApplicationEventListeners() {
  794. return (applicationEventListenersObjects);
  795. }
  796. /**
  797. * Store the set of initialized application event listener objects,
  798. * in the order they were specified in the web application deployment
  799. * descriptor, for this application.
  800. *
  801. * @param listeners The set of instantiated listener objects.
  802. */
  803. public void setApplicationEventListeners(Object listeners[]) {
  804. applicationEventListenersObjects = listeners;
  805. }
  806. /**
  807. * Add a listener to the end of the list of initialized application event
  808. * listeners.
  809. */
  810. public void addApplicationEventListener(Object listener) {
  811. int len = applicationEventListenersObjects.length;
  812. Object[] newListeners = Arrays.copyOf(applicationEventListenersObjects,
  813. len + 1);
  814. newListeners[len] = listener;
  815. applicationEventListenersObjects = newListeners;
  816. }
  817. /**
  818. * Return the set of initialized application lifecycle listener objects,
  819. * in the order they were specified in the web application deployment
  820. * descriptor, for this application.
  821. *
  822. * @exception IllegalStateException if this method is called before
  823. * this application has started, or after it has been stopped
  824. */
  825. public Object[] getApplicationLifecycleListeners() {
  826. return (applicationLifecycleListenersObjects);
  827. }
  828. /**
  829. * Store the set of initialized application lifecycle listener objects,
  830. * in the order they were specified in the web application deployment
  831. * descriptor, for this application.
  832. *
  833. * @param listeners The set of instantiated listener objects.
  834. */
  835. public void setApplicationLifecycleListeners(Object listeners[]) {
  836. applicationLifecycleListenersObjects = listeners;
  837. }
  838. /**
  839. * Add a listener to the end of the list of initialized application
  840. * lifecycle listeners.
  841. */
  842. public void addApplicationLifecycleListener(Object listener) {
  843. int len = applicationLifecycleListenersObjects.length;
  844. Object[] newListeners = Arrays.copyOf(
  845. applicationLifecycleListenersObjects, len + 1);
  846. newListeners[len] = listener;
  847. applicationLifecycleListenersObjects = newListeners;
  848. }
  849. /**
  850. * Return the antiJARLocking flag for this Context.
  851. */
  852. public boolean getAntiJARLocking() {
  853. return (this.antiJARLocking);
  854. }
  855. /**
  856. * Return the antiResourceLocking flag for this Context.
  857. */
  858. public boolean getAntiResourceLocking() {
  859. return (this.antiResourceLocking);
  860. }
  861. /**
  862. * Set the antiJARLocking feature for this Context.
  863. *
  864. * @param antiJARLocking The new flag value
  865. */
  866. public void setAntiJARLocking(boolean antiJARLocking) {
  867. boolean oldAntiJARLocking = this.antiJARLocking;
  868. this.antiJARLocking = antiJARLocking;
  869. support.firePropertyChange("antiJARLocking",
  870. oldAntiJARLocking,
  871. this.antiJARLocking);
  872. }
  873. /**
  874. * Set the antiResourceLocking feature for this Context.
  875. *
  876. * @param antiResourceLocking The new flag value
  877. */
  878. public void setAntiResourceLocking(boolean antiResourceLocking) {
  879. boolean oldAntiResourceLocking = this.antiResourceLocking;
  880. this.antiResourceLocking = antiResourceLocking;
  881. support.firePropertyChange("antiResourceLocking",
  882. oldAntiResourceLocking,
  883. this.antiResourceLocking);
  884. }
  885. /**
  886. * Return the application available flag for this Context.
  887. */
  888. public boolean getAvailable() {
  889. // TODO Remove this method entirely
  890. return getState().isAvailable();
  891. }
  892. /**
  893. * Return the Locale to character set mapper for this Context.
  894. */
  895. public CharsetMapper getCharsetMapper() {
  896. // Create a mapper the first time it is requested
  897. if (this.charsetMapper == null) {
  898. try {
  899. Class<?> clazz = Class.forName(charsetMapperClass);
  900. this.charsetMapper = (CharsetMapper) clazz.newInstance();
  901. } catch (Throwable t) {
  902. this.charsetMapper = new CharsetMapper();
  903. }
  904. }
  905. return (this.charsetMapper);
  906. }
  907. /**
  908. * Set the Locale to character set mapper for this Context.
  909. *
  910. * @param mapper The new mapper
  911. */
  912. public void setCharsetMapper(CharsetMapper mapper) {
  913. CharsetMapper oldCharsetMapper = this.charsetMapper;
  914. this.charsetMapper = mapper;
  915. if( mapper != null )
  916. this.charsetMapperClass= mapper.getClass().getName();
  917. support.firePropertyChange("charsetMapper", oldCharsetMapper,
  918. this.charsetMapper);
  919. }
  920. /**
  921. * Return the URL of the XML descriptor for this context.
  922. */
  923. public URL getConfigFile() {
  924. return (this.configFile);
  925. }
  926. /**
  927. * Set the URL of the XML descriptor for this context.
  928. *
  929. * @param configFile The URL of the XML descriptor for this context.
  930. */
  931. public void setConfigFile(URL configFile) {
  932. this.configFile = configFile;
  933. }
  934. /**
  935. * Return the "correctly configured" flag for this Context.
  936. */
  937. public boolean getConfigured() {
  938. return (this.configured);
  939. }
  940. /**
  941. * Set the "correctly configured" flag for this Context. This can be
  942. * set to false by startup listeners that detect a fatal configuration
  943. * error to avoid the application from being made available.
  944. *
  945. * @param configured The new correctly configured flag
  946. */
  947. public void setConfigured(boolean configured) {
  948. boolean oldConfigured = this.configured;
  949. this.configured = configured;
  950. support.firePropertyChange("configured",
  951. oldConfigured,
  952. this.configured);
  953. }
  954. /**
  955. * Return the "use cookies for session ids" flag.
  956. */
  957. public boolean getCookies() {
  958. return (this.cookies);
  959. }
  960. /**
  961. * Set the "use cookies for session ids" flag.
  962. *
  963. * @param cookies The new flag
  964. */
  965. public void setCookies(boolean cookies) {
  966. boolean oldCookies = this.cookies;
  967. this.cookies = cookies;
  968. support.firePropertyChange("cookies",
  969. oldCookies,
  970. this.cookies);
  971. }
  972. /**
  973. * Gets the name to use for session cookies. Overrides any setting that
  974. * may be specified by the application.
  975. *
  976. * @return The value of the default session cookie name or null if not
  977. * specified
  978. */
  979. public String getSessionCookieName() {
  980. return sessionCookieName;
  981. }
  982. /**
  983. * Sets the name to use for session cookies. Overrides any setting that
  984. * may be specified by the application.
  985. *
  986. * @param sessionCookieName The name to use
  987. */
  988. public void setSessionCookieName(String sessionCookieName) {
  989. String oldSessionCookieName = this.sessionCookieName;
  990. this.sessionCookieName = sessionCookieName;
  991. support.firePropertyChange("sessionCookieName",
  992. oldSessionCookieName, sessionCookieName);
  993. }
  994. /**
  995. * Gets the value of the use HttpOnly cookies for session cookies flag.
  996. *
  997. * @return <code>true</code> if the HttpOnly flag should be set on session
  998. * cookies
  999. */
  1000. public boolean getUseHttpOnly() {
  1001. return useHttpOnly;
  1002. }
  1003. /**
  1004. * Sets the use HttpOnly cookies for session cookies flag.
  1005. *
  1006. * @param useHttpOnly Set to <code>true</code> to use HttpOnly cookies
  1007. * for session cookies
  1008. */
  1009. public void setUseHttpOnly(boolean useHttpOnly) {
  1010. boolean oldUseHttpOnly = this.useHttpOnly;
  1011. this.useHttpOnly = useHttpOnly;
  1012. support.firePropertyChange("useHttpOnly",
  1013. oldUseHttpOnly,
  1014. this.useHttpOnly);
  1015. }
  1016. /**
  1017. * Gets the domain to use for session cookies. Overrides any setting that
  1018. * may be specified by the application.
  1019. *
  1020. * @return The value of the default session cookie domain or null if not
  1021. * specified
  1022. */
  1023. public String getSessionCookieDomain() {
  1024. return sessionCookieDomain;
  1025. }
  1026. /**
  1027. * Sets the domain to use for session cookies. Overrides any setting that
  1028. * may be specified by the application.
  1029. *
  1030. * @param sessionCookieDomain The domain to use
  1031. */
  1032. public void setSessionCookieDomain(String sessionCookieDomain) {
  1033. String oldSessionCookieDomain = this.sessionCookieDomain;
  1034. this.sessionCookieDomain = sessionCookieDomain;
  1035. support.firePropertyChange("sessionCookieDomain",
  1036. oldSessionCookieDomain, sessionCookieDomain);
  1037. }
  1038. /**
  1039. * Gets the path to use for session cookies. Overrides any setting that
  1040. * may be specified by the application.
  1041. *
  1042. * @return The value of the default session cookie path or null if not
  1043. * specified
  1044. */
  1045. public String getSessionCookiePath() {
  1046. return sessionCookiePath;
  1047. }
  1048. /**
  1049. * Sets the path to use for session cookies. Overrides any setting that
  1050. * may be specified by the application.
  1051. *
  1052. * @param sessionCookiePath The path to use
  1053. */
  1054. public void setSessionCookiePath(String sessionCookiePath) {
  1055. String oldSessionCookiePath = this.sessionCookiePath;
  1056. this.sessionCookiePath = sessionCookiePath;
  1057. support.firePropertyChange("sessionCookiePath",
  1058. oldSessionCookiePath, sessionCookiePath);
  1059. }
  1060. /**
  1061. * Return the "allow crossing servlet contexts" flag.
  1062. */
  1063. public boolean getCrossContext() {
  1064. return (this.crossContext);
  1065. }
  1066. /**
  1067. * Set the "allow crossing servlet contexts" flag.
  1068. *
  1069. * @param crossContext The new cross contexts flag
  1070. */
  1071. public void setCrossContext(boolean crossContext) {
  1072. boolean oldCrossContext = this.crossContext;
  1073. this.crossContext = crossContext;
  1074. support.firePropertyChange("crossContext",
  1075. oldCrossContext,
  1076. this.crossContext);
  1077. }
  1078. public String getDefaultContextXml() {
  1079. return defaultContextXml;
  1080. }
  1081. /**
  1082. * Set the location of the default context xml that will be used.
  1083. * If not absolute, it'll be made relative to the engine's base dir
  1084. * ( which defaults to catalina.base system property ).
  1085. *
  1086. * @param defaultContextXml The default web xml
  1087. */
  1088. public void setDefaultContextXml(String defaultContextXml) {
  1089. this.defaultContextXml = defaultContextXml;
  1090. }
  1091. public String getDefaultWebXml() {
  1092. return defaultWebXml;
  1093. }
  1094. /**
  1095. * Set the location of the default web xml that will be used.
  1096. * If not absolute, it'll be made relative to the engine's base dir
  1097. * ( which defaults to catalina.base system property ).
  1098. *
  1099. * @param defaultWebXml The default web xml
  1100. */
  1101. public void setDefaultWebXml(String defaultWebXml) {
  1102. this.defaultWebXml = defaultWebXml;
  1103. }
  1104. /**
  1105. * Gets the time (in milliseconds) it took to start this context.
  1106. *
  1107. * @return Time (in milliseconds) it took to start this context.
  1108. */
  1109. public long getStartupTime() {
  1110. return startupTime;
  1111. }
  1112. public void setStartupTime(long startupTime) {
  1113. this.startupTime = startupTime;
  1114. }
  1115. public long getTldScanTime() {
  1116. return tldScanTime;
  1117. }
  1118. public void setTldScanTime(long tldScanTime) {
  1119. this.tldScanTime = tldScanTime;
  1120. }
  1121. /**
  1122. * Return the display name of this web application.
  1123. */
  1124. public String getDisplayName() {
  1125. return (this.displayName);
  1126. }
  1127. /**
  1128. * Return the alternate Deployment Descriptor name.
  1129. */
  1130. public String getAltDDName(){
  1131. return altDDName;
  1132. }
  1133. /**
  1134. * Set an alternate Deployment Descriptor name.
  1135. */
  1136. public void setAltDDName(String altDDName) {
  1137. this.altDDName = altDDName;
  1138. if (context != null) {
  1139. context.setAttribute(Globals.ALT_DD_ATTR,altDDName);
  1140. }
  1141. }
  1142. /**
  1143. * Return the compiler classpath.
  1144. */
  1145. public String getCompilerClasspath(){
  1146. return compilerClasspath;
  1147. }
  1148. /**
  1149. * Set the compiler classpath.
  1150. */
  1151. public void setCompilerClasspath(String compilerClasspath) {
  1152. this.compilerClasspath = compilerClasspath;
  1153. }
  1154. /**
  1155. * Set the display name of this web application.
  1156. *
  1157. * @param displayName The new display name
  1158. */
  1159. public void setDisplayName(String displayName) {
  1160. String oldDisplayName = this.displayName;
  1161. this.displayName = displayName;
  1162. support.firePropertyChange("displayName", oldDisplayName,
  1163. this.displayName);
  1164. }
  1165. /**
  1166. * Return the distributable flag for this web application.
  1167. */
  1168. public boolean getDistributable() {
  1169. return (this.distributable);
  1170. }
  1171. /**
  1172. * Set the distributable flag for this web application.
  1173. *
  1174. * @param distributable The new distributable flag
  1175. */
  1176. public void setDistributable(boolean distributable) {
  1177. boolean oldDistributable = this.distributable;
  1178. this.distributable = distributable;
  1179. support.firePropertyChange("distributable",
  1180. oldDistributable,
  1181. this.distributable);
  1182. // Bugzilla 32866
  1183. if(getManager() != null) {
  1184. if(log.isDebugEnabled()) {
  1185. log.debug("Propagating distributable=" + distributable
  1186. + " to manager");
  1187. }
  1188. getManager().setDistributable(distributable);
  1189. }
  1190. }
  1191. /**
  1192. * Return the document root for this Context. This can be an absolute
  1193. * pathname, a relative pathname, or a URL.
  1194. */
  1195. public String getDocBase() {
  1196. return (this.docBase);
  1197. }
  1198. /**
  1199. * Set the document root for this Context. This can be an absolute
  1200. * pathname, a relative pathname, or a URL.
  1201. *
  1202. * @param docBase The new document root
  1203. */
  1204. public void setDocBase(String docBase) {
  1205. this.docBase = docBase;
  1206. }
  1207. /**
  1208. * Return descriptive information about this Container implementation and
  1209. * the corresponding version number, in the format
  1210. * <code>&lt;description&gt;/&lt;version&gt;</code>.
  1211. */
  1212. @Override
  1213. public String getInfo() {
  1214. return (info);
  1215. }
  1216. public String getJ2EEApplication() {
  1217. return j2EEApplication;
  1218. }
  1219. public void setJ2EEApplication(String j2EEApplication) {
  1220. this.j2EEApplication = j2EEApplication;
  1221. }
  1222. public String getJ2EEServer() {
  1223. return j2EEServer;
  1224. }
  1225. public void setJ2EEServer(String j2EEServer) {
  1226. this.j2EEServer = j2EEServer;
  1227. }
  1228. /**
  1229. * Set the Loader with which this Context is associated.
  1230. *
  1231. * @param loader The newly associated loader
  1232. */
  1233. @Override
  1234. public synchronized void setLoader(Loader loader) {
  1235. super.setLoader(loader);
  1236. }
  1237. /**
  1238. * Return the boolean on the annotations parsing.
  1239. */
  1240. public boolean getIgnoreAnnotations() {
  1241. return this.ignoreAnnotations;
  1242. }
  1243. /**
  1244. * Set the boolean on the annotations parsing for this web
  1245. * application.
  1246. *
  1247. * @param ignoreAnnotations The boolean on the annotations parsing
  1248. */
  1249. public void setIgnoreAnnotations(boolean ignoreAnnotations) {
  1250. boolean oldIgnoreAnnotations = this.ignoreAnnotations;
  1251. this.ignoreAnnotations = ignoreAnnotations;
  1252. support.firePropertyChange("ignoreAnnotations", oldIgnoreAnnotations,
  1253. this.ignoreAnnotations);
  1254. }
  1255. /**
  1256. * Return the login configuration descriptor for this web application.
  1257. */
  1258. public LoginConfig getLoginConfig() {
  1259. return (this.loginConfig);
  1260. }
  1261. /**
  1262. * Set the login configuration descriptor for this web application.
  1263. *
  1264. * @param config The new login configuration
  1265. */
  1266. public void setLoginConfig(LoginConfig config) {
  1267. // Validate the incoming property value
  1268. if (config == null)
  1269. throw new IllegalArgumentException
  1270. (sm.getString("standardContext.loginConfig.required"));
  1271. String loginPage = config.getLoginPage();
  1272. if ((loginPage != null) && !loginPage.startsWith("/")) {
  1273. if (isServlet22()) {
  1274. if(log.isDebugEnabled())
  1275. log.debug(sm.getString("standardContext.loginConfig.loginWarning",
  1276. loginPage));
  1277. config.setLoginPage("/" + loginPage);
  1278. } else {
  1279. throw new IllegalArgumentException
  1280. (sm.getString("standardContext.loginConfig.loginPage",
  1281. loginPage));
  1282. }
  1283. }
  1284. String errorPage = config.getErrorPage();
  1285. if ((errorPage != null) && !errorPage.startsWith("/")) {
  1286. if (isServlet22()) {
  1287. if(log.isDebugEnabled())
  1288. log.debug(sm.getString("standardContext.loginConfig.errorWarning",
  1289. errorPage));
  1290. config.setErrorPage("/" + errorPage);
  1291. } else {
  1292. throw new IllegalArgumentException
  1293. (sm.getString("standardContext.loginConfig.errorPage",
  1294. errorPage));
  1295. }
  1296. }
  1297. // Process the property setting change
  1298. LoginConfig oldLoginConfig = this.loginConfig;
  1299. this.loginConfig = config;
  1300. support.firePropertyChange("loginConfig",
  1301. oldLoginConfig, this.loginConfig);
  1302. }
  1303. /**
  1304. * Get the mapper associated with the context.
  1305. */
  1306. public org.apache.tomcat.util.http.mapper.Mapper getMapper() {
  1307. return (mapper);
  1308. }
  1309. /**
  1310. * Return the naming resources associated with this web application.
  1311. */
  1312. public NamingResources getNamingResources() {
  1313. if (namingResources == null) {
  1314. setNamingResources(new NamingResources());
  1315. }
  1316. return (namingResources);
  1317. }
  1318. /**
  1319. * Set the naming resources for this web application.
  1320. *
  1321. * @param namingResources The new naming resources
  1322. */
  1323. public void setNamingResources(NamingResources namingResources) {
  1324. // Process the property setting change
  1325. NamingResources oldNamingResources = this.namingResources;
  1326. this.namingResources = namingResources;
  1327. namingResources.setContainer(this);
  1328. support.firePropertyChange("namingResources",
  1329. oldNamingResources, this.namingResources);
  1330. unregister(onameNamingResources);
  1331. onameNamingResources = register(namingResources,
  1332. "type=NamingResources," + getObjectKeyPropertiesNameOnly());
  1333. }
  1334. /**
  1335. * Return the context path for this Context.
  1336. */
  1337. public String getPath() {
  1338. return (getName());
  1339. }
  1340. /**
  1341. * Set the context path for this Context.
  1342. * <p>
  1343. * <b>IMPLEMENTATION NOTE</b>: The context path is used as the "name" of
  1344. * a Context, because it must be unique.
  1345. *
  1346. * @param path The new context path
  1347. */
  1348. public void setPath(String path) {
  1349. // XXX Use host in name
  1350. setName(path);
  1351. }
  1352. /**
  1353. * Return the public identifier of the deployment descriptor DTD that is
  1354. * currently being parsed.
  1355. */
  1356. public String getPublicId() {
  1357. return (this.publicId);
  1358. }
  1359. /**
  1360. * Set the public identifier of the deployment descriptor DTD that is
  1361. * currently being parsed.
  1362. *
  1363. * @param publicId The public identifier
  1364. */
  1365. public void setPublicId(String publicId) {
  1366. if (log.isDebugEnabled())
  1367. log.debug("Setting deployment descriptor public ID to '" +
  1368. publicId + "'");
  1369. String oldPublicId = this.publicId;
  1370. this.publicId = publicId;
  1371. support.firePropertyChange("publicId", oldPublicId, publicId);
  1372. }
  1373. /**
  1374. * Return the reloadable flag for this web application.
  1375. */
  1376. public boolean getReloadable() {
  1377. return (this.reloadable);
  1378. }
  1379. /**
  1380. * Return the default context override flag for this web application.
  1381. */
  1382. public boolean getOverride() {
  1383. return (this.override);
  1384. }
  1385. /**
  1386. * Return the original document root for this Context. This can be an absolute
  1387. * pathname, a relative pathname, or a URL.
  1388. * Is only set as deployment has change docRoot!
  1389. */
  1390. public String getOriginalDocBase() {
  1391. return (this.originalDocBase);
  1392. }
  1393. /**
  1394. * Set the original document root for this Context. This can be an absolute
  1395. * pathname, a relative pathname, or a URL.
  1396. *
  1397. * @param docBase The original document root
  1398. */
  1399. public void setO