axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wagle, Shriniwas" <Shriniwas_Wa...@sra.com>
Subject RE: session management problem
Date Fri, 20 Aug 2004 14:31:26 GMT
I haven't tried it, but if I had a need I'd try something like this:
- Start with the message context and go on from there.  Something like..
 
msgC = MessageContext.getCurrentContext();
(HttpServletRequest)msgC.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);

>From this point on, you should be able to do the usual stuff.  Also take a
look at Axis API docs.

  _____  

From: Dorner Thomas [mailto:Thomas.Dorner@t-systems.com] 
Sent: Friday, August 20, 2004 10:09 AM
To: axis-user@ws.apache.org
Subject: session management problem



Hello,

  

I use Apache Axis sessions (SOAP-Haeder based) and I need to know when a
session was destroyed, but I can't find a session timeout notifying
mechanism for axis.

Does anybody have any idea?

 

Hope somebody can give me a tip :-(

 

There is a similar solution for standard servlets based on
HttpSessionBindingListener :

 

 

import java.io.*;

import java.net.*;

import java.util.*;

import java.lang.*;

import javax.servlet.*;

import javax.servlet.http.*;

 

public class TestSessionServer extends HttpServlet

{

public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException

{

res.setContentType("text/html");

PrintWriter out = res.getWriter();

String command = req.getParameter("command");

HttpSession session = req.getSession(true);

session.setMaxInactiveInterval(180);

session.setAttribute("SessionObjName", new SessionTimeoutNotifier());

System.out.println("The command you typed was : "+command);

out.println("You typed : "+command);

out.println("Your session id is : "+session.getId());

} // End of doGet method

}

 

class SessionTimeoutNotifier implements HttpSessionBindingListener

{

SessionTimeoutNotifier()

{

}

public void valueBound(HttpSessionBindingEvent event)

{

System.out.println("The session has started : "+event.getSession().getId());

}

 

public void valueUnbound(HttpSessionBindingEvent event)

{

System.out.println("The session has ended : "+event.getSession().getId());

}

}

 

 

Thanks Thomas

 


Mime
View raw message