首先给出tomcat官网关于系统的介绍地址:http://tomcat.apache.org/tomcat-8.5-doc/config/systemprops.html
1.org.apache.catalina. STRICT_SERVLET_COMPLIANCE:
这个属性直接翻译过来是“严格的servlet规范”,因为tomcat作为一个web容器是按照servlet规范来写的,所以必然要遵守相应的规范。但是在tomcat不断的发展过程中有一些却不是完全严格按照规范来的,所以便有了这个属性。他是一个全局属性,并且对其他一系列的属性都会产生影响。当然如果你想定制下tomcat,为某些servlet规范不是明令禁止的属性或功能进行些”自定义“那么也可以使用该属性。
例如tomcat默认不能扫描WEB-INF/lib和WEB-INF/class下的TLD文件,但是servlet规范没有强硬禁止,那么如果有所需求就可以用该属性进行定制。
tomcat官方文档这样描述:
The default value of this system property is false.
If this is true the default values will be changed for:
- org.apache.catalina.core.
ApplicationContext.GET_RESOURCE_REQUIRE_SLASH
- org.apache.catalina.core.
ApplicationDispatcher.WRAP_SAME_OBJECT
- org.apache.catalina.core.
StandardHostValve.ACCESS_SESSION
- org.apache.catalina.session.
StandardSession.ACTIVITY_CHECK
- org.apache.catalina.session.
StandardSession.LAST_ACCESS_AT_START
- org.apache.tomcat.util.http.
ServerCookie.ALWAYS_ADD_EXPIRES
- org.apache.tomcat.util.http.
ServerCookie.FWD_SLASH_IS_SEPARATOR
- org.apache.tomcat.util.http.
ServerCookie.PRESERVE_COOKIE_HEADER
- org.apache.tomcat.util.http.
ServerCookie.STRICT_NAMING
- The resourceOnlyServlets attribute of any Context element.
- The tldValidation attribute of any Context element.
- The useRelativeRedirects attribute of any Context element.
- The xmlNamespaceAware attribute of any Context element.
- The xmlValidation attribute of any Context element.
Note that changing a number of the above defaults is likely to break the majority of systems as some browsers are unable to correctly handle the cookie headers that result from a strict adherence to the specifications. Defaults, regardless of whether or not they have been changed by setting org.apache.catalina.STRICT_SERVLET_COMPLIANCE can always be overridden by explicitly setting the appropriate system property or element attribute.