Skip to content
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

Question: Custom classpath loader for bundles #1068

Open
beatyt opened this issue Jul 11, 2023 · 0 comments
Open

Question: Custom classpath loader for bundles #1068

beatyt opened this issue Jul 11, 2023 · 0 comments

Comments

@beatyt
Copy link

beatyt commented Jul 11, 2023

Hi,

I was playing with this project in an OSGI enroute environment. When using the default ClassPathTemplateLoader I was getting FileNotFoundException for the template. I created a custom one for bundles and things worked:

public class BundleClassPathTemplateLoader extends ClassPathTemplateLoader {
    @Override
    protected URL getResource(String location) {
        return this.getClass().getClassLoader().getResource(location);
    }
}
TemplateLoader loader = new BundleClassPathTemplateLoader();

image

My question is if there is an existing way to load templates for bundles that I'm unaware of.

Sample project at https://github.com/beatyt/htlmx-osgi-handlebars.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant