Hello Florian,
I think that you need to override the init method in order to intialize
properly your resource instance (such as getting from the model all data
needed by this resource, check if this resource exists, setting the
supported variants, etc).
best regards,
Thierry Boileau
Hi folks,
I think SpringFinder.createResource(...) should be changed from:
public Resource createResource(Request request, Response response) {
Resource result = createResource();
if (result != null) {
result.init(getContext(), request, response);
}
return result;
}
}
to:
public Resource createResource(Request request, Response response) {
Resource result = createResource();
if (result != null) {
result.setContext(getContext());
result.setNegotiateContent(true);
result.setRequest(request);
result.setResponse(response);
}
return result;
}
Otherwise the variants of Resources will we set to NULL inside the
Resource.init(...) method and variants could not be set inside a
constructor. Or is it more appropriate to overwrite the init(...)
method of Resources instaniated by Spring?
Greetings
Flo