Hi,

You should be able to get to a current message like this :

Message currentMessage =    
org.apache.cxf.phase.PhaseInterceptorChain.getCurrentMessage();
Next you can get to the actual HttpServletRequest like this :currentMessage.get("HTTP.REQUEST"); // AbstractHttpDestination.HTTP_REQUESTYou might want to use the CXf JAX-RS URITemplate implementation which will help to extract the keys :URITemplate t = new URITemplate("/rest/{key}/products/list");MultivaluedMap<String, String> map = new MetadataMap<String, String>();t.match(relativeURI, map);map.get("key");
cheers, Sergey



Hello!

I would like to develop the RESTful application, which does contain the
session keys within the URL, like below:

http://domain.com/rest/2ac41aab-472f-4731-b767-9b6812332748/products/list

I would like to define the around advice for all the service methods, the code
of the advice will examine the session key
(2ac41aab-472f-4731-b767-9b6812332748) to exist in the current session list.
If there is no such code - or the session was expired - the unauthorized
response code must be sent back to the client.

The question is - how can I get access to this parameter from the around
advice? I checked the user manual and sources, and still have no idea if there
is some ThreadLocal variable, responsible to hold the HTTP request object (may
be WebServiceContextImpl does the trick?)

I am using Spring AOP, if that matters.

Thank you in advance!

--
Eugene N Dzhurinsky
----- Original Message ----- From: "Eugeny N Dzhurinsky" <[email protected]>
To: <[email protected]>
Sent: Sunday, June 14, 2009 10:48 AM
Subject: Get access to HTTP request parameters from an AOP advice?


Reply via email to