1 package org.sourceforge.vlibrary.user.actions;
2
3 import java.util.ArrayList;
4 import javax.servlet.http.HttpServletRequest;
5 import javax.servlet.http.HttpServletResponse;
6 import org.apache.struts.action.ActionForm;
7 import org.apache.struts.action.ActionForward;
8 import org.apache.struts.action.ActionMapping;
9 import org.apache.struts.util.MessageResources;
10 import org.apache.log4j.Logger;
11
12 import org.sourceforge.vlibrary.Constants;
13 import org.sourceforge.vlibrary.exceptions.LibraryException;
14 import org.sourceforge.vlibrary.user.forms.ManageReaderForm;
15
16
17
18
19
20 public class PrepareManageReaderAction extends LibraryAction {
21
22 private static Logger logger =
23 Logger.getLogger(PrepareManageReaderAction.class.getName());
24
25
26
27
28
29
30
31
32
33
34
35
36 public ActionForward executeAction(ActionMapping mapping,
37 ActionForm form,
38 HttpServletRequest request,
39 HttpServletResponse response,
40 MessageResources messages)
41 throws Exception {
42
43 ArrayList errors = new ArrayList();
44
45 try {
46
47
48 ManageReaderForm frm = (ManageReaderForm) form;
49
50 frm.setReaders(libraryManager.getReaders());
51
52
53 frm.setAction(Constants.UPDATE);
54 } catch (Throwable t) {
55 String errString = messages.getMessage("error.readers.retrieve");
56
57 logger.error(errString,t);
58
59 errors.add(new LibraryException(errString,t));
60 }
61
62 return standardForward(mapping,request,errors);
63 }
64 }