users@jersey.java.net

Preprocessing of resource urls'...

From: Jalpesh Patadia <jrp_at_clickbank.com>
Date: Mon, 4 May 2009 16:47:07 -0700

Hello everyone,

Thanks for the earlier replies to my questions. This forum has been pretty responsive so far and I'm making great headway in my project.

I did have a slightly esoteric request and I was wondering if somebody had any experience in doing that. Basically in my current setup, I have a Custom Web Filter (in web.xml) in front of all of my JSR-RS urls which acts as a gatekeeper to my JSR-RS specific urls.

What I need to do in this filter, figure out the Class/method that I'm going to be calling before actually letting the com.sun.jersey.spi.spring.container.servlet.SpringServlet handle my request.

So for the following code:

@Path("/myurl/myPath")
public class HelloResource {

    @Path("{id}")
    @Get
   public void handleId(..........) {
   }
}

in my Filter I want to extract the Java.lang.Method HelloResource.handleId() if the request url is "/myurl/myPath/1234"; which I can then pre-process [Maybe add some logging, inspect annotations on that method etc.] before forwarding on to that resource. Basically it's kind of a reverse lookup to find the Resource for a given url. The Jersey code probably has that information at that point, I just was wondering if there was a way to extract that info.

I couldn't find any such information in the spec or the jersey documentation on how to do that so I figured I'd ask for help in this mailing list.

Thanks in advance for any help !!!


--- Jalpesh






________________________________
PRIVILEGED AND CONFIDENTIAL
This transmission may contain privileged, proprietary or confidential information. If you are not the intended recipient, you are instructed not to review this transmission. If you are not the intended recipient, please notify the sender that you received this message and delete this transmission from your system.