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

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

Nouveau projet

File size: 1.5 KB
Line 
1/*
2 * Created on 3 mai 2005
3 */
4package com.medias.megapoli.struts.actions;
5
6import javax.servlet.ServletException;
7import javax.servlet.http.*;
8
9import org.apache.struts.action.*;
10import com.medias.megapoli.struts.forms.ParametreForm;
11import com.medias.megapoli.trade.ParametreAdapter;
12
13/**
14 * @author pignot
15 *
16 * Action déclenchée au moment d'afficher la description d'un paramÚtre
17 */
18public class DescParametreAction extends Action {
19    public ActionForward execute(ActionMapping mapping, ActionForm form,
20            HttpServletRequest request, HttpServletResponse response)
21            throws ServletException {
22        ParametreAdapter adapter = new ParametreAdapter();
23        String target = "failure";
24        ActionErrors errors = new ActionErrors();
25
26        if (form != null) {
27            ParametreForm pform = (ParametreForm) form;
28            String id = request.getParameter("idParam");
29            try {
30                // A partir de la base de données ...
31                adapter.loadParametreFromDatabase(pform, id);
32                target = "success";
33            } catch (Exception e) {
34                System.out.println("exception_DescParametreAction");
35                errors.add(ActionErrors.GLOBAL_MESSAGE, new ActionError(
36                        "errors.access.requete.fail"));
37                e.printStackTrace();
38            }
39        }
40        if (!errors.isEmpty()) {
41            saveErrors(request, errors);
42        }
43        return mapping.findForward(target);
44    }
45}
Note: See TracBrowser for help on using the repository browser.