I have in file index.htt this ode:
<%
try {
albumImage= IO.urlEncode(currentFolder.getThumbnailPath());
albumImage= albumImage.replace("thumbs","slides");
} // to prevent crash with an empty folder:
catch (NullPointerException e) { albumImage="";}
%>
I use the variable albumImage in file File page-header.inc:
<ja:if test="<%= !isEmpty(albumImage) %>">
<meta property="og:image" content="${albumImageURL}">
</ja:if>
This works fine with BSH, but with Groovy I get an error:
se.datadosen.util.ScriptException: groovy.lang.MissingPropertyException: No such property:
albumImage for class: Script494 in page-header.inc at line number 42
This error disappears if I repeat the first code block in file page-header.inc
So I wonder is the processing order of the files in Groovy differently as with BeanShell?
How should I solve this, without repeating code?