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

Can't set GraalJsExpressionHandler as expression handler #13

Open
dhruvil-patel opened this issue Oct 20, 2023 · 0 comments
Open

Can't set GraalJsExpressionHandler as expression handler #13

dhruvil-patel opened this issue Oct 20, 2023 · 0 comments

Comments

@dhruvil-patel
Copy link

Bean instantiation fails when in try to set the expressionhandler to GraalJsExpressionHandler as shown in the JavaConfig code example.

@configuration
public class PugConfig {

@Bean
public SpringTemplateLoader templateLoader() {
    SpringTemplateLoader templateLoader = new SpringTemplateLoader();
    templateLoader.setTemplateLoaderPath("classpath:/templates");
    templateLoader.setEncoding("UTF-8");
    templateLoader.setSuffix(".pug");
    return templateLoader;
}

@Bean
public PugConfiguration pugConfiguration() {
    PugConfiguration configuration = new PugConfiguration();
    configuration.setCaching(false);
    configuration.setTemplateLoader(templateLoader());
    //To use the new GraalJsExpressionHandler add this:
    configuration.setExpressionHandler(new GraalJsExpressionHandler());
    return configuration;
}

}

Note : Commenting the line which sets expression handler works.

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