I have an Enum
that has certain fields that I need to get in my play1.2.4
template
public Enum WORKER{ FARMER,SMITH,GARDENER }
Suppose I need to check if the variable "person" in the template is a farmer, a blacksmith or a gardener, how can I do this?
#{if person.Type==WORKER.FARMER} ...do something...
Here i get
NullPointerException : Cannot get property 'FARMER' on null object.
So, the template does not know about Enum WORKER. Since a new instance cannot be created for Enum, how do I make Enum available to the template?
source share