54 lines
1.8 KiB
Java
54 lines
1.8 KiB
Java
|
import java.io.IOException;
|
||
|
import javax.servlet.RequestDispatcher;
|
||
|
import javax.servlet.ServletContext;
|
||
|
import javax.servlet.ServletException;
|
||
|
import javax.servlet.ServletRequest;
|
||
|
import javax.servlet.http.HttpServletRequest;
|
||
|
import javax.servlet.http.HttpServletResponse;
|
||
|
/*import MesHaricots.utilisateur;
|
||
|
/**
|
||
|
* * Servlet implementation class for Servlet: ServTest
|
||
|
* *
|
||
|
* */
|
||
|
public class ServletController extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
|
||
|
static final long serialVersionUID = 1L;
|
||
|
|
||
|
/* (non-Java-doc)
|
||
|
* * @see javax.servlet.http.HttpServlet#HttpServlet()
|
||
|
* */
|
||
|
public ServletController() {
|
||
|
super();
|
||
|
}
|
||
|
|
||
|
/* (non-Java-doc)
|
||
|
* * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
|
||
|
* */
|
||
|
protected void doGet(HttpServletRequest requete, HttpServletResponse reponse)
|
||
|
throws ServletException, IOException {
|
||
|
String jspPage = "/vues/loginForm.jsp";
|
||
|
ServletContext sc = getServletContext();
|
||
|
RequestDispatcher rd = sc.getRequestDispatcher(jspPage);
|
||
|
rd.forward(requete,reponse);
|
||
|
|
||
|
}
|
||
|
|
||
|
/* (non-Java-doc)
|
||
|
* * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
|
||
|
* */
|
||
|
protected void doPost(HttpServletRequest requete, HttpServletResponse reponse)
|
||
|
throws ServletException, IOException {
|
||
|
|
||
|
String identifiant = requete.getParameter("id");
|
||
|
|
||
|
String jspPage = "/vues/salut.jsp";
|
||
|
ServletContext sc = getServletContext();
|
||
|
RequestDispatcher rd = sc.getRequestDispatcher(jspPage);
|
||
|
/* utilisateur user = new utilisateur();
|
||
|
user.setId(identifiant);
|
||
|
requete.setAttribute("monUtilisateur", user);*/
|
||
|
rd.forward(requete,reponse);
|
||
|
|
||
|
// TODO Auto-generated method stub
|
||
|
}
|
||
|
}
|