1 package org.nextime.ion.backoffice.action.resource; 2 3 import java.io.IOException ; 4 5 import javax.servlet.ServletException ; 6 import javax.servlet.http.HttpServletRequest ; 7 import javax.servlet.http.HttpServletResponse ; 8 import org.apache.struts.action.ActionForm; 9 import org.apache.struts.action.ActionForward; 10 import org.apache.struts.action.ActionMapping; 11 import org.nextime.ion.backoffice.action.BaseAction; 12 import org.nextime.ion.backoffice.bean.ResourceXmlBean; 13 import org.nextime.ion.backoffice.bean.Resources; 14 15 public class ResourceManagementAction extends BaseAction { 16 17 public ActionForward perform( 18 ActionMapping mapping, 19 ActionForm form, 20 HttpServletRequest request, 21 HttpServletResponse response) 22 throws IOException , ServletException { 23 24 checkUser(request); 26 27 if (request.getParameter("select") != null) { 28 request.getSession().setAttribute( 29 "selectedResources", 30 request.getParameter("select")); 31 32 } 33 34 String selected = 35 (String ) request.getSession().getAttribute("selectedResources"); 36 try { 37 if (selected == null) { 38 selected = 39 ((ResourceXmlBean) Resources 40 .getResourceXmlBeans(servlet) 41 .get(0)) 42 .getId(); 43 } 44 request.getSession().setAttribute("selectedResources", selected); 45 } catch (Exception e) { 46 e.printStackTrace(); 47 } 48 49 return (mapping.findForward("view")); 51 52 } 53 54 } 55 | Popular Tags |