Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
xml
xml
<Configure class="org.mortbay.jetty.webapp.WebAppContext">

 .
 .
 .
 <Set name="sessionHandler">
   <New class="org.mortbay.jetty.servlet.SessionHandler">
     <Arg>
       <New class="org.mortbay.jetty.servlet.HashSessionManager">
         <Set name="storeDirectory">your/chosen/directory/goes/here</Set>
       </New>
     </Arg>
   </New>
 </Set>
  .
 .
 .
</Configure>
Tip
title"Reminder"

Don't forget that if you want to persist the sessions from multiple webapps, you'll need to configure a separate HashSessionManager for each, and naturally each should have a different value for storeDirectory.

...

Code Block
xml
xml
<plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>maven-jetty-plugin</artifactId>
        <version>6.1.6</version>
        <configuration>
          <scanIntervalSeconds>1</scanIntervalSeconds>
          <webAppConfig>
<webAppConfig implementation="org.mortbay.jetty.plugin.Jetty6PluginWebAppContext">
            <contextPath>/foo</contextPath>
            .
            .
            .
            <sessionHandler implementation="org.mortbay.jetty.servlet.SessionHandler">
              <sessionManager implementation="org.mortbay.jetty.servlet.HashSessionManager">
                <storeDirectory>${basedir}/target/your/sessions/go/here</storeDirectory>
              </sessionManager>
            </sessionHandler>
            .
            .
            .
          </webAppConfig>
        </configuration>
</plugin>
Contact the core Jetty developers at www.webtide.com
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery