1
2
3 package com.pnpconsult.zeiterfassung.helper;
4
5 import javax.servlet.http.HttpServletRequest;
6
7 import org.apache.commons.logging.Log;
8 import org.apache.commons.logging.LogFactory;
9
10 import com.pnpconsult.zeiterfassung.table.Table;
11
12 /***
13 * @author <a href="mailto:powerpete@users.sf.net">Moritz Petersen</a>
14 * @version $Id: TableManager.java,v 1.5 2004/06/24 20:54:18 powerpete Exp $
15 */
16 public class TableManager
17 {
18 private static final Log LOG = LogFactory.getLog(TableManager.class);
19 private static final String TABLE_SESSION_KEY = "table";
20
21 public void put(HttpServletRequest request, Table table)
22 {
23 if (request == null)
24 {
25 LOG.debug("Strange: request is null. Cannot store the table.");
26 return;
27 }
28 request.getSession().setAttribute(TABLE_SESSION_KEY, table);
29 }
30
31 public Table get(HttpServletRequest request)
32 {
33 return (Table) request.getSession().getAttribute(TABLE_SESSION_KEY);
34 }
35 }