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

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

Nouveau projet

File size: 1.4 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.ParametresForm;
11import com.medias.megapoli.trade.ListeParametresAdapter;
12
13/**
14 * @author pignot
15 *
16 * Action déclenchée au moment d'afficher la liste des paramÚtres
17 */
18public class ParametresAccessAction_toDELETE
19        extends Action {
20    public ActionForward execute(ActionMapping mapping, ActionForm form,
21            HttpServletRequest request, HttpServletResponse response)
22            throws ServletException {
23        ListeParametresAdapter adapter = new ListeParametresAdapter();
24
25        String target = "failure";
26        ActionErrors errors = new ActionErrors();
27
28        if (form != null) {
29            ParametresForm pform = (ParametresForm) form;
30            try {
31                // A partir de la base de données ...
32                adapter.loadParametresFromDatabase( pform );
33                target = "success";
34            } catch (Exception e) {
35                System.out.println("exception_ParametresAccessAction");
36                errors.add(ActionErrors.GLOBAL_MESSAGE, new ActionError("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.