Add MessageResolver#15
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
|
I updated the Jenkinsfile with the changes in the main branch. Please rebase your branch and see if the job runs |
Provide how to change MessageResolver.
|
Thanks for the fix. It's working now! |
|
Hi, I noticed that some constants are missing/unextracted. In core Krazo, properties constants are defined in I would like to adopt one of the following options. Which one would be preferred?
Personally, I prefer Option 1. // And I noticed that I should change |
This is regarding the issue I previously reported on the mailing list here:
https://www.eclipse.org/lists/mvc-dev/msg00108.html
Note: AI was used to assist with this fix.
Summary of Changes
I have modified
krazo-thymeleafto loadmessages.propertiesdirectly from the root of the classpath. The location can be customized usingorg.eclipse.krazo.thymeleaf.messages.basename.megascus@9ef7efb#diff-0de5e3301051e2ddac61cc1ea8b2dcdaa84c4a4562197524afd487c89dfd26b2R50-R56
This behavior mimics the default behavior of Thymeleaf when integrated with Spring.
The only difference lies in how the
Orderis configured:In Spring's
MessageResolver, they overwrite the defaultStandardMessageResolverby not specifying anyOrder, and then callStandardMessageResolverinternally from within Spring'sMessageResolver. However, to avoid any potential licensing issues, I implemented this using a different approach.https://github.com/thymeleaf/thymeleaf-spring/blob/3.1-master/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/messageresolver/SpringMessageResolver.java
Additionally, extra messages can now be loaded using CDI:
megascus@9ef7efb#diff-7d895401f3946256e9e81972a7e43f20f1e1f412f3e45f5aca5023a6c86b3cfaR59
megascus@9ef7efb#diff-e4949bcf610db73a23d092f64a98472ef44c99084ee3be2d402f93474f1e89b5
Future Considerations
Ideally, this logic should be integrated into Krazo's core resource access mechanism so that other view engines can access messages in a similar manner. However, I haven't gone that far with this implementation yet.
I would really appreciate it if you could review and merge this PR.