1
2
3
4
5 package example.struts;
6
7 import org.apache.struts.action.*;
8
9 import example.filestorage.*;
10
11 import javax.servlet.http.*;
12 import java.util.*;
13
14 /***
15 *
16 * @author Sean C. Sullivan
17 *
18 *
19 *
20 */
21 public class ListFilesAction extends Action
22 {
23 public ActionForward execute(ActionMapping mapping,
24 ActionForm form,
25 HttpServletRequest request,
26 HttpServletResponse response) throws Exception
27 {
28 FileStorageDAO dao = DAOFactory.getFileStorageDAO();
29 List files = dao.getAllFiles();
30 request.setAttribute("files", files);
31
32 return mapping.findForward(Forward.KEY_SUCCESS);
33 }
34
35 }