Signed-off-by: WalkerWatch <ctwalker@gmail.com>
This commit is contained in:
WalkerWatch 2016-07-08 10:47:49 -04:00
parent adf3281ba8
commit e4807076b2
1 changed files with 42 additions and 16 deletions

View File

@ -47,6 +47,32 @@ However, if in this mode some classes that are dependencies of other classes are
If set to true, Jetty uses normal JavaSE classloading priority, and gives priority to the parent/system classloader. If set to true, Jetty uses normal JavaSE classloading priority, and gives priority to the parent/system classloader.
This avoids the issues of multiple versions of a class within a webapp, but the version the parent/system loader provides must be the right version for all webapps you configure in this way. This avoids the issues of multiple versions of a class within a webapp, but the version the parent/system loader provides must be the right version for all webapps you configure in this way.
[[configuring-webapp-caching]]
===== Configuring Webapp Classloader Caching
Introduced in Jetty 9.3.6, the link:{JDURL}/org/eclipse/jetty/webapp/CachingWebAppClassLoader.html[CachingWebAppClassLoader] can be used to cache `getResource(String)` results.
For webapps that search for classes and resources regularly, this can increase speed and performance.
This is an optional feature and it should be noted that it can conflict with several other libraries such as JSP, JSTL, JSF and CDI.
As such, this feature must be manually enabled for each webapp you want to use it in.
Below is an example of implementing this feature using Jetty IoC XML format:
[source, xml, options="header"]
----
<Configure id="mywebapp" class="org.eclipse.jetty.webapp.WebAppContext">
...
<Set name="classLoader">
<New class="org.eclipse.jetty.webapp.CachingWebAppClassLoader">
<Arg><Ref refid="mywebapp"/></Arg>
</New>
</Set>
...
</Configure>
----
[[classloading-setting-system-classes]] [[classloading-setting-system-classes]]
===== Setting System Classes ===== Setting System Classes