source: ether_statistics/service/implementation/com/medias/megapoli/struts/actions/JeuxAccessAction.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.JeuxForm;
11import com.medias.megapoli.trade.ListeJeuxAdapter;
12
13/**
14 * @author pignot
15 *
16 * Action déclenchée au moment d'afficher la liste des jeux
17 */
18public class JeuxAccessAction extends Action {
19    public ActionForward execute(ActionMapping mapping, ActionForm form,
20            HttpServletRequest request, HttpServletResponse response)
21            throws ServletException {
22        ListeJeuxAdapter adapter = new ListeJeuxAdapter();
23        String target = "failure";
24        ActionErrors errors = new ActionErrors();
25        if (form != null) {
26            JeuxForm jform = (JeuxForm) form;
27            try {
28                // A partir de la base de données ...
29                adapter.loadJeuxFromDatabase(jform);
30                target = "success";
31            } catch (Exception e) {
32                System.out.println("exception_JeuxAccessAction");
33                errors.add(ActionErrors.GLOBAL_MESSAGE, new ActionError("errors.access.requete.fail"));
34                e.printStackTrace();
35            }
36        }
37        if (!errors.isEmpty()) {
38            saveErrors(request, errors);
39        }
40        return mapping.findForward(target);
41    }
42}
Note: See TracBrowser for help on using the repository browser.