1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
public class EtatServeurAction extends org.apache.struts.action.Action {
public void EtatServeurAction() throws Exception
{
Tempo_normal tn=new Tempo_normal();
tn.Tempo_normal();
Tempo_panne tp=new Tempo_panne();
tp.Tempo_panne();
}
/* forward name="success" path="" */
private final static String SUCCESS = "success";
/**
* This is the action called from the Struts framework.
* @param mapping The ActionMapping used to select this instance.
* @param form The optional ActionForm bean for this request.
* @param request The HTTP Request we are processing.
* @param response The HTTP Response we are processing.
* @throws java.lang.Exception
* @return
*/
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
HttpSession session=request.getSession();
ConnexionBD bd=new ConnexionBD();
EtatServeurForm es;
List<EtatServeurForm> st=new ArrayList();
bd.lire("select * from serveurs");
while(bd.résultat.next())
{
String nom=bd.résultat.getString("nom_serveur");
String etat=bd.résultat.getString("etat");
String cpu=bd.résultat.getString("cpu");
String hdd=bd.résultat.getString("hdd");
es=new EtatServeurForm(nom,etat,cpu,hdd);
st.add(es);
}
session.setAttribute("serveurs", st);
return mapping.findForward(SUCCESS);
}
} |