Hi,
Craig L. Ching schrieb:
Hi all,
I had this problem back in mid-June and it's reared its head again.
Basically, in a JSP, I am trying to adapt an OCM mapped resource and I'm
getting null back. Felix originally fixed this problem in [1]
but it's back and I'm having troubles again. The easiest way to see
this is to deploy the samples/simple-demo bundle and go to
http://localhost:8080/sample/content/home.html. You should get a null
pointer exception because this call:
final SamplePage samplePage = resource.adaptTo(SamplePage.class);
in
samples/simple-demo/src/main/resources/SLING-INF/content/apps/sling/Samp
lePage/html.jsp returns null. Any ideas what the problem might be this
time? I'm finding it a bit tricky debugging the OCM mapped resources
;-)
Yeah, I fear problems reappeared. I will have to dig into this (again).
As an aside, should I be staying away from OCM? I like the idea and it
works great when it does work, but I don't want to be outside of the
norm here if it's not a good technology.
I am also one of the OCM guys. Actually the first Sling implementations
exclusively built upon OCM...
Anyway, I like thinking in business object terms in contrast to just
nodes and properties terms (as if a business application would just be
built by static functions operation on maps ;-) ). But YMMV. I would
say, if you have a reason to use OCM, use it.
Or I could possibly supply
some tests given a little guidance to make sure it's breakage becomes
more obvious.
As Bertrand already said, this would certainly be a nice addition and be
welcomed.
Regards
Felix