I am using Play Framework about 1 month and it is a great thing, but I had one big problem
.
I`ve try to run following code in secure controller:
MyModel myModel = MyModel.all().first();
Field idField = myModel.getClass().getField("id");
About line 2 Play says:
Compilation error
The file /app/controllers/Security.java could not be compiled. Error
raised is : Unhandled exception type NoSuchFieldException
Maybe it`s a core bug?
Thanks.
You should handle the exception that getField(String fieldName) can throw. In this case a NoSuchFieldException.
Try to write it as such: