-
Notifications
You must be signed in to change notification settings - Fork 40.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev Tools reload and SpEL loaded classes within Thymeleaf templates #42690
Comments
@mvitz Do you by any chance have a sample application you can provide? |
@philwebb, of course, I put a simple reproducer to https://github.com/mvitz/devtools-thymeleaf-classloader |
Thanks for the sample. I'm pretty sure this is caused by I'm not really sure how we can fix it, the best thing I can think of so far is to try and reset that static field using reflection. |
I've tried a few reflection hacks, but I don't think we can fix this. I think we need to ask for a change to |
In one of our Thymeleaf templates we have the following code:
This generally works and when
foobar
is an instance ofFooBar
thetd
is shown.But when I start the application with Dev Tools enabled, and I change something after reloading, the
td
is no longer shown.After I suspected that class loading may be the issue, I added the following code:
After each change and reload, this shows that the ClassLoader of the
foobar
instance is a newRestartClassLoader
but the ClassLoader of theT(some.pkg.FooBar)
stays the initial one and therefore theinstanceof
returnsfalse
.I don't know if it's possible, but it would be nice if the class within the Thymeleaf SpEL would be loaded by the same ClassLoader instance that loads the rest of the web application, as this would not alter the application "logic" in that case.
The text was updated successfully, but these errors were encountered: