Dhairya-007 opened a new pull request, #29956:
URL: https://github.com/apache/camel/pull/29956

   ## Problem
   
   `ThymeleafConstants` publishes a header that the component never looks up:
   
   ```java
   @Metadata(description = "The ServletContext for a web application.", 
javaType = "jakarta.servlet.ServletContext")
   public static final String THYMELEAF_SERVLET_CONTEXT = 
"CamelThymeleafServletContext";
   ```
   
   `CamelThymeleafServletContext` appears nowhere else in the component - not 
in `ThymeleafEndpoint`, `ThymeleafProducer` or `ThymeleafComponent`, and not in 
a test. The component does not handle a `ServletContext` anywhere; the 
`WebApplicationTemplateResolver` is built from a field on the endpoint instead:
   
   ```java
   private JakartaServletWebApplication jakartaServletWebApplication;
   ...
   private ITemplateResolver webApplicationTemplateResolver() {
       WebApplicationTemplateResolver resolver = new 
WebApplicationTemplateResolver(jakartaServletWebApplication);
   ```
   
   which `setJakartaServletWebApplication` fills in.
   
   That matches the Thymeleaf 3.1 API: the `ServletContext`-based web context 
was replaced by `IWebApplication` / `JakartaServletWebApplication`, and 
`WebApplicationTemplateResolver` takes the latter. So the header has nothing it 
could be passed to any more - setting it is silently ignored, while the catalog 
lists it as a supported header with a `jakarta.servlet.ServletContext` type.
   
   ## Fix
   
   Deprecate the constant with a `deprecationNote` pointing at 
`jakartaServletWebApplication`, so the catalog stops advertising it. The 
constant stays, so nothing stops compiling.
   
   The regenerated `thymeleaf.json` files are included.


-- 
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]

Reply via email to