Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"CamelThymeleafResourceUri": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Thymeleaf template.", "constantName": "org.apache.camel.component.thymeleaf.ThymeleafConstants#THYMELEAF_RESOURCE_URI" },
"CamelThymeleafTemplate": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The content of the Thymeleaf template.", "constantName": "org.apache.camel.component.thymeleaf.ThymeleafConstants#THYMELEAF_TEMPLATE" },
"CamelThymeleafVariableMap": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Map<String, Object>", "deprecated": false, "autowired": false, "secret": false, "description": "The value of this header should be a Map with key\/values that will be override any existing key with the same name. This can be used to preconfigure common key\/values you want to reuse in your Thymeleaf endpoints.", "constantName": "org.apache.camel.component.thymeleaf.ThymeleafConstants#THYMELEAF_VARIABLE_MAP" },
"CamelThymeleafServletContext": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "jakarta.servlet.ServletContext", "deprecated": false, "autowired": false, "secret": false, "description": "The ServletContext for a web application.", "constantName": "org.apache.camel.component.thymeleaf.ThymeleafConstants#THYMELEAF_SERVLET_CONTEXT" }
"CamelThymeleafServletContext": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "jakarta.servlet.ServletContext", "deprecated": true, "deprecationNote": "Never read by the component: the web application template resolver is built from the JakartaServletWebApplication given to ThymeleafEndpoint.setJakartaServletWebApplication, which is not a URI option", "autowired": false, "secret": false, "description": "The ServletContext for a web application. Deprecation note: Never read by the component: the web application template resolver is built from the JakartaServletWebApplication given to ThymeleafEndpoint.setJakartaServletWebApplication, which is not a URI option", "constantName": "org.apache.camel.component.thymeleaf.ThymeleafConstants#THYMELEAF_SERVLET_CONTEXT" }
},
"bodyTypes": {
"producerIn": { "carriers": [ "any" ], "description": "The template gets the body as ${body}, as it is: text, or a Map, a List or a POJO to read from; no body prints as empty text, and bytes or a stream are not read as text. The template is the resource, or the CamelThymeleafTemplate header with allowTemplateFromHeader=true, never the body" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"CamelThymeleafResourceUri": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The name of the Thymeleaf template.", "constantName": "org.apache.camel.component.thymeleaf.ThymeleafConstants#THYMELEAF_RESOURCE_URI" },
"CamelThymeleafTemplate": { "index": 1, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "autowired": false, "secret": false, "description": "The content of the Thymeleaf template.", "constantName": "org.apache.camel.component.thymeleaf.ThymeleafConstants#THYMELEAF_TEMPLATE" },
"CamelThymeleafVariableMap": { "index": 2, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Map<String, Object>", "deprecated": false, "autowired": false, "secret": false, "description": "The value of this header should be a Map with key\/values that will be override any existing key with the same name. This can be used to preconfigure common key\/values you want to reuse in your Thymeleaf endpoints.", "constantName": "org.apache.camel.component.thymeleaf.ThymeleafConstants#THYMELEAF_VARIABLE_MAP" },
"CamelThymeleafServletContext": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "jakarta.servlet.ServletContext", "deprecated": false, "autowired": false, "secret": false, "description": "The ServletContext for a web application.", "constantName": "org.apache.camel.component.thymeleaf.ThymeleafConstants#THYMELEAF_SERVLET_CONTEXT" }
"CamelThymeleafServletContext": { "index": 3, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "jakarta.servlet.ServletContext", "deprecated": true, "deprecationNote": "Never read by the component: the web application template resolver is built from the JakartaServletWebApplication given to ThymeleafEndpoint.setJakartaServletWebApplication, which is not a URI option", "autowired": false, "secret": false, "description": "The ServletContext for a web application. Deprecation note: Never read by the component: the web application template resolver is built from the JakartaServletWebApplication given to ThymeleafEndpoint.setJakartaServletWebApplication, which is not a URI option", "constantName": "org.apache.camel.component.thymeleaf.ThymeleafConstants#THYMELEAF_SERVLET_CONTEXT" }
},
"bodyTypes": {
"producerIn": { "carriers": [ "any" ], "description": "The template gets the body as ${body}, as it is: text, or a Map, a List or a POJO to read from; no body prints as empty text, and bytes or a stream are not read as text. The template is the resource, or the CamelThymeleafTemplate header with allowTemplateFromHeader=true, never the body" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ public class ThymeleafConstants {
javaType = "Map<String, Object>")
public static final String THYMELEAF_VARIABLE_MAP = "CamelThymeleafVariableMap";

@Metadata(description = "The ServletContext for a web application.", javaType = "jakarta.servlet.ServletContext")
@Metadata(description = "The ServletContext for a web application.", javaType = "jakarta.servlet.ServletContext",
deprecationNote = "Never read by the component: the web application template resolver is built from the"
+ " JakartaServletWebApplication given to ThymeleafEndpoint.setJakartaServletWebApplication,"
+ " which is not a URI option")
@Deprecated
public static final String THYMELEAF_SERVLET_CONTEXT = "CamelThymeleafServletContext";

private ThymeleafConstants() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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?resolver=WEB_APP", ThymeleafEndpoint.class);
endpoint.setJakartaServletWebApplication(
JakartaServletWebApplication.buildApplication(servletContext));
----
Original file line number Diff line number Diff line change
Expand Up @@ -510,14 +510,19 @@ public String thymeleafVariableMap() {
return "CamelThymeleafVariableMap";
}
/**
* The ServletContext for a web application.
* The ServletContext for a web application. Deprecation note: Never
* read by the component: the web application template resolver is built
* from the JakartaServletWebApplication given to
* ThymeleafEndpoint.setJakartaServletWebApplication, which is not a URI
* option.
*
* The option is a: {@code jakarta.servlet.ServletContext} type.
*
* Group: producer
*
* @return the name of the header {@code ThymeleafServletContext}.
*/
@Deprecated
public String thymeleafServletContext() {
return "CamelThymeleafServletContext";
}
Expand Down
Loading