gnodet-bot commented on code in PR #29956:
URL: https://github.com/apache/camel/pull/29956#discussion_r4578924859
##########
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc:
##########
@@ -8965,3 +8965,23 @@ two matching headers, `CamelDockerLoggingFilter` and
`CamelDockerFollowRedirectF
Both options and both header constants are now deprecated. Remove
`loggingFilter` and `followRedirectFilter` from the
endpoint URI or the component configuration; setting them has changed nothing
since 2.18. To see the traffic with the
Docker daemon, raise the log level of the `com.github.dockerjava` loggers.
+
+=== camel-thymeleaf - the CamelThymeleafServletContext header is deprecated
+
+The `CamelThymeleafServletContext` header is never read by the component. The
web application template resolver is
+built from a `JakartaServletWebApplication`, not from a `ServletContext`, and
that object comes from the endpoint:
+
+[source,java]
+----
+WebApplicationTemplateResolver resolver = new
WebApplicationTemplateResolver(jakartaServletWebApplication);
+----
+
+A route that sets the header gets no error and no resolver. It is now
deprecated, with a `deprecationNote` that says
+so. `jakartaServletWebApplication` is not a URI option; set it on the endpoint:
+
+[source,java]
+----
+ThymeleafEndpoint endpoint = context.getEndpoint("thymeleaf:greeting.html",
ThymeleafEndpoint.class);
+endpoint.setJakartaServletWebApplication(
+ JakartaServletWebApplication.buildApplication(servletContext));
Review Comment:
⚠️ **Wrong URI in example — `JakartaServletWebApplication` is never used
here.**
`thymeleaf:greeting.html` uses the default `CLASS_LOADER` resolver
(`ThymeleafEndpoint.java:73`). `JakartaServletWebApplication` is only read when
`resolver=WEB_APP` is active (`ThymeleafEndpoint.java:298-299`). As written,
the endpoint is retrieved with the `CLASS_LOADER` resolver,
`setJakartaServletWebApplication(...)` stores the object, but the component
never reads it — the example silently does nothing.
```suggestion
ThymeleafEndpoint endpoint =
context.getEndpoint("thymeleaf:greeting.html?resolver=WEB_APP",
ThymeleafEndpoint.class);
endpoint.setJakartaServletWebApplication(
JakartaServletWebApplication.buildApplication(servletContext));
```
The route definition must use the same URI
(`to("thymeleaf:greeting.html?resolver=WEB_APP")`) to get this endpoint, and
the setter must be called before the first message (the template engine
initialises on first use).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]