Line | |
---|
1 | /* |
---|
2 | * Created on 3 mai 2005 |
---|
3 | */ |
---|
4 | package com.medias.megapoli.struts.actions; |
---|
5 | |
---|
6 | import javax.servlet.ServletException; |
---|
7 | import javax.servlet.http.*; |
---|
8 | |
---|
9 | import org.apache.struts.action.*; |
---|
10 | import com.medias.megapoli.struts.forms.ParametresForm; |
---|
11 | import 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 | */ |
---|
18 | public 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.