You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make EmbeddedVelocityToolboxView work in servlet container deployments
EmbeddedVelocityToolboxView is used with both embedded containers and
when a Spring Boot application is deployed to a servlet container. It
process the ServletContext to intercept calls to getResource so that it
can load Velocity’s toolbox.xml file from within an executable jar.
Previously, when it created the proxy, it didn’t specify the ClassLoader
to use. This resulted in the proxy being created using the ClassLoader
that loaded the Class that is being proxied. This fails when the
application is deployed to a ServletContainer as the ClassLoader that
loaded the ServletContext implementation is the container’s ClassLoader
and it cannot see the classes that are specific to the web application.
This commit updates EmbeddedVelocityToolboxView to specify the
ClassLoader to use when creating the proxy. It specifies its own
ClassLoader thereby ensuring that the proxy creation can load
application-specific classes.
Fixesspring-projectsgh-4967
Copy file name to clipboardExpand all lines: spring-boot/src/main/java/org/springframework/boot/web/servlet/view/velocity/EmbeddedVelocityToolboxView.java
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2012-2015 the original author or authors.
2
+
* Copyright 2012-2016 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -34,10 +34,11 @@
34
34
35
35
/**
36
36
* Extended version of {@link VelocityToolboxView} that can load toolbox locations from
37
-
* the classpath as well as the servlet context. This is useful when run an embedded web
38
-
* server.
37
+
* the classpath as well as the servlet context. This is useful when running in an
0 commit comments