Commit Graph

24 Commits (14af3463ec4f831d2c794a1a46ae3de7373fd0f0)

Author SHA1 Message Date
Phillip Webb 14af3463ec Polish whitespace 7 years ago
Andy Wilkinson 082258952a Fall back to JVM's class path when finding jars with static resources
Previously, StaticResourceJars would only find jars with
META-INF/resources content if it had been loaded by a URLClassLoader.
This is not the case on Java 9 and, as a result, static content in
META-INF/resources of any jars on the class path was not found.

This commit updates StaticResourceJars to fall back to using the
JVM's class path to find static resource jars when it was loaded by
a ClassLoader that is not a URLClassLoader.

Closes gh-10455
7 years ago
Stephane Nicoll 8637547509 Disable embedded server integration tests on Java 9
See gh-10455
7 years ago
Emanuel Campolo 04fdec6f8b Replace explicit generics with diamond operator
Where possible, explicit generic declarations to use the Java 8 diamond
operator.

See gh-9781
7 years ago
Andy Wilkinson 0ab81e4f8f Prevent loader classes from being served by executable war
Closes gh-5550
7 years ago
Andy Wilkinson 643364e74d Try to ensure that embedded container tests can see milestones and snapshots 8 years ago
Andy Wilkinson bb54411366 Merge branch '1.5.x' 8 years ago
Andy Wilkinson 17062f9589 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 2ddcf0e831 Avoid using File.renameTo(File) as it doesn't work on Windows 8 years ago
Andy Wilkinson 019b0a3e9c Merge branch '1.5.x' 8 years ago
Andy Wilkinson 50c0204f2d Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson d32c3a7f43 Correct the URL that's called to test servlet context resources
See gh-8299
Closes gh-8525
8 years ago
Andy Wilkinson b527e71474 Merge branch '1.5.x' 8 years ago
Andy Wilkinson 1395f38ee7 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson a2cf0455fd Fix static resource handling when run in IDE or using Maven or Gradle
The changes made for gh-8299 attempted to make static resource
handling consistent across Jetty, Tomcat, and Undertow. They did so
for application's launched using JarLauncher or WarLauncher but did
not consider application's launched in an IDE or using spring-boot:run
in Maven or bootRun in Gradle.

Running in an IDE or via Maven or Gradle introduces two new
resource locations:

 - Jars on the classpath with file protocol URLs (they are always
   jar protocol URLs when using either launcher)
 - Directories on the classpath from a project that is depended upon
   and contains resources in META-INF/resources

This commit updates the factories for all three containers to handle
these new resources locations. The integration tests have also been
updated.
8 years ago
Phillip Webb d8f827d224 Cleanup and format code 8 years ago
Spring Buildmaster d23fa24340 Next Development Version 8 years ago
Spring Buildmaster 2a83e80a9b Next Development Version 8 years ago
Phillip Webb 58ac67eb27 Merge branch '1.5.x' 8 years ago
Phillip Webb f1012c104a Polish 8 years ago
Phillip Webb 987b6c956e Polish 8 years ago
Andy Wilkinson 9fc79692a7 Merge branch '1.5.x' 8 years ago
Andy Wilkinson 68af831059 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson b443b745fb Make static resource handling consistent across embedded containers
Previously, there were a number of inconsistencies in the embedded
containers' handling of static resources. The Servlet spec requires
that static resources can be served from the META-INF/resources/
directory of jars nested inside a war in WEB-INF/lib/. The intention
was also to extend this to cover jar packaging when jars are nested in
BOOT-INF/lib/. This worked when using Tomcat as long as Jasper was on
the classpath. If you didn't have Jasper on the classpath or you
were using Jetty or Undertow it did not work.

This commit updates the configuration of embedded Jetty, Tomcat, and
Undertow so that all three containers handle static resources in the
same way, serving them from jars in WEB-INF/lib/ or /BOOT-INF/lib/.
Numerous intergration tests have been added to verify the behaviour,
including tests for Tomcat 8.0 and 7.0 which is supported in addition
to the default 8.5.x. Note that static resource handling only works
with Jetty 9.3.x and 9.2 and earlier does not support nested jars (
see https://github.com/eclipse/jetty.project/issues/518 for details).

Closes gh-8299
8 years ago