1 23 27 package org.jresearch.gossip.actions.admin.group; 28 29 import java.sql.SQLException ; 30 31 import javax.servlet.http.HttpServletRequest ; 32 import javax.servlet.http.HttpServletResponse ; 33 34 import org.apache.struts.action.ActionForm; 35 import org.apache.struts.action.ActionForward; 36 import org.apache.struts.action.ActionMapping; 37 import org.apache.struts.action.ActionMessage; 38 import org.apache.struts.action.ActionMessages; 39 import org.jresearch.gossip.actions.admin.ManageGroupForumAction; 40 import org.jresearch.gossip.dao.ForumDAO; 41 import org.jresearch.gossip.exception.SystemException; 42 import org.jresearch.gossip.forms.GroupForm; 43 44 49 public class UpdateGroupAction extends ManageGroupForumAction { 50 64 public ActionForward process(ActionMapping mapping, ActionForm form, 65 HttpServletRequest request, HttpServletResponse response) 66 throws SystemException { 67 GroupForm gForm = (GroupForm) form; 68 ActionMessages errors = new ActionMessages(); 69 if (gForm.getGid().equals("")) { 70 errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( 71 "errors.required", "group ID")); 72 } 73 if (!errors.isEmpty()) { 74 saveErrors(request, errors); 75 return (mapping.getInputForward()); 76 } 77 ForumDAO dao = ForumDAO.getInstance(); 78 try { 79 80 dao.updateGroup(gForm); 81 log(request, "logs.LOG18", gForm.getGroup_name()); 82 } catch (SQLException sqle) { 83 getServlet().log("Connection.process", sqle); 84 throw new SystemException(sqle); 85 } 86 return (new ActionForward("/ShowGroupList.do")); 87 } 88 } | Popular Tags |