source: ether_statistics/service/implementation/com/medias/megapoli/struts/actions/PrepareTreeAccessAction.java @ 569

Last change on this file since 569 was 569, checked in by vmipsl, 12 years ago

Nouveau projet

File size: 1.3 KB
Line 
1package com.medias.megapoli.struts.actions;
2
3import javax.servlet.ServletException;
4import javax.servlet.http.HttpServletRequest;
5import javax.servlet.http.HttpServletResponse;
6
7import org.apache.struts.action.Action;
8import org.apache.struts.action.ActionError;
9import org.apache.struts.action.ActionErrors;
10import org.apache.struts.action.ActionForm;
11import org.apache.struts.action.ActionForward;
12import org.apache.struts.action.ActionMapping;
13import com.medias.xml.hierarchie.Hierarchie;
14
15
16/**
17 * @author combaz
18 *
19 * Created on 24 févr. 2005
20 */
21public 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}
Note: See TracBrowser for help on using the repository browser.