1 | package com.medias.megapoli.struts.actions; |
---|
2 | |
---|
3 | import javax.servlet.ServletException; |
---|
4 | import javax.servlet.http.HttpServletRequest; |
---|
5 | import javax.servlet.http.HttpServletResponse; |
---|
6 | |
---|
7 | import org.apache.struts.action.Action; |
---|
8 | import org.apache.struts.action.ActionError; |
---|
9 | import org.apache.struts.action.ActionErrors; |
---|
10 | import org.apache.struts.action.ActionForm; |
---|
11 | import org.apache.struts.action.ActionForward; |
---|
12 | import org.apache.struts.action.ActionMapping; |
---|
13 | import com.medias.xml.hierarchie.Hierarchie; |
---|
14 | |
---|
15 | |
---|
16 | /** |
---|
17 | * @author combaz |
---|
18 | * |
---|
19 | * Created on 24 févr. 2005 |
---|
20 | */ |
---|
21 | public class PrepareTreeAccessAction extends Action { |
---|
22 | public ActionForward execute (ActionMapping mapping,ActionForm form, |
---|
23 | HttpServletRequest request, HttpServletResponse response) |
---|
24 | throws ServletException { |
---|
25 | String target = "failure"; |
---|
26 | ActionErrors errors = new ActionErrors(); |
---|
27 | |
---|
28 | Hierarchie tree = (Hierarchie) request.getSession().getServletContext().getAttribute("APP_ACCESSTREE"); |
---|
29 | try { |
---|
30 | tree.createTreeView(); |
---|
31 | target="success"; |
---|
32 | } |
---|
33 | catch(Exception e) { |
---|
34 | System.out.println ("exception_prepareTreeAccessAction"); |
---|
35 | errors.add(ActionErrors.GLOBAL_MESSAGE, new ActionError("errors.upload.prepareFileList.failed")); |
---|
36 | e.printStackTrace(); |
---|
37 | } |
---|
38 | |
---|
39 | if(!errors.isEmpty()){ |
---|
40 | saveErrors(request, errors); |
---|
41 | } |
---|
42 | |
---|
43 | return mapping.findForward(target); |
---|
44 | } |
---|
45 | } |
---|