1 16 package com.blandware.atleap.webapp.action.core.grid; 17 18 import com.blandware.atleap.webapp.action.core.BaseAction; 19 import com.blandware.atleap.webapp.taglib.core.grid.util.Grid; 20 import com.blandware.atleap.webapp.taglib.core.util.TaglibConstants; 21 22 import javax.servlet.http.HttpSession ; 23 import java.util.Collections ; 24 import java.util.HashMap ; 25 import java.util.Map ; 26 27 37 public class BaseGridAction extends BaseAction { 38 39 46 protected Grid getGridByName(String gridName, HttpSession session) { 47 Grid grid = null; 48 Map grids = (Map ) session.getAttribute(TaglibConstants.GRIDS); 49 if ( grids != null ) { 50 grid = (Grid) grids.get(gridName); 51 } 52 return grid; 53 } 54 55 61 protected void saveGrid(Grid grid, HttpSession session) { 62 Map grids = (Map ) session.getAttribute(TaglibConstants.GRIDS); 63 if ( grids == null ) { 64 grids = Collections.synchronizedMap(new HashMap ()); 65 } 66 grids.put(grid.getName(), grid); 67 session.setAttribute(TaglibConstants.GRIDS, grids); 68 } 69 70 } | Popular Tags |