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
| package action;
import java.io.IOException;
import java.sql.Connection;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import metier.Personne;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import javax.sql.DataSource;
import form.InscriptionForm;
public class ConfirmeAction extends Action {
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
InscriptionForm myForm = (InscriptionForm) form;
Personne pers = new Personne();
DataSource ds = getDataSource(request, "myBase");
Connection cnx = ds.getConnection();
pers.setNom(myForm.getNom());
pers.setMdp(myForm.getMdp());
return pers.insertPersonne(mapping, cnx);
}
} |
Partager