Results 1 to 4 of 4

Thread: Getting HttpSession when using HttpInvokerServiceExport

  1. #1
    Join Date
    Dec 2004
    Posts
    4

    Default Getting HttpSession when using HttpInvokerServiceExport

    Hi,

    When using HttpInvokerServiceExporter to expose a java interface as a remote service is it possible to get hold of the HttpSession objects on the server in a simple manner?
    I need the HttpSession from my "service object" for authentication purposes.

    My web.xml is looks like this:

    Code:
    <servlet> 
          <servlet-name>remote</servlet-name> 
          <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
          <load-on-startup>1</load-on-startup> 
       </servlet>
       
       <servlet-mapping> 
          <servlet-name>remote</servlet-name> 
          <url-pattern>/remote/*</url-pattern> 
       </servlet-mapping>    
        
        <listener>
    		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    	</listener>
    Thanks
    LA

  2. #2
    Join Date
    Oct 2004
    Location
    Antwerp, Belgium
    Posts
    96

    Default

    When using HttpInvokerServiceExporter to expose a java interface as a remote service is it possible to get hold of the HttpSession objects on the server in a simple manner?
    I need the HttpSession from my "service object" for authentication purposes.
    When doing authentication it's probably more interesting to add attributes to the RemoteInvocation instance on the client and check those attributes on the server.

  3. #3
    Join Date
    Dec 2004
    Posts
    4

    Default

    Quote Originally Posted by tentacle
    When using HttpInvokerServiceExporter to expose a java interface as a remote service is it possible to get hold of the HttpSession objects on the server in a simple manner?
    I need the HttpSession from my "service object" for authentication purposes.
    When doing authentication it's probably more interesting to add attributes to the RemoteInvocation instance on the client and check those attributes on the server.
    My use case is this:

    The user is already authenticated in a portal environment against an ldap database when accessing the JWS application who uses the HttpInvoker. I'm trying not to force the user to log in once more, by checking his logon against the current HttpSession object.

    Thanks
    LA

  4. #4
    Join Date
    Sep 2004
    Location
    Melbourne, Australia
    Posts
    54

    Default

    You can access the HttpSession indirectly... When you specify your serviceUrl simply append the session id:
    http://localhost:8080/path/to/servic...D9502BF33F0 8

    This works great if your remoting is happening in an applet because you can just specify the session id as a param. As far as the server is concerned your applets remote service invocations happen in the same session as the instantiating browser.

    Note: I've only tested this on Tomcat.

Similar Threads

  1. HttpSession handling
    By jocsch in forum Web Flow
    Replies: 7
    Last Post: Dec 16th, 2008, 04:43 AM
  2. Custom HttpSession implementations
    By maward in forum Web
    Replies: 12
    Last Post: Dec 3rd, 2008, 07:29 AM
  3. Replies: 2
    Last Post: Oct 13th, 2005, 02:47 PM
  4. Replies: 8
    Last Post: Jul 28th, 2005, 10:42 AM
  5. Replies: 2
    Last Post: Jan 16th, 2005, 01:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •