1 23 package org.jresearch.gossip.actions.subscription; 24 25 import java.sql.SQLException ; 26 27 import javax.servlet.http.HttpServletRequest ; 28 import javax.servlet.http.HttpServletResponse ; 29 import javax.servlet.http.HttpSession ; 30 31 import org.apache.struts.action.ActionForm; 32 import org.apache.struts.action.ActionForward; 33 import org.apache.struts.action.ActionMapping; 34 import org.jresearch.gossip.IConst; 35 import org.jresearch.gossip.actions.BaseAction; 36 import org.jresearch.gossip.beans.user.User; 37 import org.jresearch.gossip.dao.ForumDAO; 38 import org.jresearch.gossip.exception.SystemException; 39 import org.jresearch.gossip.forms.ProcessTopicForm; 40 41 46 public class SubscribeAction extends BaseAction { 47 55 public ActionForward process(ActionMapping mapping, ActionForm form, 56 HttpServletRequest request, HttpServletResponse response) 57 throws SystemException { 58 HttpSession session = request.getSession(); 59 User user = (User) session.getAttribute(IConst.SESSION.USER_KEY); 60 ProcessTopicForm ptForm = (ProcessTopicForm) form; 61 ForumDAO dao = ForumDAO.getInstance(); 62 try { 63 64 dao.subscribe(ptForm.getTid(), user.getInfo().getEmail(), user 65 .getName()); 66 setStatusMessage(request, "mails.CONFIRM_SUBSCR"); 67 } catch (SQLException sqle) { 68 getServlet().log("Connection.process", sqle); 69 throw new SystemException(sqle); 70 } 71 return (new ActionForward("/ShowThread.do?fid=" + ptForm.getFid() 72 + "&tid=" + ptForm.getTid() + "&block=" + ptForm.getBlock(), 73 true)); 74 } 75 } | Popular Tags |