Slice Lookup doesn't resolve the appName

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Slice Lookup doesn't resolve the appName

richardlhr
Hi,

Here is a weird issue. I have 2 projects in separate packages that I'm converting to use Slice.
The first one is working as expected. I use <slice:lookup var="model" type="<%= com.mypackage.mymodel.class %>"  /> in my JSPs as expected.

On my second project that is configured exactly in the same way (unless I'm overlooking something). when I try to use
slice:lookup var="model" type="<%= com.mypackage.mymodel.class %>"  /> I get an exception as Slice failed to resolve the appName.
However, if I use slice:lookup var="model" type="<%= com.mypackage.mymodel.class %>"  appName="myappname" />, everything works fine.

The 2 projects used different injector names, bundle name filter and base package, so no confusion is possible.

Any idea what's going on?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Slice Lookup doesn't resolve the appName

maciej.majchrzak
Administrator
Hi there,

Slice resolves the appName (injectorName) automatically if not provided in appName attribute. It's based on resourceType - Slice assumes that the appName is equal to the part of the resourceType path after /apps/, e.g. /apps/testApp/myComponentResourceType it will return testApp.

Can you validate how does this match your application?

Cheers
Maciej

Reply | Threaded
Open this post in threaded view
|

Re: Slice Lookup doesn't resolve the appName

richardlhr
That was it! For the second project I had the injector name not matching the app name for some reason.
I knew it was a silly mistake. Thanks a lot :)