1 25 29 package org.jresearch.gossip.actions.admin.forum; 30 31 import java.sql.SQLException ; 32 33 import javax.servlet.http.HttpServletRequest ; 34 import javax.servlet.http.HttpServletResponse ; 35 36 import org.apache.struts.action.ActionForm; 37 import org.apache.struts.action.ActionForward; 38 import org.apache.struts.action.ActionMapping; 39 import org.jresearch.gossip.actions.BaseAction; 40 import org.jresearch.gossip.beans.forum.Forum; 41 import org.jresearch.gossip.dao.ForumDAO; 42 import org.jresearch.gossip.exception.SystemException; 43 import org.jresearch.gossip.forms.ForumForm; 44 import org.jresearch.gossip.forms.ProcessForumForm; 45 46 51 public class EditForumAction extends BaseAction { 52 66 public ActionForward process(ActionMapping mapping, ActionForm form, 67 HttpServletRequest request, HttpServletResponse response) 68 throws SystemException { 69 ForumDAO dao = ForumDAO.getInstance(); 70 ProcessForumForm pfForm = (ProcessForumForm) form; 71 72 try { 73 74 Forum forum = dao.getForumInfo(Integer.parseInt(pfForm.getFid())); 75 ForumForm forumForm = new ForumForm(); 76 forumForm.setForum_desc(forum.getDescription()); 77 forumForm.setForum_name(forum.getTitle()); 78 forumForm.setForumid(pfForm.getFid()); 79 forumForm.setGroupid(Integer.toString(forum.getGroupid())); 80 forumForm.setForum_sort(forum.getSort()); 81 request.setAttribute("forumForm", forumForm); 82 } catch (SQLException sqle) { 83 getServlet().log("Connection.process", sqle); 84 throw new SystemException(sqle); 85 } 86 87 return (mapping.findForward("editForum")); 88 } 89 } 90 | Popular Tags |