Jan 2nd, 2007, 05:27 AM
HessianServiceExporter and ServletRequest
when using plain hessian I can get the (Http)ServletRequest by using:
This is a neat, yet not very documented feature in hessian that works just perfectly...
That is because the HessianServlet passes the request to the static method ServiceContext.begin(...) which stores it in a threadlocal.
(It makes sense to do this when you want to obtain the user principal from the request to do some custom security handling)
The spring HessianServiceExporter replaces the HessianServlet. It receives the request from the dispatcher Servlet and calls HessianSkeleton.invoke(...) like the HessianServlet. But it doesn't call ServiceContext.begin(...)
So... When you callServiceContext.getContextRequest() you get: NULL
Is there any other way to obtain the ServletRequest in the exported service???
if there is none i'd suggest a fix for this, which is little more than calling ServiceContext.begin(...)
Jan 2nd, 2007, 07:14 AM
NB. Currently we use spring 1.2 so the RequestContextFilter is not an option...
(editing my post does not seem to work...)