package com.servlets; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.lang.*; import java.util.Vector; import com.articles.Article; import com.articles.ArticlePanier; import com.gestionnaires.Erreur; import com.gestionnaires.GestionnairePanier; public class Panier extends HttpServlet { com.gestionnaires.GestionnaireArticles gestArts = null; private void traiteRequeteHttp(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session = request.getSession(true); Vector vArtsPan = null; Vector
vArts = new Vector
(); Article tmpArt = null; String sAction; String sPageAffichage; GestionnairePanier panier = (GestionnairePanier)session.getAttribute("caddy"); if ( panier == null ) { panier = new GestionnairePanier(); session.setAttribute("caddy", panier) ; } sAction = request.getParameter("action"); if (sAction == null) { ; } else if (sAction.equals("add")) { panier.ajouterAchat(request.getParameter("artRef"), Integer.parseInt(request.getParameter("artQuant"))); } else if (sAction.equals("del")) { panier.enleverAchat(request.getParameter("artRef")); } vArtsPan = panier.donneContenu(); for (int i=0; i