From c241ba34d741c9659374cd63e31d94acc46bd274 Mon Sep 17 00:00:00 2001 From: Zayan Khan Date: Sun, 26 Jul 2026 19:45:47 -0400 Subject: [PATCH 1/4] README: fix ResourceLoader -> ResourceLocator There is no ResourceLoader type in jinjava; the interface to implement is com.hubspot.jinjava.loader.ResourceLocator (as the rest of the section already says). Co-Authored-By: Claude Fable 5 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e1285fa37..6be8c9ef7 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ file system, you can add a `FileResourceLocator`. Be aware the security risks of from adding code such as `{% include '/etc/password' %}`. You will likely want to provide your own implementation of -`ResourceLoader` to hook into your application's template repository, and then tell jinjava about it: +`ResourceLocator` to hook into your application's template repository, and then tell jinjava about it: ```java JinjavaConfig config = JinjavaConfig.builder().build(); From 287812605de8463d1eff0e040477dd73dafcd09d Mon Sep 17 00:00:00 2001 From: Zayan Khan Date: Sun, 26 Jul 2026 19:45:47 -0400 Subject: [PATCH 2/4] README: fix FileResourceLocator -> FileLocator The file-system locator class is com.hubspot.jinjava.loader.FileLocator; no FileResourceLocator exists. Co-Authored-By: Claude Fable 5 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6be8c9ef7..40aa7ff61 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ Jinjava needs to know how to interpret template paths, so it can properly handle ``` By default, it will load only a `ClasspathResourceLocator` which will allow loading from ANY file in the classpath inclusing class files. If you want to allow Jinjava to load any file from the -file system, you can add a `FileResourceLocator`. Be aware the security risks of allowing user input to prevent a user +file system, you can add a `FileLocator`. Be aware the security risks of allowing user input to prevent a user from adding code such as `{% include '/etc/password' %}`. You will likely want to provide your own implementation of From b454641218d89bc25a90878f1c321c9414eb33ec Mon Sep 17 00:00:00 2001 From: Zayan Khan Date: Sun, 26 Jul 2026 19:45:47 -0400 Subject: [PATCH 3/4] README: fix non-compiling CascadingResourceLocator example Jinjava.setResourceLocator takes a single ResourceLocator; the example passed two. Wrap them in CascadingResourceLocator (varargs constructor), which is what the surrounding text describes, and use the real FileLocator class name. Co-Authored-By: Claude Fable 5 --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 40aa7ff61..79e6e89d2 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,8 @@ To use more than one `ResourceLocator`, use a `CascadingResourceLocator`. JinjavaConfig config = JinjavaConfig.builder().build(); Jinjava jinjava = new Jinjava(config); -jinjava.setResourceLocator(new MyCustomResourceLocator(), new FileResourceLocator()); +jinjava.setResourceLocator( + new CascadingResourceLocator(new MyCustomResourceLocator(), new FileLocator())); ``` ### Custom tags, filters and functions From 8a1435a3ea4e46e6f4adf0e6691374f19fd89a92 Mon Sep 17 00:00:00 2001 From: Zayan Khan Date: Sun, 26 Jul 2026 19:45:48 -0400 Subject: [PATCH 4/4] README: fix unbalanced parentheses in registerFunction example The call opens two parens (registerFunction( and new ELFunctionDefinition() but closed only one. Co-Authored-By: Claude Fable 5 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 79e6e89d2..f4dc57a55 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ jinjava.getGlobalContext().registerTag(new MyCustomTag()); jinjava.getGlobalContext().registerFilter(new MyAwesomeFilter()); // define a custom public static function (this one will bind to myfn:my_func('foo', 42)) jinjava.getGlobalContext().registerFunction(new ELFunctionDefinition("myfn", "my_func", - MyFuncsClass.class, "myFunc", String.class, Integer.class); + MyFuncsClass.class, "myFunc", String.class, Integer.class)); // define any number of classes which extend Importable jinjava.getGlobalContext().registerClasses(Class... classes);