View Javadoc
1   package org.itracker.web.util;
2   
3   import org.apache.log4j.Logger;
4   import org.apache.struts.action.ActionForward;
5   import org.apache.struts.action.ActionMapping;
6   import org.itracker.model.Component;
7   
8   import javax.servlet.http.HttpServletRequest;
9   
10  public class EditComponentFormActionUtil {
11      private static final Logger log = Logger.getLogger(EditComponentFormActionUtil.class);
12  
13      public static ActionForward init(ActionMapping mapping, HttpServletRequest request) {
14          log.debug("Getting component from session");
15          final Component component = (Component) request.getSession().getAttribute(Constants.COMPONENT_KEY);
16          log.debug("Checking if component is new");
17          final boolean isNew = component.isNew();
18          log.debug("Putting component" + component.getName() + " and isNew back into the request");
19          request.setAttribute("component", component);
20          request.setAttribute("isNew", isNew);
21          return null;
22      }
23  
24  }