1
2
3
4
5 package hu.elte.tribus.action;
6
7 import hu.elte.tribus.interfaces.QaDao;
8 import hu.elte.tribus.interfaces.UserDao;
9 import hu.elte.tribus.util.AuthUtil;
10
11 import javax.servlet.http.HttpServletRequest;
12 import javax.servlet.http.HttpServletResponse;
13
14 import org.apache.struts.action.ActionForm;
15 import org.apache.struts.action.ActionForward;
16 import org.apache.struts.action.ActionMapping;
17 import org.springframework.web.struts.ActionSupport;
18
19 /***
20 * MyEclipse Struts Creation date: 11-10-2006
21 *
22 * XDoclet definition:
23 *
24 * @struts.action validate="true"
25 */
26 public class ListTopicsAction extends ActionSupport{
27
28
29
30
31 /***
32 * Method execute
33 *
34 * @param mapping
35 * @param form
36 * @param request
37 * @param response
38 * @return ActionForward
39 */
40 public ActionForward execute(ActionMapping mapping, ActionForm form,
41 HttpServletRequest request, HttpServletResponse response) {
42 QaDao qaDao = (QaDao) getWebApplicationContext().getBean("qaDao");
43 UserDao userDao = (UserDao) getWebApplicationContext().getBean("userDao");
44 request.setAttribute("topics", qaDao.getTopicList());
45 request.setAttribute("user", userDao.getUser(AuthUtil.getCurentUserName()));
46 return mapping.findForward("ok");
47 }
48 }