-
Notifications
You must be signed in to change notification settings - Fork 91
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
Unable to evaluate Map
as Context
#102
Comments
OK this not a fix but it is a workaround until this issue is resolved. You can create a POJO that has a single property of type
|
FYI, you can have a Map as a context and make spel evaluate it by configurating the EvaluationContext thusly: DocxStamperConfiguration config = new DocxStamperConfiguration();
config.setEvaluationContextConfigurer(ctx -> ctx.addPropertyAccessor(new MapAccessor()));
DocxStamper<Map<String, Object>> stamper = new DocxStamper<>(config);
stamper.stamp(/*template*/, /*data map*/, /*output*/); You should at least be able to have this in the word template ${iterator['name']} |
Where does |
From |
Amazing, it wasn't imported with docx-stamper. For anyone else you can get it here:
|
I need to be able to use this with a context that is a
Map<String, Object>
. The context is created at run time so I cant define it as a POJO. Unfortunately the library currently doesn't seem to be able to handle aMap
context. The output file seems to just skip over every single placeholder.The test context I'm passing in looks like this in JSON:
I have tried the following placeholders but none work:
Any suggestions?
The text was updated successfully, but these errors were encountered: