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

JTE implementation is broken #3300

Closed
satsen opened this issue Dec 21, 2023 · 1 comment · Fixed by #3301
Closed

JTE implementation is broken #3300

satsen opened this issue Dec 21, 2023 · 1 comment · Fixed by #3301
Milestone

Comments

@satsen
Copy link
Contributor

satsen commented Dec 21, 2023

The code in JteTemplateEngine.java is like this:

    Map<String, Object> model;
    if (attributes.isEmpty()) {
      model = modelAndView.getModel();
    } else {
      model = new HashMap<>();
      model.putAll(attributes);
      model.putAll(model);
    }

You can see, if there are attributes it just adds the model map to itself. The last code line should have been model.putAll(modelAndView.getModel());. Because of this bug, no pages can be rendered at all as you cannot pass the model.

@satsen
Copy link
Contributor Author

satsen commented Dec 21, 2023

It was actually this issue which caused me to open #3113. That is still a bug, but just passing a Map with the page model attribute name (defined in template) and page model would have worked for me but this bug makes it impossible to pass anything at all.

@jknack jknack added this to the 3.0.7 milestone Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants