package test; import java.io.*; import java.util.Map; import java.util.Hashtable; import javax.servlet.*; import javax.servlet.http.*; public class Result extends HttpServlet { public void doPost( HttpServletRequest requete, HttpServletResponse reponse ) throws ServletException, IOException { // initialisation RequestDispatcher dispatcher; HttpSession session = requete.getSession(); Integer result = (Integer) session.getAttribute( "result" ); // une erreur s'est produite? if ( result == null ) { dispatcher = getServletContext().getNamedDispatcher( "Error" ); dispatcher.forward( requete, reponse ); } else { // termine la session session.invalidate(); // affiche le résultat reponse.setContentType( "text/html; charset=\"UTF-8\"" ); PrintWriter doc = reponse.getWriter(); doc.println( "" ); doc.println( "" ); doc.println( "
" ); doc.println( "" ); doc.println( "
" ); doc.println( " " ); doc.println( "