@Override public String execute() { session = ActionContext.getContext().getSession(); SessionFactory sf = (SessionFactory) servletContext.getAttribute("SessionFactory"); ForumInformationImplementation insert = new ForumInformationImplementation(sf); if (session.containsKey("USERBEAN")) { userInformation = (userInformation) session.get("USERBEAN"); String category = forum.getCategory(); forumList = insert.getForumsFromDB(category); for (Forum fm : forumList) { System.out.println(fm.getDescription()); } return SUCCESS; } else { // Change to error later return SUCCESS; } }
public String executeMyList() { session = ActionContext.getContext().getSession(); SessionFactory sf = (SessionFactory) servletContext.getAttribute("SessionFactory"); ForumInformationImplementation fi = new ForumInformationImplementation(sf); if (session.containsKey("USERBEAN")) { userInformation = (userInformation) session.get("USERBEAN"); String category = forum.getCategory(); myForumList = fi.getMyForumsFromDB(category, userInformation.getUserID()); for (Forum fm : myForumList) { System.out.println(fm.getDescription()); } // myMemberList= fi.getMyMemberForumsFromDB(category,userInformation.getUserID()); return SUCCESS; } else { // Change to error later return SUCCESS; } }