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

'url' property of model class 'project.java' leads to Error: following has evaluated to null or missing. #8

Open
andrematzke opened this issue Feb 24, 2022 · 0 comments

Comments

@andrematzke
Copy link

andrematzke commented Feb 24, 2022

Hi,

in the Samples in
samples/fr.opensagres.xdocreport.samples.docxandfreemarker

there you can find for the for the context model a class called Project.java. In that class the constructor has to be filled with a parameter "name". There is also defined as a property of the class something called "url" with a get/set - ter.

Conveniently there is no sample-duo (docx, java), which uses this URL.

I tried using that URL property e.g. :
with a $(project.url) in the docx-file and

Project project = new Project("XDocReport");
project.setURL = "www.hello-world.de";
context.put("project", project);
report.process(context, out);

then I get this:
2022-02-24 15:55:03.821 ERROR 7584 --- [nio-8081-exec-2] freemarker.runtime : Error executing FreeMarker template freemarker.core.InvalidReferenceException: The following has evaluated to null or missing: ==> project.url [in template "fr.opensagres.xdocreport.document.docx.DocxReport@72879b71!word/document.xml" at line 4, column 9097]

meanwhile I dont put it via a model class into the context, rather than with many calls alá context.put(String key, String value)

Where is the issue ? Do I understand something wrong ? Why is there no example with the "url" from the model class "Project" ? Or for what purpose is there even the "url" property in the model class "project" ?

on my research in the internet over this issue of mine, I have found examples where the coder extended the constructor with all the parameters he wanted to be integrated. But this kind of using a constructor I wouldnt prefer over my many single calls, due to the fact, that a constructor shouldnt look like that...

BR,
A.Emm

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