2
votes

Is it possible to import Java classes into a Groovy template while using Play framework to avoid using fully qualified paths?

Current:

<div>
    *{ Loop through enum values.}*
    #{list items:package1.package2.package3.SampleEnum.values, as:'enumValue'}
        ...
    #{/list}
</div>

Desired:

%{
    import package1.package2.package3.SampleEnum 
}%
<div>
    *{ Loop through enum values.}*
    #{list items:SampleEnum.values, as:'enumValue'}
        ...
    #{/list}
</div>
1
david can't comment on this - Surreal

1 Answers

2
votes

In my experience, sadly not. You could set the enum values in a different template and inherent those separate friendly named values but that is just a hack.

PS miss you