Hi Kenny
I am afraid , I am still not clear about your use case. Could you please try to explain your use case or requirement around the component little more clearly
To answer your this question, (even though i didn't understand what your are trying to do here ) , you can always get a SlingHttpServletRequest object in your model using the code snippet I have mentioned in the below answer Re: Sightly question: how to adapt a class with a path
@Model(adaptables = SlingHttpServletRequest.class)
Once you have the request you can always adapt a resource and play around
BUT, What i see in your code is you already have a request object ,
Resource resource = request.getResource();
Could you tell me what exactly are you trying to implement by fetching another request object (which doesn't make sense since you already have one . ) , when you can do almost everything using the Resource API .
PS:- All my above answers are direct to your question. Still I am not sure about your requirement . And as smacdonald2008 said, I don't think this is a correct approach.