Announcement Announcement Module
No announcement yet.
HessianServiceExporter and ServletRequest Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • HessianServiceExporter and ServletRequest


    when using plain hessian I can get the (Http)ServletRequest by using: xtRequest()
    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(...)

  • #2
    no RequestContextFilter

    NB. Currently we use spring 1.2 so the RequestContextFilter is not an option...
    (editing my post does not seem to work...)