Note: XML Schema validation will not work with Xerces 2.2.
-->
<Host name="localhost" appBase="webapps"
- unpackWARs="true" autoDeploy="true"
- xmlValidation="false" xmlNamespaceAware="false">
+ unpackWARs="true" autoDeploy="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
public void setName(String name);
- /**
- * Get the server.xml <host> attribute's xmlNamespaceAware.
- * @return true if namespace awareness is enabled.
- *
- */
- public boolean getXmlNamespaceAware();
-
-
- /**
- * Get the server.xml <host> attribute's xmlValidation.
- * @return true if validation is enabled.
- *
- */
- public boolean getXmlValidation();
-
-
- /**
- * Set the validation feature of the XML parser used when
- * parsing xml instances.
- * @param xmlValidation true to enable xml instance validation
- */
- public void setXmlValidation(boolean xmlValidation);
-
-
- /**
- * Set the namespace aware feature of the XML parser used when
- * parsing xml instances.
- * @param xmlNamespaceAware true to enable namespace awareness
- */
- public void setXmlNamespaceAware(boolean xmlNamespaceAware);
-
-
// --------------------------------------------------------- Public Methods
standardHost.unfoundContext=Cannot find context for request URI {0}
standardHost.warRequired=URL to web application archive is required
standardHost.warURL=Invalid URL for web application archive: {0}
-standardHost.validationEnabled=XML validation enabled
-standardHost.validationDisabled=XML validation disabled
standardServer.onameFail=MBean name specified for Server [{0}] is not valid
standardServer.shutdownViaPort=A valid shutdown command was received via the shutdown port. Stopping the Server instance.
standardService.connector.initFailed=Failed to initialise connector [{0}]
standardHost.unfoundContext = No puedo hallar contexto para URI de requerimiento {0}
standardHost.warRequired = Es necesario poner la URL a archivo de aplicaci\u00F3n web
standardHost.warURL = URL inv\u00E1lida para archivo de aplicaci\u00F3n web\: {0}
-standardHost.validationEnabled = Activada la validaci\u00F3n XML
-standardHost.validationDisabled = Desactivada la validaci\u00F3n XML
standardService.initialize.failed = Servicio inicializando en {0} fall\u00F3
standardService.register.failed = Error registrando servicio en dominio {0}
standardService.start.name = Arrancando servicio {0}
standardHost.unfoundContext=\u30ea\u30af\u30a8\u30b9\u30c8URI {0} \u306e\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3092\u898b\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093
standardHost.warRequired=Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30a2\u30fc\u30ab\u30a4\u30d6\u306eURL\u304c\u5fc5\u8981\u3067\u3059
standardHost.warURL=Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30a2\u30fc\u30ab\u30a4\u30d6\u306b\u5bfe\u3059\u308b\u7121\u52b9\u306aURL\u3067\u3059: {0}
-standardHost.validationEnabled=XML\u691c\u8a3c\u306f\u6709\u52b9\u3067\u3059
-standardHost.validationDisabled=XML\u691c\u8a3c\u306f\u7121\u52b9\u3067\u3059
standardService.start.name=\u30b5\u30fc\u30d3\u30b9 {0} \u3092\u8d77\u52d5\u3057\u307e\u3059
standardService.stop.name=\u30b5\u30fc\u30d3\u30b9 {0} \u3092\u505c\u6b62\u3057\u307e\u3059
standardWrapper.allocate=\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u5272\u308a\u5f53\u3066\u4e2d\u306e\u30a8\u30e9\u30fc\u3067\u3059
/**
* Attribute value used to turn on/off XML validation
*/
- private boolean webXmlValidation = false;
+ private boolean webXmlValidation = Globals.STRICT_SERVLET_COMPLIANCE;
/**
* Attribute value used to turn on/off XML namespace validation
*/
- private boolean webXmlNamespaceAware = false;
+ private boolean webXmlNamespaceAware = Globals.STRICT_SERVLET_COMPLIANCE;
/**
* Attribute value used to turn on/off TLD processing
/**
* Attribute value used to turn on/off XML validation
*/
- private boolean tldValidation = false;
+ private boolean tldValidation = Globals.STRICT_SERVLET_COMPLIANCE;
/**
* Attribute value used to turn on/off TLD XML namespace validation
*/
- private boolean tldNamespaceAware = false;
+ private boolean tldNamespaceAware = Globals.STRICT_SERVLET_COMPLIANCE;
/**
/**
- * Attribute value used to turn on/off XML validation
- */
- private boolean xmlValidation = false;
-
-
- /**
- * Attribute value used to turn on/off XML namespace awareness.
- */
- private boolean xmlNamespaceAware = false;
-
- /**
* Should we create directories upon startup for appBase and xmlBase
*/
private boolean createDirs = true;
}
- /**
- * Set the validation feature of the XML parser used when
- * parsing xml instances.
- * @param xmlValidation true to enable xml instance validation
- */
- public void setXmlValidation(boolean xmlValidation){
-
- this.xmlValidation = xmlValidation;
-
- }
-
- /**
- * Get the server.xml <host> attribute's xmlValidation.
- * @return true if validation is enabled.
- *
- */
- public boolean getXmlValidation(){
- return xmlValidation;
- }
-
- /**
- * Get the server.xml <host> attribute's xmlNamespaceAware.
- * @return true if namespace awareness is enabled.
- *
- */
- public boolean getXmlNamespaceAware(){
- return xmlNamespaceAware;
- }
-
/**
- * Set the namespace aware feature of the XML parser used when
- * parsing xml instances.
- * @param xmlNamespaceAware true to enable namespace awareness
- */
- public void setXmlNamespaceAware(boolean xmlNamespaceAware){
- this.xmlNamespaceAware=xmlNamespaceAware;
- }
-
- /**
* Host work directory base.
*/
public String getWorkDir() {
errorReportValveClass), t);
}
}
- if(log.isDebugEnabled()) {
- if (xmlValidation)
- log.debug(sm.getString("standardHost.validationEnabled"));
- else
- log.debug(sm.getString("standardHost.validationDisabled"));
- }
-
super.startInternal();
}
boolean deployOnStartup = booleanParameter(request, "deployOnStartup", true, htmlMode);
boolean deployXML = booleanParameter(request, "deployXML", true, htmlMode);
boolean unpackWARs = booleanParameter(request, "unpackWARs", true, htmlMode);
- boolean xmlNamespaceAware = booleanParameter(request, "xmlNamespaceAware", false, htmlMode);
- boolean xmlValidation = booleanParameter(request, "xmlValidation", false, htmlMode);
add(writer, name, aliases, appBase, manager,
autoDeploy,
deployOnStartup,
deployXML,
- unpackWARs,
- xmlNamespaceAware,
- xmlValidation);
+ unpackWARs);
}
boolean autoDeploy,
boolean deployOnStartup,
boolean deployXML,
- boolean unpackWARs,
- boolean xmlNamespaceAware,
- boolean xmlValidation) {
+ boolean unpackWARs) {
if (debug >= 1) {
log(sm.getString("hostManagerServlet.add", name));
}
host.setDeployOnStartup(deployOnStartup);
host.setDeployXML(deployXML);
host.setUnpackWARs(unpackWARs);
- host.setXmlNamespaceAware(xmlNamespaceAware);
- host.setXmlValidation(xmlValidation);
// Add new host
try {
boolean autoDeploy,
boolean deployOnStartup,
boolean deployXML,
- boolean unpackWARs,
- boolean xmlNamespaceAware,
- boolean xmlValidation)
+ boolean unpackWARs)
throws Exception {
// Create a new StandardHost instance
host.setDeployOnStartup(deployOnStartup);
host.setDeployXML(deployXML);
host.setUnpackWARs(unpackWARs);
- host.setXmlNamespaceAware(xmlNamespaceAware);
- host.setXmlValidation(xmlValidation);
// add HostConfig for active reloading
HostConfig hostConfig = new HostConfig();
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
-import java.lang.annotation.Annotation;
import java.net.JarURLConnection;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
if (log.isDebugEnabled())
log.debug(sm.getString("contextConfig.start"));
- // Process the default and application web.xml files
- // Set properties based on default context
- boolean useXmlValidation = context.getXmlValidation();
- boolean useXmlNamespaceAware = context.getXmlNamespaceAware();
-
- Container container = context.getParent();
- // Use the value from the host if:
- // - override is false on the context
- // - value has been set to false / not set on the context
- if( !context.getOverride() ) {
- if( container instanceof Host ) {
- if (!useXmlValidation) {
- useXmlValidation = ((Host)container).getXmlValidation();
- }
-
- if (!useXmlNamespaceAware){
- useXmlNamespaceAware
- = ((Host)container).getXmlNamespaceAware();
- }
-
- }
- }
-
if (log.isDebugEnabled()) {
log.debug(sm.getString("contextConfig.xmlSettings",
- context.getName(), Boolean.valueOf(useXmlValidation),
- Boolean.valueOf(useXmlNamespaceAware)));
+ context.getName(),
+ Boolean.valueOf(context.getXmlValidation()),
+ Boolean.valueOf(context.getXmlNamespaceAware())));
}
- createWebXmlDigester(useXmlNamespaceAware, useXmlValidation);
+ createWebXmlDigester(context.getXmlNamespaceAware(), context.getXmlValidation());
webConfig();
setCopyXML(((StandardHost) host).isCopyXML());
setDeployXML(((StandardHost) host).isDeployXML());
setUnpackWARs(((StandardHost) host).isUnpackWARs());
- setXmlNamespaceAware(((StandardHost) host).getXmlNamespaceAware());
- setXmlValidation(((StandardHost) host).getXmlValidation());
}
} catch (ClassCastException e) {
log.error(sm.getString("hostConfig.cce", event.getLifecycle()), e);
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleListener;
import org.apache.catalina.core.StandardContext;
-import org.apache.catalina.core.StandardHost;
import org.apache.tomcat.JarScanner;
import org.apache.tomcat.JarScannerCallback;
import org.apache.tomcat.util.ExceptionUtils;
private void init() {
if (tldDigester == null){
- // (1) check if the attribute has been defined
- // on the context element.
setTldValidation(context.getTldValidation());
setTldNamespaceAware(context.getTldNamespaceAware());
-
- // (2) if the attribute wasn't defined on the context
- // and override is not set on the context try the host.
- if (!context.getOverride()) {
- if (!tldValidation) {
- setTldValidation(
- ((StandardHost) context.getParent()).getXmlValidation());
- }
-
- if (!tldNamespaceAware) {
- setTldNamespaceAware(
- ((StandardHost) context.getParent()).getXmlNamespaceAware());
- }
- }
tldDigester = createTldDigester(tldNamespaceAware, tldValidation);
}
}
</attribute>
<attribute name="override" required="false">
- <p>Set to <code>true</code> to have explicit settings in this
- Context element override any corresponding settings in either the global
+ <p>Set to <code>true</code> to ignore any settings in both the global
or <a href="host.html">Host</a> default contexts. By default, settings
- from a default context will be used.</p>
+ from a default context will be used but may be overridden by a setting
+ the same attribute explicitly for the Context.</p>
<p>If a symbolic link is used for docBase then changes to the
symbolic link will only be effective after a Tomcat restart or
by undeploying and redeploying the context. A context reload is not
file.</p>
</attribute>
+ <attribute name="tldNamespaceAware" required="false">
+ <p>If the value of this flag is <code>true</code>, the TLD files
+ XML validation will be namespace-aware. If you turn this flag on,
+ you should probably also turn <code>tldValidation</code> on. If the
+ <code>org.apache.catalina.STRICT_SERVLET_COMPLIANCE</code>
+ <a href="systemprops.html">system property</a> is set to
+ <code>true</code>, the default value of this attribute will be
+ <code>true</code>, else the default value will be <code>false</code>.
+ Setting this attribute to <code>true</code> will incur a performance
+ penalty.</p>
+ </attribute>
+
+ <attribute name="tldValidation" required="false">
+ <p>If the value of this flag is <code>true</code>, the TLD files
+ will be XML validated on context startup. If the
+ <code>org.apache.catalina.STRICT_SERVLET_COMPLIANCE</code>
+ <a href="systemprops.html">system property</a> is set to
+ <code>true</code>, the default value of this attribute will be
+ <code>true</code>, else the default value will be <code>false</code>.
+ Setting this attribute to <code>true</code> will incur a performance
+ penalty.</p>
+ </attribute>
+
<attribute name="wrapperClass" required="false">
<p>Java class name of the <code>org.apache.catalina.Wrapper</code>
implementation class that will be used for servlets managed by this
<code>true</code>.</p>
</attribute>
+ <attribute name="xmlNamespaceAware" required="false">
+ <p>If the value of this flag is <code>true</code>, the validation of
+ XML files will be namespace-aware. If you turn this flag on,
+ you should probably also turn <code>xmlValidation</code> on. If
+ the <code>org.apache.catalina.STRICT_SERVLET_COMPLIANCE</code>
+ <a href="systemprops.html">system property</a> is set to
+ <code>true</code>, the default value of this attribute will be
+ <code>true</code>, else the default value will be <code>false</code>.
+ Setting this attribute to <code>true</code> will incur a performance
+ penalty.</p>
+ </attribute>
+
+ <attribute name="xmlValidation" required="false">
+ <p>If the value of this flag is <code>true</code>, the XML files
+ will be validated on context startup. If the
+ <code>org.apache.catalina.STRICT_SERVLET_COMPLIANCE</code>
+ <a href="systemprops.html">system property</a> is set to
+ <code>true</code>, the default value of this attribute will be
+ <code>true</code>, else the default value will be <code>false</code>.
+ Setting this attribute to <code>true</code> will incur a performance
+ penalty.</p>
+ </attribute>
+
+
</attributes>
</subsection>
of the flag is <code>false</code>.</p>
</attribute>
- <attribute name="tldNamespaceAware" required="false">
- <p>If the value of this flag is <code>true</code>, the TLD files
- XML validation will be namespace-aware. If you turn this flag on,
- you should probably also turn <code>tldValidation</code> on. The
- default value for this flag is <code>false</code>, and setting it
- to true will incur a performance penalty.
- </p>
- </attribute>
-
- <attribute name="tldValidation" required="false">
- <p>If the value of this flag is <code>true</code>, the TLD files
- will be XML validated on context startup. The default value for
- this flag is <code>false</code>, and setting it to true will incur
- a performance penalty.</p>
- </attribute>
-
<attribute name="unloadDelay" required="false">
<p>Amount of ms that the container will wait for servlets to unload.
If not specified, the default value of the flag is <code>2000</code>
if set to false, code like <code>getResource("myfolder/myresource.txt")</code> will work
</li>
<li>
- The default value will be changed for
- <code>org.apache.tomcat.util.http.ServerCookie.ALWAYS_ADD_EXPIRES</code>.
- <code>org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR</code>.
- <code>org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING</code>.
+ The default value will be changed for:
+ <ul>
+ <li><code>org.apache.tomcat.util.http.ServerCookie.ALWAYS_ADD_EXPIRES</code>.</li>
+ <li><code>org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR</code>.</li>
+ <li><code>org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING</code>.</li>
+ <li>The <code>tldNamespaceAware</code> attribute of any
+ <a href="context.html">Context</a> element</li>.
+ <li>The <code>tldValidation</code> attribute of any
+ <a href="context.html">Context</a> element</li>.
+ <li>The <code>xmlNamespaceAware</code> attribute of any
+ <a href="context.html">Context</a> element</li>.
+ <li>The <code>xmlValidation</code> attribute of any
+ <a href="context.html">Context</a> element</li>.
+ </ul>
</li>
</ul>
</p>
specifications. Defaults, regardless of whether or not they have been
changed by setting
<code>org.apache.catalina.STRICT_SERVLET_COMPLIANCE</code> can always be
- overridden by explicitly setting the appropriate system property.</p>
+ overridden by explicitly setting the appropriate system property or element
+ attribute.</p>
</property>
<property name="org.apache.catalina.connector. Response.ENFORCE_ENCODING_IN_GET_WRITER">