[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] HttpService, Jetty, Session timeout

Hi Frank -

I've run into this issue before.  Since the OSGi HTTP service doesn't
support the use of a web.xml file (to the best of my knowledge
anyway), session timeouts can't be set in the standard way.

What I've done to work around this is to use reflection to invoke a
Jetty-specific method for setting session timeouts.

For example:

   public void setSessionTimeout(HttpServlet servlet, int timeoutSeconds) {
       ServletContext sc = servlet.getServletContext();

       Object handler = reflector.invokeMethod(sc,
"getServletHandler", null, null);
               new Class[]{Integer.TYPE},
               new Object[]{new Integer(timeoutSeconds)}

(The 'reflector' object uses the java.lang.reflect API under the hood.)

AOP might be another approach to setting session timeout under Jetty
that's worth investigating.


- Ben

On 2/12/07, Frank Appel <fappel@xxxxxxxxxxxxxx> wrote:


I've been looking a while for a possibility to set the session timeout of
the HttpService using Jetty as the underlying engine. Is there a simple
system property like org.osgi.service.http.port which is used to set the
port and if so, where can I find documentation about the available

Frank Appel
equinox-dev mailing list