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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
| import java.util.List;
import java.util.Iterator;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
//necessaire pour le traitement xml
import org.jdom.*;
import org.jdom.input.*;
import org.jdom.output.*;
import org.jdom.filter.*;
//conversion html
import javax.xml.transform.*;
import java.net.*;
import java.io.*;
/**
* Servlet implementation class for Servlet: TableauDeBord
*
*/
public class TableauDeBord extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
static final long serialVersionUID = 1L;
private static SAXBuilder sxb;
private static Element racine;
private static Document doc;
List ListePersonne ;
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#HttpServlet()
*/
public TableauDeBord() {
super();
}
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
getServletContext().getRequestDispatcher("/TableauDeBord.jsp").forward(request,response);
}
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//récuperation des informations
String nom = request.getParameter("txtNom").toString();
String passwd = request.getParameter("txtPsswd");
boolean verifOK=false;
if (nom=="r")
{
getServletContext().getRequestDispatcher("/hello.jsp").forward(request,response);
}
else
{
getServletContext().getRequestDispatcher("/TableauDeBord.jsp").forward(request,response);
}
}
} |
Partager