Skip to main content
jason_tarry
Level 2
Oct 16, 2015 2:28 AM UTC
Solved

Sling Model question on ResourcePath

Hi all,

I'm trying to figure out if there is a convenient way to Inject a Resource from a given path. There is the option of using a ResourceResolver but from reading Justin's slides it looks like it might possible to do something like this:

    @Inject @ResourcePath(path="/path/to/resource")

    Resource resource;

 

It doesn't seem to work for me so I just wanted to check if this is possible. Has anyone done something like this?

Regards,

Jason

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
Level 10
Oct 16, 2015 2:28 AM UTC

Try with Resource.getResource();

1 reply

Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
Level 10
Oct 16, 2015 2:28 AM UTC

Try with Resource.getResource();

Translate