Hello Roland,
your solution works. But the problem is that I am already registering the resource in
an Initializer. But ok...
Now I am uploading the picture and after the reload, I see the standard pic. After a
site refresh I am seeing the uploaded pic.
Do I have to set any headers?
greetings
Roland Huss wrote:
greeklinux wrote:
the line where the NullPointerException is thrown is:
resourceStream = new ResourceReference(MyApplication.PROFILE_STANDARD)
.getResource().getResourceStream();
If I am using only this ResourceReference then it works. But I dont know why
the Exception is thrown.
You need to bind (==register) the ResourceReference to the application before you can get to the referenced Resource (which has been registered either explicitely or implicitely, if is a PackageResource):
resourceReference = new ResourceReference(MyApplication.PROFILE_STANDARD);
resourceReference.bind(Application.get());
resourceStream = resourceReferece.getResource().getResourceStream();
...roland