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
| import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @author Opa
*/
@WebServlet("/AjouterUser")
public class AjouterUser extends HttpServlet{
private static final long serialVersionUID = 1L;
public AjouterUser() {
super();
// TODO Auto-generated constructor stub
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
this.getServletContext().getRequestDispatcher("/deposit-pos-marchand.jsp").forward(request, response);
this.getServletContext().getRequestDispatcher("/cash-in-wari.jsp").forward(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String Nom = request.getParameter("Nom");
String Prenom = request.getParameter("Prenom");
String Email = request.getParameter("Email");
String Telephone = request.getParameter("Telephone");
String MotDePasse = request.getParameter("MotDePasse");
String FineName = request.getParameter("FineName");
request.setAttribute("Nom", Nom);
request.setAttribute("Prenom", Prenom);
request.setAttribute("Email", Email);
request.setAttribute("Telephone", Telephone);
request.setAttribute("MotDePasse", MotDePasse);
//insert dans base de données
this.getServletContext().getRequestDispatcher("/"+FineName).forward(request, response);
//this.getServletContext().getRequestDispatcher("/cash-in-wari.jsp").forward(request, response);
}
} |
Partager