Grosse MàJ

This commit is contained in:
olivier
2008-11-25 22:11:16 +01:00
parent 53195fdfcd
commit 3e719157ea
2980 changed files with 343846 additions and 0 deletions

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="TOMCAT_HOME/lib/servlet-api.jar"/>
<classpathentry kind="var" path="TOMCAT_HOME/lib/jasper.jar"/>
<classpathentry kind="var" path="TOMCAT_HOME/lib/jsp-api.jar"/>
<classpathentry kind="var" path="TOMCAT_HOME/lib/el-api.jar"/>
<classpathentry kind="var" path="TOMCAT_HOME/lib/annotations-api.jar"/>
<classpathentry kind="src" path="WEB-INF/src"/>
<classpathentry kind="src" output="work" path="work"/>
<classpathentry kind="output" path="WEB-INF/classes"/>
</classpath>

View File

@ -0,0 +1 @@
work

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>RandoOnLine</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>com.sysdeo.eclipse.tomcat.tomcatnature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<tomcatProjectProperties>
<rootDir>/</rootDir>
<exportSource>false</exportSource>
<reloadable>true</reloadable>
<redirectLogger>false</redirectLogger>
<updateXml>true</updateXml>
<warLocation></warLocation>
<extraInfo></extraInfo>
<webPath>/RandoOnLine</webPath>
</tomcatProjectProperties>

View File

@ -0,0 +1 @@
classes

View File

@ -0,0 +1,39 @@
package com.gestionnaires;
public class ParametresConnexion
{
public String Serveur = "grive.u-strabg.fr";
public String Port = "1521";
public String Base = "v920";
public String Utilisateur = "dut";
public String Pwd = "dut";
public String Url = "jdbc:oracle:thin:";
public static final String CLASSE = "oracle.jdbc.driver.OracleDriver";
public ParametresConnexion() { ; }
public ParametresConnexion( ParametresConnexion params )
{
this.CopierDepuis(params);
}
public ParametresConnexion(String serveur, String port, String base,
String utilisateur, String pwd, String url)
{
this.Serveur = serveur;
this.Port = port;
this.Base = base;
this.Utilisateur = utilisateur;
this.Pwd = pwd;
this.Url = url;
}
public void CopierDepuis( ParametresConnexion params )
{
this.Serveur = params.Serveur;
this.Port = params.Port;
this.Base = params.Base;
this.Utilisateur = params.Utilisateur;
this.Pwd = params.Pwd;
this.Url = params.Url;
}
}

View File

@ -0,0 +1,80 @@
package com.articles;
public class Article
{
private String ref = "";
private String categ = "";
private String marque = "";
private String modele = "";
private double prix = 0;
private String photo = "";
private String description = "";
private int quantite = 0;
public String getRef()
{
return this.ref;
}
public String getCateg()
{
return this.categ;
}
public String getMarque()
{
return this.marque;
}
public String getModele()
{
return this.modele;
}
public double getPrix()
{
return this.prix;
}
public String getPhoto()
{
return this.photo;
}
public String getDescription()
{
return this.description;
}
public void setRef(String ref)
{
this.ref = ref;
}
public void setCateg(String categ)
{
this.categ = categ;
}
public void setMarque(String marque)
{
this.marque = marque;
}
public void setModele(String modele)
{
this.modele = modele;
}
public void setPrix(double prix)
{
this.prix = prix;
}
public void setPhoto(String photo)
{
this.photo = photo;
}
public void setDescription(String description)
{
this.description = description;
}
public int getQuantite()
{
return this.quantite;
}
public void setQuantite(int quantite)
{
this.quantite = quantite;
}
}

View File

@ -0,0 +1,90 @@
/*
* article.java
*
* Created on 18 janvier 2008, 14:26
*/
package com.articles;
/**
* Article de la base de donn<6E>e, avec la quantit<69> en plus
* @author 3fvorillion
*/
public class Article
{
private String ref = "";
private String categ = "";
private String marque = "";
private String modele = "";
private double prix = 0;
private String photo = "";
private String description = "";
private int quantite = 0;
public String getRef()
{
return this.ref;
}
public String getCateg()
{
return this.categ;
}
public String getMarque()
{
return this.marque;
}
public String getModele()
{
return this.modele;
}
public double getPrix()
{
return this.prix;
}
public String getPhoto()
{
return this.photo;
}
public String getDescription()
{
return this.description;
}
public void setRef(String ref)
{
this.ref = ref;
}
public void setCateg(String categ)
{
this.categ = categ;
}
public void setMarque(String marque)
{
this.marque = marque;
}
public void setModele(String modele)
{
this.modele = modele;
}
public void setPrix(double prix)
{
this.prix = prix;
}
public void setPhoto(String photo)
{
this.photo = photo;
}
public void setDescription(String description)
{
this.description = description;
}
public int getQuantite()
{
return this.quantite;
}
public void setQuantite(int quantite)
{
this.quantite = quantite;
}
}

View File

@ -0,0 +1,37 @@
package com.articles;
public class Categorie
{
private int id = 0;
private String cat = "";
public Categorie()
{
;
}
public Categorie(int id, String cat)
{
this.id = id;
this.cat = cat;
}
public int getId()
{
return this.id;
}
public void setId(int id)
{
this.id = id;
}
public String getCat()
{
return this.cat;
}
public void setCat(String cat)
{
this.cat = cat;
}
}

View File

@ -0,0 +1,41 @@
package com.articles;
/**
* Cat<61>gorie de la base de donn<6E>e
* @author 3fvorillion
*/
public class Categorie
{
private int id = 0;
private String cat = "";
public Categorie()
{
;
}
public Categorie(int id, String cat)
{
this.id = id;
this.cat = cat;
}
public int getId()
{
return this.id;
}
public void setId(int id)
{
this.id = id;
}
public String getCat()
{
return this.cat;
}
public void setCat(String cat)
{
this.cat = cat;
}
}

View File

@ -0,0 +1,60 @@
package com.articles;
public class Client
{
private String nom = "";
private String prenom = "";
private String adresse = "";
private String codePost = "";
private String ville = "";
public String getNom()
{
return this.nom;
}
public void setNom(String nom)
{
this.nom = nom;
}
public String getPrenom()
{
return this.prenom;
}
public void setPrenom(String prenom)
{
this.prenom = prenom;
}
public String getAdresse()
{
return this.adresse;
}
public void setAdresse(String adresse)
{
this.adresse = adresse;
}
public String getCodePost()
{
return this.codePost;
}
public void setCodePost(String codePost)
{
this.codePost = codePost;
}
public String getVille()
{
return this.ville;
}
public void setVille(String ville)
{
this.ville = ville;
}
}

View File

@ -0,0 +1,64 @@
package com.articles;
/**
* Client qui ach<63>te des articles
* @author 3fvorillion
*/
public class Client
{
private String nom = "";
private String prenom = "";
private String adresse = "";
private String codePost = "";
private String ville = "";
public String getNom()
{
return this.nom;
}
public void setNom(String nom)
{
this.nom = nom;
}
public String getPrenom()
{
return this.prenom;
}
public void setPrenom(String prenom)
{
this.prenom = prenom;
}
public String getAdresse()
{
return this.adresse;
}
public void setAdresse(String adresse)
{
this.adresse = adresse;
}
public String getCodePost()
{
return this.codePost;
}
public void setCodePost(String codePost)
{
this.codePost = codePost;
}
public String getVille()
{
return this.ville;
}
public void setVille(String ville)
{
this.ville = ville;
}
}

View File

@ -0,0 +1,25 @@
package com.articles;
public class Panier
{
private double prixTotal = 0;
public Panier()
{
;
}
public Panier(double prixTotal)
{
this.prixTotal = prixTotal;
}
public double getPrixTotal()
{
return this.prixTotal;
}
public void setPrixTotal(double prixTotal)
{
this.prixTotal = prixTotal;
}
}

View File

@ -0,0 +1,29 @@
package com.articles;
/**
* Panier du client. Il contient des articles.
* @author 3fvorillion
*/
public class Panier
{
private double prixTotal = 0;
public Panier()
{
;
}
public Panier(double prixTotal)
{
this.prixTotal = prixTotal;
}
public double getPrixTotal()
{
return this.prixTotal;
}
public void setPrixTotal(double prixTotal)
{
this.prixTotal = prixTotal;
}
}

View File

@ -0,0 +1,23 @@
package com.gestionnaires;
public class Erreur
{
private String message = "";
public Erreur()
{}
public Erreur(String message)
{
this.message = message;
}
public String getMessage()
{
return this.message;
}
public void setMessage(String message)
{
this.message = message;
}
}

View File

@ -0,0 +1,27 @@
package com.gestionnaires;
/**
* Beans permettant d'afficher les erreurs dans la page erreurs.jsp
* @author 3fvorillion
*/
public class Erreur
{
private String message = "";
public Erreur()
{}
public Erreur(String message)
{
this.message = message;
}
public String getMessage()
{
return this.message;
}
public void setMessage(String message)
{
this.message = message;
}
}

View File

@ -0,0 +1,429 @@
package com.gestionnaires;
import java.sql.*;
import java.util.Vector;
enum OperationBDD
{
/**
* op&eacute;ration de s&eacute;lection .
*/
OP_BDD_SELECTION,
/**
* op&eacute;ration de cr&eacute;ation de table.
*/
OP_BDD_CREER_TABLE,
/**
* op&eacute;ration de suppression de table.
*/
OP_BDD_SUPPR_TABLE
}
public class GestionConnexion
{
/*
* VARIABLES
*/
// param<61>tres
private ParametresConnexion paramsConn;
// connexion
private Connection connection = null;
private Statement statement = null;
// requ<71>te SQL
private String requeteSQL = "";
private ResultSet resultSet = null;
// erreurs - anomalies
private Vector<String> vs_erreurs = null;
private Vector<String> vs_anomalies = null;
/*
* CONSTRUCTEUR
*/
public GestionConnexion()
throws ClassNotFoundException, Exception
{
/*
* Init les autres variables
*/
this.statement = null;
this.resultSet = null;
this.requeteSQL = "";
this.paramsConn = new ParametresConnexion();
//init la gestion des erreurs - anomalies
this.vs_erreurs = new Vector<String>();
this.vs_anomalies = new Vector<String>();
try
{
// R<>cup<75>ration du driver
Class.forName(ParametresConnexion.CLASSE).newInstance();
}
catch (ClassNotFoundException ex)
{
//remonte l'exception
throw new ClassNotFoundException("La classe '"+ParametresConnexion.CLASSE+"' n'a pas <20>t<EFBFBD> trouv<75>e.");
}
catch (Exception ex)
{
//remonte l'exception
throw ex;
}
}
/*
* METHODES D'INSTANCES
*/
public void ouvrir(ParametresConnexion params)
{
//V<>rifie le param<61>tre
if (params == null)
throw new NullPointerException();
//Copie les param<61>tres
this.paramsConn.CopierDepuis(params);
//Appelle la m<>thode sans param<61>tres
this.ouvrir();
}
public void ouvrir()
{
try
{
// ferme la conexion pr<70>c<EFBFBD>dente
this.fermerConnexion();
// init la nouvelle connexion
this.connection = DriverManager.getConnection(this.paramsConn.Url,
this.paramsConn.Utilisateur, this.paramsConn.Pwd);
this.traiterWarning(this.connection.getWarnings());
}
catch (SQLException ex)
{
this.traiterSQLException(ex);
this.fermerConnexion();
}
}
public boolean estOuverte()
{
boolean bOuverte = false;
try
{
if (this.connection != null)
bOuverte = !this.connection.isClosed();
}
catch (SQLException ex)
{
this.traiterSQLException(ex);
}
return bOuverte;
}
public void fermerRessourcesRequete()
{
try
{
// Ferme le resultSet
if (this.resultSet != null)
{
this.resultSet.close();
this.resultSet = null;
}
// Ferme le statement
if (this.statement != null)
{
this.statement.close();
this.statement = null;
}
// Vide la requ<71>te
this.requeteSQL = "";
}
catch (SQLException ex)
{
this.traiterSQLException(ex);
}
}
public void fermerConnexion()
{
try
{
// Ferme le statement
this.fermerRessourcesRequete();
// Ferme la connexion
if (this.connection != null)
{
this.connection.close();
this.connection = null;
}
}
catch (SQLException ex)
{
this.traiterSQLException(ex);
}
}
public boolean lancerRequeteSelection(String query)
{
boolean res = true;
try
{
// verifie la connexion
if (this.connection != null)
{
// lib<69>re les ressources de la pr<70>c<EFBFBD>dente requ<71>te
this.fermerRessourcesRequete();
// prepare la requete
this.statement = this.connection.createStatement();
this.traiterWarning(this.statement.getWarnings());
// emet la requete
this.resultSet = this.statement.executeQuery(query);
this.traiterWarning(this.resultSet.getWarnings());
// si on est arriv<69> jusqu'ici, c'est qu'il n'y a pas eu de lev<65>e d'exception
// =>actualise la requ<71>te
this.requeteSQL = query;
}
}
catch (SQLException ex)
{
this.traiterSQLException(ex);
// lib<69>re les ressources utilis<69>es
this.fermerRessourcesRequete();
//annonce l'<27>chec de la requ<71>te SQL
res = false;
}
return res;
}
public int lancerRequeteModifBDD(String query)
{
int res = 0;
try
{
// verifie la connexion
if (this.connection != null)
{
// lib<69>re les ressources de la pr<70>c<EFBFBD>dente requ<71>te
this.fermerRessourcesRequete();
// prepare la requete
this.statement = this.connection.createStatement();
// emet la requete
res = this.statement.executeUpdate(query);
this.traiterWarning(this.statement.getWarnings());
// si on est arriv<69> jusqu'ici, c'est qu'il n'y a pas eu de lev<65>e d'exception
// =>actualise la requ<71>te
this.requeteSQL = query;
}
}
catch (SQLException ex)
{
this.traiterSQLException(ex);
// lib<69>re les ressources utilis<69>es
this.fermerRessourcesRequete();
//annonce l'<27>chec de la requ<71>te SQL
res = -1;
}
return res;
}
public ParametresConnexion getParametresConnexion()
{
//Retourne une copie de l'objet contenant les param<61>tres de connexion
return new ParametresConnexion(this.paramsConn);
}
public String getRequeteSQL()
{
return this.requeteSQL;
}
public Vector<String> getInfosConnexion()
{
Vector<String> vs_infosConn = new Vector<String>();
DatabaseMetaData dmd;
try
{
// V<>rifie que la connexion soit ouverte
if (this.estOuverte())
{
// Etat de la connexion
vs_infosConn.add("Etat de la connexion : ouverte");
vs_infosConn.add("------------------------------");
// Obtient les meta-datas de la base
dmd = this.connection.getMetaData();
vs_infosConn.add("Connexion : " + dmd.getURL());
vs_infosConn.add("Driver : " + dmd.getDriverName());
vs_infosConn.add("Version : " + dmd.getDriverVersion());
}
else
{
// Etat de la connexion
vs_infosConn.add("Etat de la connexion : ferm<72>e");
vs_infosConn.add("------------------------------");
vs_infosConn.add("Connexion : " + this.paramsConn.Url);//contient le Serveur, le Port et la Base
vs_infosConn.add("Utilisateur : " + this.paramsConn.Utilisateur);
vs_infosConn.add("Mot de passe : " + this.paramsConn.Pwd.length() + " caract<63>re(s)");
}
}
catch (SQLException ex)
{
// Erreur lors de l'obtention du nom des colonnes
this.traiterSQLException(ex);
}
return vs_infosConn;
}
public Vector<String> getNomsColonnes()
{
Vector<String> vs_cols = new Vector<String>();
ResultSetMetaData rsmd;
try
{
// V<>rifie si la requ<71>te a d<>j&agrave; <20>t<EFBFBD> lanc<6E>e
if (this.resultSet != null)
{
rsmd = this.resultSet.getMetaData(); // obtient les meta-datas de la requ<71>te
int nbrCols = rsmd.getColumnCount();
for (int idCol = 1; idCol <= nbrCols; idCol++)
if (rsmd.isSearchable(idCol))
vs_cols.add(rsmd.getColumnName(idCol));
}
else if (this.statement == null)
// anomalie
this.vs_anomalies.add("Vous n'avez pas encore lanc<6E> la requ<71>te!!");
}
catch (SQLException ex)
{
// Erreur lors de l'obtention du nom des colonnes
this.traiterSQLException(ex);
}
return vs_cols;
}
public Vector<Vector<Object>> getDataVector()
{
Vector<Vector<Object>> v_datas = new Vector<Vector<Object>>();
ResultSetMetaData rsmd;
try
{
rsmd = this.resultSet.getMetaData();
// V<>rifie qu'il y ai un r<>sultat et place le curseur au d<>but
if (rsmd.getColumnCount() > 0)
{
while (this.resultSet.next())
{
Vector<Object> vo_ligne = new Vector<Object>();
// cr<63><72> la ligne
for (int idCol = 1; idCol <= rsmd.getColumnCount(); idCol++)
vo_ligne.add(this.resultSet.getObject(idCol));
// ajoute la ligne au vecteur principal
v_datas.add(vo_ligne);
}
}
if (v_datas.isEmpty()) // anomalie
this.vs_anomalies.add("Aucune donn<6E>e trouv<75>e!!");
}
catch (SQLException ex)
{
// Probleme lors de l'obtention des donnees
this.traiterSQLException(ex);
}
return v_datas;
}
/*
* GESTION DES ERREURS - ANOMALIES
*/
public void traiterSQLException(SQLException ex)
{
String str_ex;
str_ex = "********* SQLException *********\n";
while (ex != null)
{
str_ex = "SQLState : " + ex.getSQLState() + "\n";
str_ex += "Message : " + ex.getMessage() + "\n";
str_ex += "------------------------------\n";
this.vs_erreurs.add(str_ex);
ex = ex.getNextException();
}
}
public void traiterWarning(SQLWarning warn)
{
String str_an;
str_an = "********* SQLWarning *********\n";
while (warn != null)
{
str_an = "SQLState : " + warn.getSQLState() + "\n";
str_an += "Message : " + warn.getMessage() + "\n";
str_an += "------------------------------\n";
this.vs_anomalies.add(str_an);
warn = warn.getNextWarning();
}
}
public Vector<String> getErreurs()
{
return new Vector<String>(this.vs_erreurs);
}
public Vector<String> getAnomalies()
{
return new Vector<String>(this.vs_anomalies);
}
public void effaceErreurs()
{
this.vs_erreurs.clear();
}
public void effaceAnomalies()
{
this.vs_anomalies.clear();
}
}

View File

@ -0,0 +1,522 @@
package com.gestionnaires;
/*
* Remarque : Type de caract<63>res utilis<69>s dans ce fichier : UTF-8
*/
//JDBC
import java.sql.*;
import java.util.Vector;
/**
* Op<4F>rations possibles avec GestionConnexion.
* @author 3fvorillion
*/
enum OperationBDD
{
/**
* op&eacute;ration de s&eacute;lection .
*/
OP_BDD_SELECTION,
/**
* op&eacute;ration de cr&eacute;ation de table.
*/
OP_BDD_CREER_TABLE,
/**
* op&eacute;ration de suppression de table.
*/
OP_BDD_SUPPR_TABLE
}
/**
* Gestionnaire d'une connexion &agrave; une base de donn&eacute;es.
* @author 3fvorillion
*/
public class GestionConnexion
{
/*
* VARIABLES
*/
// param<61>tres
private ParametresConnexion paramsConn;
// connexion
private Connection connection = null;
private Statement statement = null;
// requ<71>te SQL
private String requeteSQL = "";
private ResultSet resultSet = null;
// erreurs - anomalies
private Vector<String> vs_erreurs = null;
private Vector<String> vs_anomalies = null;
/*
* CONSTRUCTEUR
*/
/**
* Constructeur par d&eacute;faut.<br>
* Instancie le gestionnaire d'une connexion &agrave; une base de donn&eacute;es.
* @exception ClassNotFoundException La classe n'a pas &eacute;t&eacute; trouv&eacute;e
*/
public GestionConnexion()
throws ClassNotFoundException, Exception
{
/*
* Init les autres variables
*/
this.statement = null;
this.resultSet = null;
this.requeteSQL = "";
this.paramsConn = new ParametresConnexion();
//init la gestion des erreurs - anomalies
this.vs_erreurs = new Vector<String>();
this.vs_anomalies = new Vector<String>();
try
{
// R<>cup<75>ration du driver
Class.forName(ParametresConnexion.CLASSE).newInstance();
}
catch (ClassNotFoundException ex)
{
//remonte l'exception
throw new ClassNotFoundException("La classe '"+ParametresConnexion.CLASSE+"' n'a pas <20>t<EFBFBD> trouv<75>e.");
}
catch (Exception ex)
{
//remonte l'exception
throw ex;
}
}
/*
* METHODES D'INSTANCES
*/
/**
* Ouvre une connexion avec les param&egrave;tres sp&eacute;cifi&eacute;s.
* @param params Objet contenant les param&egrave;tres &agrave; appliquer pour la connexion.
*/
public void ouvrir(ParametresConnexion params)
{
//V<>rifie le param<61>tre
if (params == null)
throw new NullPointerException();
//Copie les param<61>tres
this.paramsConn.CopierDepuis(params);
//Appelle la m<>thode sans param<61>tres
this.ouvrir();
}
/**
* Ouvre une connexion avec les param&egrave;tres d&eacute;j&agrave; charg&eacute;s.<br>
* Note : si aucun param&egrave;tre n'a &eacute;t&eacute; charg&eacute;, utilise les param&egrave;tres de connexion par d&eacute;faut (cf classe ParametresConnexion).
*/
public void ouvrir()
{
try
{
// ferme la conexion pr<70>c<EFBFBD>dente
this.fermerConnexion();
// init la nouvelle connexion
this.connection = DriverManager.getConnection(this.paramsConn.Url,
this.paramsConn.Utilisateur, this.paramsConn.Pwd);
this.traiterWarning(this.connection.getWarnings());
}
catch (SQLException ex)
{
this.traiterSQLException(ex);
this.fermerConnexion();
}
}
/**
* Donne l'&eacute;tat de la connexion en cours.
* @return true si la connexion est ouverte; false si ferm&eacute;e.
*/
public boolean estOuverte()
{
boolean bOuverte = false;
try
{
if (this.connection != null)
bOuverte = !this.connection.isClosed();
}
catch (SQLException ex)
{
this.traiterSQLException(ex);
}
return bOuverte;
}
/**
* Ferme les ressources utilis&eacute;es par la requ&ecirc;te:<br>
* - ferme le ResultSet et le Statement;<br>
* - vide le contenu de la requ&ecirc;te.
*/
public void fermerRessourcesRequete()
{
try
{
// Ferme le resultSet
if (this.resultSet != null)
{
this.resultSet.close();
this.resultSet = null;
}
// Ferme le statement
if (this.statement != null)
{
this.statement.close();
this.statement = null;
}
// Vide la requ<71>te
this.requeteSQL = "";
}
catch (SQLException ex)
{
this.traiterSQLException(ex);
}
}
/**
* Ferme la connexion et lib&egrave;re les autres ressources qui ont pu &ecirc;tre utilis&eacute;es.
*/
public void fermerConnexion()
{
try
{
// Ferme le statement
this.fermerRessourcesRequete();
// Ferme la connexion
if (this.connection != null)
{
this.connection.close();
this.connection = null;
}
}
catch (SQLException ex)
{
this.traiterSQLException(ex);
}
}
/**
* Lance la requ&ecirc;te SQL de s&eacute;lection sp&eacute;cifi&eacute;e.
* @param query Requ&ecirc;te SQL de type SELECT &agrave; ex&eacute;cuter.
* @return true si la requ&ecirc;te a r&eacute;ussie; false sinon.
*/
public boolean lancerRequeteSelection(String query)
{
boolean res = true;
try
{
// verifie la connexion
if (this.connection != null)
{
// lib<69>re les ressources de la pr<70>c<EFBFBD>dente requ<71>te
this.fermerRessourcesRequete();
// prepare la requete
this.statement = this.connection.createStatement();
this.traiterWarning(this.statement.getWarnings());
// emet la requete
this.resultSet = this.statement.executeQuery(query);
this.traiterWarning(this.resultSet.getWarnings());
// si on est arriv<69> jusqu'ici, c'est qu'il n'y a pas eu de lev<65>e d'exception
// =>actualise la requ<71>te
this.requeteSQL = query;
}
}
catch (SQLException ex)
{
this.traiterSQLException(ex);
// lib<69>re les ressources utilis<69>es
this.fermerRessourcesRequete();
//annonce l'<27>chec de la requ<71>te SQL
res = false;
}
return res;
}
/**
* Lance la requ&ecirc;te SQL sp&eacute;cifi&eacute;e qui modifie la base de donn&eacute;e.
* @param query Requ&ecirc;te SQL de type DELETE, UPDATE, INSERT &agrave; ex&eacute;cuter.
* @return nombre de lignes modifi&eacute;es pour requ&ecirc;te DDL;<br>
* 0 pour requ&ecirc;te ne donnant aucun r<>eacute;sultat;<br>
* -1 si une erreur est survenue lors de l'ex<65>cution de la requ<71>te;
*/
public int lancerRequeteModifBDD(String query)
{
int res = 0;
try
{
// verifie la connexion
if (this.connection != null)
{
// lib<69>re les ressources de la pr<70>c<EFBFBD>dente requ<71>te
this.fermerRessourcesRequete();
// prepare la requete
this.statement = this.connection.createStatement();
// emet la requete
res = this.statement.executeUpdate(query);
this.traiterWarning(this.statement.getWarnings());
// si on est arriv<69> jusqu'ici, c'est qu'il n'y a pas eu de lev<65>e d'exception
// =>actualise la requ<71>te
this.requeteSQL = query;
}
}
catch (SQLException ex)
{
this.traiterSQLException(ex);
// lib<69>re les ressources utilis<69>es
this.fermerRessourcesRequete();
//annonce l'<27>chec de la requ<71>te SQL
res = -1;
}
return res;
}
/**
* Retourne une copie de l'objet contenant les param&egrave;tres de la connexion courante.
* @return Copie de l'objet contenant les param&egrave;tres de connexion.
*/
public ParametresConnexion getParametresConnexion()
{
//Retourne une copie de l'objet contenant les param<61>tres de connexion
return new ParametresConnexion(this.paramsConn);
}
/**
* Retourne la requ&ecirc;te SQL qui a &eacute;t&eacute; lanc&eacute;e avec succ&egrave;s.
* @return Requ&ecirc;te SQL qui a &eacute;t&eacute; ex&eacute;cut&eacute;e.<br>Si pas de r&eacute;sultats disponibles, renvoie une cha<68>ne vide.
*/
public String getRequeteSQL()
{
return this.requeteSQL;
}
/**
* Donne les infos sur la connexion courante.
* @return Liste des infos de la connexion en cours.
*/
public Vector<String> getInfosConnexion()
{
Vector<String> vs_infosConn = new Vector<String>();
DatabaseMetaData dmd;
try
{
// V<>rifie que la connexion soit ouverte
if (this.estOuverte())
{
// Etat de la connexion
vs_infosConn.add("Etat de la connexion : ouverte");
vs_infosConn.add("------------------------------");
// Obtient les meta-datas de la base
dmd = this.connection.getMetaData();
vs_infosConn.add("Connexion : " + dmd.getURL());
vs_infosConn.add("Driver : " + dmd.getDriverName());
vs_infosConn.add("Version : " + dmd.getDriverVersion());
}
else
{
// Etat de la connexion
vs_infosConn.add("Etat de la connexion : ferm<72>e");
vs_infosConn.add("------------------------------");
vs_infosConn.add("Connexion : " + this.paramsConn.Url);//contient le Serveur, le Port et la Base
vs_infosConn.add("Utilisateur : " + this.paramsConn.Utilisateur);
vs_infosConn.add("Mot de passe : " + this.paramsConn.Pwd.length() + " caract<63>re(s)");
}
}
catch (SQLException ex)
{
// Erreur lors de l'obtention du nom des colonnes
this.traiterSQLException(ex);
}
return vs_infosConn;
}
/**
* R&eacute;cup&egrave;re la liste des noms des colonnes issues du r&eacute;sultat de la requ&ecirc;te SQL pr&eacute;c&eacute;demment lanc&eacute;e.
* @return Liste des noms des colonnes issues du r&eacute;sultat de la requ&ecirc;te SQL.
*/
public Vector<String> getNomsColonnes()
{
Vector<String> vs_cols = new Vector<String>();
ResultSetMetaData rsmd;
try
{
// V<>rifie si la requ<71>te a d<>j&agrave; <20>t<EFBFBD> lanc<6E>e
if (this.resultSet != null)
{
rsmd = this.resultSet.getMetaData(); // obtient les meta-datas de la requ<71>te
int nbrCols = rsmd.getColumnCount();
for (int idCol = 1; idCol <= nbrCols; idCol++)
if (rsmd.isSearchable(idCol))
vs_cols.add(rsmd.getColumnName(idCol));
}
else if (this.statement == null)
// anomalie
this.vs_anomalies.add("Vous n'avez pas encore lanc<6E> la requ<71>te!!");
}
catch (SQLException ex)
{
// Erreur lors de l'obtention du nom des colonnes
this.traiterSQLException(ex);
}
return vs_cols;
}
/**
* R&eacute;cup&egrave;re le r&eacute;sultat de la requ&ecirc;te SQL pr&eacute;c&eacute;demment lanc&eacute;e dans un tableau d'objets.<br>
* Note : Ce tableau est compos&eacute; d'une liste de lignes.<br>Ces lignes sont elles-m&ecirc;mes compos&eacute;es d'une liste d'objets.
* @return Tableau d'objets correspondant au r&eacute;sultat de la requ&ecirc;te SQL.
*/
public Vector<Vector<Object>> getDataVector()
{
Vector<Vector<Object>> v_datas = new Vector<Vector<Object>>();
ResultSetMetaData rsmd;
try
{
rsmd = this.resultSet.getMetaData();
// V<>rifie qu'il y ai un r<>sultat et place le curseur au d<>but
if (rsmd.getColumnCount() > 0)
{
while (this.resultSet.next())
{
Vector<Object> vo_ligne = new Vector<Object>();
// cr<63><72> la ligne
for (int idCol = 1; idCol <= rsmd.getColumnCount(); idCol++)
vo_ligne.add(this.resultSet.getObject(idCol));
// ajoute la ligne au vecteur principal
v_datas.add(vo_ligne);
}
}
if (v_datas.isEmpty()) // anomalie
this.vs_anomalies.add("Aucune donn<6E>e trouv<75>e!!");
}
catch (SQLException ex)
{
// Probleme lors de l'obtention des donnees
this.traiterSQLException(ex);
}
return v_datas;
}
/*
* GESTION DES ERREURS - ANOMALIES
*/
/**
* Trace les erreurs SQL qui ont &eacute;t&eacute; lev&eacute;es par une exception donn&eacute;e.
* @param ex SQLException &agrave; tracer.
*/
public void traiterSQLException(SQLException ex)
{
String str_ex;
str_ex = "********* SQLException *********\n";
while (ex != null)
{
str_ex = "SQLState : " + ex.getSQLState() + "\n";
str_ex += "Message : " + ex.getMessage() + "\n";
str_ex += "------------------------------\n";
this.vs_erreurs.add(str_ex);
ex = ex.getNextException();
}
}
/**
* Trace les anomalies SQL donn&eacute;es.
* @param warn Anomalies SQL &agrave; tracer.
*/
public void traiterWarning(SQLWarning warn)
{
String str_an;
str_an = "********* SQLWarning *********\n";
while (warn != null)
{
str_an = "SQLState : " + warn.getSQLState() + "\n";
str_an += "Message : " + warn.getMessage() + "\n";
str_an += "------------------------------\n";
this.vs_anomalies.add(str_an);
warn = warn.getNextWarning();
}
}
/**
* R&eacute;cup&egrave;re la liste des erreurs trac&eacute;es.
* @return Liste des erreurs trac&eacute;es.<br>Note : retourne une copie du vecteur interne pour emp&ecirc;cher la modification directe de celui-ci.
*/
public Vector<String> getErreurs()
{
return new Vector<String>(this.vs_erreurs);
}
/**
* R&eacute;cup&egrave;re la liste des anomalies trac&eacute;es.
* @return Liste des anomalies trac&eacute;es.<br>Note : retourne une copie du vecteur interne pour emp&ecirc;cher la modification directe de celui-ci.
*/
public Vector<String> getAnomalies()
{
return new Vector<String>(this.vs_anomalies);
}
/**
* Efface la liste des erreurs trac&eacute;es.
*/
public void effaceErreurs()
{
this.vs_erreurs.clear();
}
/**
* Efface la liste des anomalies trac&eacute;es.
*/
public void effaceAnomalies()
{
this.vs_anomalies.clear();
}
}

View File

@ -0,0 +1,178 @@
package com.gestionnaires;
import java.util.Vector;
import com.articles.Article;
import com.articles.Categorie;
public class GestionnaireArticles
{
private static GestionnaireArticles instanceUnique = null;
private GestionConnexion gestConn = null;
private ParametresConnexion paramsConn = null;
public GestionnaireArticles()
throws Exception
{
//
// Cr<43>ation de l'objet connexion
//
this.gestConn = new GestionConnexion();
this.paramsConn = new ParametresConnexion();
}
public Vector<Article> donnerListeArticles(String sConditions)
throws Exception
{
Vector<Vector<Object>> vResReq = null;
Vector<String> vLstCols = null;
Vector<Article> vLstArts = null;
Article tmpArt = null;
String sReqSQL = "";
//
// Se connecte <20> la base
//
// Ouvre la connexion si pas d<>j<EFBFBD> fait
if (!this.gestConn.estOuverte())
this.gestConn.ouvrir(this.paramsConn);
// Si pas ouverte, sort
if ( !this.gestConn.estOuverte() )
throw new Exception("La connexion avec la base de donn<6E>es n'a pas pu <20>tre <20>tablie.");
//
// Cr<43>er la requ<71>te
//
sReqSQL = "SELECT * FROM ARTICLES_RANDO";
if (sConditions != null)
if (!sConditions.equals(""))
sReqSQL += " WHERE " + sConditions;
//
// Lance la requ<71>te et r<>cup<75>re les donn<6E>es
//
if (this.gestConn.lancerRequeteSelection(sReqSQL))
{
vResReq = this.gestConn.getDataVector();
vLstCols = this.gestConn.getNomsColonnes();
vLstArts = new Vector<Article>(vResReq.size());
for (int iArt=0; iArt<vResReq.size(); iArt++)
{
tmpArt = new Article();
//R<>cup<75>re les donn<6E>es
for (int iCol=0; iCol<vLstCols.size(); iCol++)
{
if (vLstCols.get(iCol).toUpperCase().equals("REFERENCE"))
tmpArt.setRef(String.valueOf(vResReq.get(iArt).get(iCol)));
else if (vLstCols.get(iCol).toUpperCase().equals("CATEGORIE"))
tmpArt.setCateg(String.valueOf(vResReq.get(iArt).get(iCol)));
else if (vLstCols.get(iCol).toUpperCase().equals("MARQUE"))
tmpArt.setMarque(String.valueOf(vResReq.get(iArt).get(iCol)));
else if (vLstCols.get(iCol).toUpperCase().equals("MODELE"))
tmpArt.setModele(String.valueOf(vResReq.get(iArt).get(iCol)));
else if (vLstCols.get(iCol).toUpperCase().equals("PRIX"))
tmpArt.setPrix(Double.parseDouble(vResReq.get(iArt).get(iCol).toString()));
else if (vLstCols.get(iCol).toUpperCase().equals("PHOTO"))
tmpArt.setPhoto(String.valueOf(vResReq.get(iArt).get(iCol)));
else if (vLstCols.get(iCol).toUpperCase().equals("DESCRIPTION"))
tmpArt.setDescription(String.valueOf(vResReq.get(iArt).get(iCol)));
}
//Ajoute <20> la liste
vLstArts.add(tmpArt);
}
}
//
// Se d<>connecte de la base
//
// Ferme la connexion
this.gestConn.fermerConnexion();
return vLstArts;
}
public Vector<Categorie> donnerListeCategories(String sConditions)
throws Exception
{
Vector<Vector<Object>> vResReq = null;
Vector<String> vLstCols = null;
Vector<Categorie> vLstCats = null;
Categorie tmpCat = null;
String sReqSQL = "";
//
// Se connecte <20> la base
//
// Ouvre la connexion si pas d<>j<EFBFBD> fait
if (!this.gestConn.estOuverte())
this.gestConn.ouvrir(this.paramsConn);
// Si pas ouverte, sort
if ( !this.gestConn.estOuverte() )
throw new Exception("La connexion avec la base de donn<6E>es n'a pas pu <20>tre <20>tablie.");
//
// Cr<43>er la requ<71>te
//
sReqSQL = "SELECT * FROM CATEGORIE_RANDO";
if (sConditions != null)
if (!sConditions.equals(""))
sReqSQL += " WHERE " + sConditions;
//
// Lance la requ<71>te et r<>cup<75>re les donn<6E>es
//
if (this.gestConn.lancerRequeteSelection(sReqSQL))
{
vResReq = this.gestConn.getDataVector();
vLstCols = this.gestConn.getNomsColonnes();
vLstCats = new Vector<Categorie>(vResReq.size());
for (int iArt=0; iArt<vResReq.size(); iArt++)
{
tmpCat = new Categorie();
//R<>cup<75>re les donn<6E>es
for (int iCol=0; iCol<vLstCols.size(); iCol++)
{
if (vLstCols.get(iCol).toUpperCase().equals("ID"))
tmpCat.setId(Integer.parseInt(vResReq.get(iArt).get(iCol).toString()));
else if (vLstCols.get(iCol).toUpperCase().equals("CAT"))
tmpCat.setCat(String.valueOf(vResReq.get(iArt).get(iCol)));
}
//Ajoute <20> la liste
vLstCats.add(tmpCat);
}
}
//
// Se d<>connecte de la base
//
// Ferme la connexion
this.gestConn.fermerConnexion();
return vLstCats;
}
public static GestionnaireArticles getInstanceUnique()
throws Exception
{
if (GestionnaireArticles.instanceUnique == null)
GestionnaireArticles.instanceUnique = new GestionnaireArticles();
return GestionnaireArticles.instanceUnique;
}
public static void setInstanceUnique(GestionnaireArticles instanceUnique)
{
if (instanceUnique == null)
return;
GestionnaireArticles.instanceUnique = instanceUnique;
}
}

View File

@ -0,0 +1,208 @@
package com.gestionnaires;
import java.util.Vector;
import com.articles.Article;
import com.articles.Categorie;
/**
* Gestionnaire des articles (et des cat<61>gories) :<br>
* R<>cup<75>re les articles et les cat<61>gories depuis la BDD, selon des crit<69>res ou non.<br>
* Note : il ne doit y avoir qu'une instance de cette classe : elle utilise le gestionnaire de connexion <20> la BDD.
* @author 3fvorillion
*/
public class GestionnaireArticles
{
private static GestionnaireArticles instanceUnique = null;
private GestionConnexion gestConn = null;
private ParametresConnexion paramsConn = null;
/**
* Instancie le gestionnaire d'articles.<br>
* - instancie le gestionnaire de connexion <20> la BDD.
* @throws Exception
*/
public GestionnaireArticles()
throws Exception
{
//
// Cr<43>ation de l'objet connexion
//
this.gestConn = new GestionConnexion();
this.paramsConn = new ParametresConnexion();
}
/***
* Donne la liste des articles correspondants aux conditions donnees.
* @param sConditions Conditions de selection des articles.<br>Peut <20>tre null ou vide.<br>Sans la clause 'where'.
* @return Liste des articles correspondants aux crit<69>res donn<6E>s.
*/
public Vector<Article> donnerListeArticles(String sConditions)
throws Exception
{
Vector<Vector<Object>> vResReq = null;
Vector<String> vLstCols = null;
Vector<Article> vLstArts = null;
Article tmpArt = null;
String sReqSQL = "";
//
// Se connecte <20> la base
//
// Ouvre la connexion si pas d<>j<EFBFBD> fait
if (!this.gestConn.estOuverte())
this.gestConn.ouvrir(this.paramsConn);
// Si pas ouverte, sort
if ( !this.gestConn.estOuverte() )
throw new Exception("La connexion avec la base de donn<6E>es n'a pas pu <20>tre <20>tablie.");
//
// Cr<43>er la requ<71>te
//
sReqSQL = "SELECT * FROM ARTICLES_RANDO";
if (sConditions != null)
if (!sConditions.equals(""))
sReqSQL += " WHERE " + sConditions;
//
// Lance la requ<71>te et r<>cup<75>re les donn<6E>es
//
if (this.gestConn.lancerRequeteSelection(sReqSQL))
{
vResReq = this.gestConn.getDataVector();
vLstCols = this.gestConn.getNomsColonnes();
vLstArts = new Vector<Article>(vResReq.size());
for (int iArt=0; iArt<vResReq.size(); iArt++)
{
tmpArt = new Article();
//R<>cup<75>re les donn<6E>es
for (int iCol=0; iCol<vLstCols.size(); iCol++)
{
if (vLstCols.get(iCol).toUpperCase().equals("REFERENCE"))
tmpArt.setRef(String.valueOf(vResReq.get(iArt).get(iCol)));
else if (vLstCols.get(iCol).toUpperCase().equals("CATEGORIE"))
tmpArt.setCateg(String.valueOf(vResReq.get(iArt).get(iCol)));
else if (vLstCols.get(iCol).toUpperCase().equals("MARQUE"))
tmpArt.setMarque(String.valueOf(vResReq.get(iArt).get(iCol)));
else if (vLstCols.get(iCol).toUpperCase().equals("MODELE"))
tmpArt.setModele(String.valueOf(vResReq.get(iArt).get(iCol)));
else if (vLstCols.get(iCol).toUpperCase().equals("PRIX"))
tmpArt.setPrix(Double.parseDouble(vResReq.get(iArt).get(iCol).toString()));
else if (vLstCols.get(iCol).toUpperCase().equals("PHOTO"))
tmpArt.setPhoto(String.valueOf(vResReq.get(iArt).get(iCol)));
else if (vLstCols.get(iCol).toUpperCase().equals("DESCRIPTION"))
tmpArt.setDescription(String.valueOf(vResReq.get(iArt).get(iCol)));
}
//Ajoute <20> la liste
vLstArts.add(tmpArt);
}
}
//
// Se d<>connecte de la base
//
// Ferme la connexion
this.gestConn.fermerConnexion();
return vLstArts;
}
/***
* Donne la liste des categories correspondants aux conditions donnees.
* @param sConditions Conditions de selection des categories.<br>Peut <20>tre null ou vide.<br>Sans la clause 'where'.
* @return Liste des categories correspondants aux crit<69>res donn<6E>s.
*/
public Vector<Categorie> donnerListeCategories(String sConditions)
throws Exception
{
Vector<Vector<Object>> vResReq = null;
Vector<String> vLstCols = null;
Vector<Categorie> vLstCats = null;
Categorie tmpCat = null;
String sReqSQL = "";
//
// Se connecte <20> la base
//
// Ouvre la connexion si pas d<>j<EFBFBD> fait
if (!this.gestConn.estOuverte())
this.gestConn.ouvrir(this.paramsConn);
// Si pas ouverte, sort
if ( !this.gestConn.estOuverte() )
throw new Exception("La connexion avec la base de donn<6E>es n'a pas pu <20>tre <20>tablie.");
//
// Cr<43>er la requ<71>te
//
sReqSQL = "SELECT * FROM CATEGORIE_RANDO";
if (sConditions != null)
if (!sConditions.equals(""))
sReqSQL += " WHERE " + sConditions;
//
// Lance la requ<71>te et r<>cup<75>re les donn<6E>es
//
if (this.gestConn.lancerRequeteSelection(sReqSQL))
{
vResReq = this.gestConn.getDataVector();
vLstCols = this.gestConn.getNomsColonnes();
vLstCats = new Vector<Categorie>(vResReq.size());
for (int iArt=0; iArt<vResReq.size(); iArt++)
{
tmpCat = new Categorie();
//R<>cup<75>re les donn<6E>es
for (int iCol=0; iCol<vLstCols.size(); iCol++)
{
if (vLstCols.get(iCol).toUpperCase().equals("ID"))
tmpCat.setId(Integer.parseInt(vResReq.get(iArt).get(iCol).toString()));
else if (vLstCols.get(iCol).toUpperCase().equals("CAT"))
tmpCat.setCat(String.valueOf(vResReq.get(iArt).get(iCol)));
}
//Ajoute <20> la liste
vLstCats.add(tmpCat);
}
}
//
// Se d<>connecte de la base
//
// Ferme la connexion
this.gestConn.fermerConnexion();
return vLstCats;
}
/**
* Retourne une instance unique pour le gestionnaire des articles.
* @return instance unique du gestionnaire des articles.
* @throws Exception
*/
public static GestionnaireArticles getInstanceUnique()
throws Exception
{
if (GestionnaireArticles.instanceUnique == null)
GestionnaireArticles.instanceUnique = new GestionnaireArticles();
return GestionnaireArticles.instanceUnique;
}
/**
* Modifie l'instance unique pour le gestionnaire des articles.
* @param instanceUnique
*/
public static void setInstanceUnique(GestionnaireArticles instanceUnique)
{
if (instanceUnique == null)
return;
GestionnaireArticles.instanceUnique = instanceUnique;
}
}

View File

@ -0,0 +1,81 @@
package com.gestionnaires;
import java.util.Vector;
import com.articles.Article;
public class GestionnairePanier
{
Vector<Article> vArticles = null;
boolean bEstPaye = false;
public GestionnairePanier()
{
this.vArticles = new Vector<Article>();
}
public void ajouterAchat(Article art)
{
Article artPan = null;
boolean bArtTrouve = false;
if (art == null)
return;
//V<>rifie si pas d<>j<EFBFBD> pr<70>sent
for (int i=0; i<this.vArticles.size() && !bArtTrouve; i++)
if (this.vArticles.get(i).getRef().equals(art.getRef()))
{
artPan = this.vArticles.get(i);
bArtTrouve = true;
}
//Si trouv<75>, incr<63>mente
if (bArtTrouve)
artPan.setQuantite(artPan.getQuantite()+1);
//sinon, ajoute et met <20> jour la quantiti<74>
else
{
art.setQuantite(1);
this.vArticles.add(art);
}
}
public void modifieAchat(String sRefArticle, int quantite)
{
for (int i=0; i<this.vArticles.size(); i++)
if (this.vArticles.get(i).getRef().equals(sRefArticle))
this.vArticles.get(i).setQuantite(quantite);
}
public void enleverAchat(String sRefArticle)
{
for (int i=0; i<this.vArticles.size(); i++)
if (this.vArticles.get(i).getRef().equals(sRefArticle))
this.vArticles.remove(i);
}
public Vector<Article> donneContenu()
{
return this.vArticles;
}
public boolean getEstPaye()
{
return this.bEstPaye;
}
public void setEstPaye(boolean bEstPaye)
{
this.bEstPaye = bEstPaye;
}
public double getPrixTotalPanier()
{
double prixTotal = 0;
for (int i=0; i<this.vArticles.size(); i++)
prixTotal += this.vArticles.get(i).getPrix() * this.vArticles.get(i).getQuantite();
return prixTotal;
}
}

View File

@ -0,0 +1,117 @@
package com.gestionnaires;
import java.util.Vector;
import com.articles.Article;
/**
* Traite le contenu du panier.
* @author 3fvorillion
*/
public class GestionnairePanier
{
Vector<Article> vArticles = null;
boolean bEstPaye = false;
/**
* Instancie le panier
*/
public GestionnairePanier()
{
this.vArticles = new Vector<Article>();
}
/**
* Ajoute un article au panier.
* @param art article <20> ajouter.
*/
public void ajouterAchat(Article art)
{
Article artPan = null;
boolean bArtTrouve = false;
if (art == null)
return;
//V<>rifie si pas d<>j<EFBFBD> pr<70>sent
for (int i=0; i<this.vArticles.size() && !bArtTrouve; i++)
if (this.vArticles.get(i).getRef().equals(art.getRef()))
{
artPan = this.vArticles.get(i);
bArtTrouve = true;
}
//Si trouv<75>, incr<63>mente
if (bArtTrouve)
artPan.setQuantite(artPan.getQuantite()+1);
//sinon, ajoute et met <20> jour la quantiti<74>
else
{
art.setQuantite(1);
this.vArticles.add(art);
}
}
/**
* Modifie la quantit<69> pour un article de r<>f<EFBFBD>rence donn<6E>e.
* @param sRefArticle R<>f<EFBFBD>rence vers l'article.
* @param quantite Nouvelle quantit<69>
*/
public void modifieAchat(String sRefArticle, int quantite)
{
for (int i=0; i<this.vArticles.size(); i++)
if (this.vArticles.get(i).getRef().equals(sRefArticle))
this.vArticles.get(i).setQuantite(quantite);
}
/**
* Enl<6E>ve du panier l'article de r<>f<EFBFBD>rence donn<6E>e
* @param sRefArticle R<>f<EFBFBD>rence vers l'article.
*/
public void enleverAchat(String sRefArticle)
{
for (int i=0; i<this.vArticles.size(); i++)
if (this.vArticles.get(i).getRef().equals(sRefArticle))
this.vArticles.remove(i);
}
/**
* Donne les articles du panier.
* @return liste des articles du panier.
*/
public Vector<Article> donneContenu()
{
return this.vArticles;
}
/**
* Donne l'<27>tat de payement du panier.
* @return 'true' si le panier est pass<73> '<27> la caisse'. 'fase' sinon.
*/
public boolean getEstPaye()
{
return this.bEstPaye;
}
/**
* D<>termine l'<27>tat de payement du panier.
* @param bEstPaye 'true' si le panier est pass<73> '<27> la caisse'. 'fase' sinon.
*/
public void setEstPaye(boolean bEstPaye)
{
this.bEstPaye = bEstPaye;
}
/**
* Calcule et retourne le prix total du panier.
* @return Prix total du panier.
*/
public double getPrixTotalPanier()
{
double prixTotal = 0;
for (int i=0; i<this.vArticles.size(); i++)
prixTotal += this.vArticles.get(i).getPrix() * this.vArticles.get(i).getQuantite();
return prixTotal;
}
}

View File

@ -0,0 +1,39 @@
package com.gestionnaires;
public class ParametresConnexion
{
public String Serveur = "grive.u-strabg.fr";
public String Port = "1521";
public String Base = "v920";
public String Utilisateur = "dut";
public String Pwd = "dut";
public String Url = "jdbc:oracle:thin:";
public static final String CLASSE = "oracle.jdbc.driver.OracleDriver";
public ParametresConnexion() { ; }
public ParametresConnexion( ParametresConnexion params )
{
this.CopierDepuis(params);
}
public ParametresConnexion(String serveur, String port, String base,
String utilisateur, String pwd, String url)
{
this.Serveur = serveur;
this.Port = port;
this.Base = base;
this.Utilisateur = utilisateur;
this.Pwd = pwd;
this.Url = url;
}
public void CopierDepuis( ParametresConnexion params )
{
this.Serveur = params.Serveur;
this.Port = params.Port;
this.Base = params.Base;
this.Utilisateur = params.Utilisateur;
this.Pwd = params.Pwd;
this.Url = params.Url;
}
}

View File

@ -0,0 +1,39 @@
package com.gestionnaires;
public class ParametresConnexion
{
public String Serveur = "grive.u-strabg.fr";
public String Port = "1521";
public String Base = "v920";
public String Utilisateur = "dut";
public String Pwd = "dut";
public String Url = "jdbc:oracle:thin:";
public static final String CLASSE = "oracle.jdbc.driver.OracleDriver";
public ParametresConnexion() { ; }
public ParametresConnexion( ParametresConnexion params )
{
this.CopierDepuis(params);
}
public ParametresConnexion(String serveur, String port, String base,
String utilisateur, String pwd, String url)
{
this.Serveur = serveur;
this.Port = port;
this.Base = base;
this.Utilisateur = utilisateur;
this.Pwd = pwd;
this.Url = url;
}
public void CopierDepuis( ParametresConnexion params )
{
this.Serveur = params.Serveur;
this.Port = params.Port;
this.Base = params.Base;
this.Utilisateur = params.Utilisateur;
this.Pwd = params.Pwd;
this.Url = params.Url;
}
}

View File

@ -0,0 +1,106 @@
package com.servlets;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.Vector;
import com.articles.Article;
import com.articles.Categorie;
import com.gestionnaires.Erreur;
import com.gestionnaires.GestionnairePanier;
import java.sql.*;
public class ArticlesServlet
extends HttpServlet
{
com.gestionnaires.GestionnaireArticles gestArts = null;
private void affArticles(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
String sPageAffichage = "";
Vector<Categorie> vCats = null;
Vector<Article> vArts = null;
String sIdCategAff;
String sCondReqSQL = "";
//
// Traite le filtre
//
sIdCategAff = request.getParameter("lstCategs");
if (sIdCategAff != null)
{
//Si pas d<>finit ou "toutes cat<61>gorie"
if (sIdCategAff.equals("") || sIdCategAff.equals("-1"))
{
sCondReqSQL = "";
}
else
{
sCondReqSQL = "CATEGORIE="+sIdCategAff;
}
}
else
sCondReqSQL = "";
//R<>cup<75>re le gestionnaire d'articles
try
{
//
// R<>cup<75>re les articles depuis la base
//
this.gestArts = com.gestionnaires.GestionnaireArticles.getInstanceUnique();
//R<>cup<75>re la liste des articles (filtr<74>s)
vArts = this.gestArts.donnerListeArticles(sCondReqSQL);
//R<>cup<75>re la liste des articles
vCats = this.gestArts.donnerListeCategories("");
vCats.add(0, new Categorie(-1, "Toutes categories"));
if (!vArts.isEmpty())
{
request.setAttribute("categories", vCats);
request.setAttribute("articles", vArts);
sPageAffichage = "/listeArticles.jsp";
}
else
{
sPageAffichage = "/listeArticlesVide.jsp";
}
}
catch (Exception ex)
{
Vector<Erreur> vErrs = new Vector<Erreur>();
vErrs.add(new Erreur(ex.getMessage()));
request.setAttribute("erreurs", vErrs);
sPageAffichage = "/erreurs.jsp";
}
ServletContext ctx = getServletContext();
RequestDispatcher rd = ctx.getRequestDispatcher(sPageAffichage);
rd.forward(request,response);
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
this.affArticles(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
this.affArticles(request, response);
}
public String getServletInfo() {
return "Gestion de articles";
}
// </editor-fold>
}

View File

@ -0,0 +1,106 @@
package com.servlets;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.Vector;
import com.articles.Article;
import com.articles.Categorie;
import com.gestionnaires.Erreur;
import com.gestionnaires.GestionnairePanier;
import java.sql.*;
public class ArticlesServlet
extends HttpServlet
{
com.gestionnaires.GestionnaireArticles gestArts = null;
private void affArticles(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
String sPageAffichage = "";
Vector<Categorie> vCats = null;
Vector<Article> vArts = null;
String sIdCategAff;
String sCondReqSQL = "";
//
// Traite le filtre
//
sIdCategAff = request.getParameter("lstCategs");
if (sIdCategAff != null)
{
//Si pas d<>finit ou "toutes cat<61>gorie"
if (sIdCategAff.equals("") || sIdCategAff.equals("-1"))
{
sCondReqSQL = "";
}
else
{
sCondReqSQL = "CATEGORIE="+sIdCategAff;
}
}
else
sCondReqSQL = "";
//R<>cup<75>re le gestionnaire d'articles
try
{
//
// R<>cup<75>re les articles depuis la base
//
this.gestArts = com.gestionnaires.GestionnaireArticles.getInstanceUnique();
//R<>cup<75>re la liste des articles (filtr<74>s)
vArts = this.gestArts.donnerListeArticles(sCondReqSQL);
//R<>cup<75>re la liste des articles
vCats = this.gestArts.donnerListeCategories("");
vCats.add(0, new Categorie(-1, "Toutes categories"));
if (!vArts.isEmpty())
{
request.setAttribute("categories", vCats);
request.setAttribute("articles", vArts);
sPageAffichage = "/listeArticles.jsp";
}
else
{
sPageAffichage = "/listeArticlesVide.jsp";
}
}
catch (Exception ex)
{
Vector<Erreur> vErrs = new Vector<Erreur>();
vErrs.add(new Erreur(ex.getMessage()));
request.setAttribute("erreurs", vErrs);
sPageAffichage = "/erreurs.jsp";
}
ServletContext ctx = getServletContext();
RequestDispatcher rd = ctx.getRequestDispatcher(sPageAffichage);
rd.forward(request,response);
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
this.affArticles(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
this.affArticles(request, response);
}
public String getServletInfo() {
return "Gestion de articles";
}
// </editor-fold>
}

View File

@ -0,0 +1,157 @@
package com.servlets;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.Vector;
import com.articles.Article;
import com.articles.Panier;
import com.articles.Client;
import com.gestionnaires.Erreur;
import com.gestionnaires.GestionnairePanier;
public class ClientServlet
extends HttpServlet
{
com.gestionnaires.GestionnaireArticles gestArts = null;
private void affPayement(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
GestionnairePanier panier = null;
Vector<Erreur> vErrs = new Vector<Erreur>();
Vector<Article> vArts = null;
Client cli = null;
String sAction;
String sPageAffichage;
//
// R<>cup<75>re l'objet de la session
//
panier = PanierServlet.getPanierSession(request);
//
// Traite les actions
//
sAction = request.getParameter("action");
if (sAction == null)
{ ; }
else if (sAction.equals("payer"))
{
cli = new Client();
//R<>cup<75>re les infos de l'utilisateur
if (request.getParameter("nomCli") != null)
{
if (!request.getParameter("nomCli").equals(""))
cli.setNom(request.getParameter("nomCli"));
else
vErrs.add(new Erreur("Votre nom n'est pas saisi."));
}
else
vErrs.add(new Erreur("Le nom du client n'est pas disponible."));
if (request.getParameter("prenomCli") != null)
{
if (!request.getParameter("prenomCli").equals(""))
cli.setPrenom(request.getParameter("prenomCli"));
else
vErrs.add(new Erreur("Votre prenom n'est pas saisi."));
}
else
vErrs.add(new Erreur("Le prenom du client n'est pas disponible."));
if (request.getParameter("addrCli") != null)
{
if (!request.getParameter("addrCli").equals(""))
cli.setAdresse(request.getParameter("addrCli"));
else
vErrs.add(new Erreur("Votre adresse n'est pas saisi."));
}
else
vErrs.add(new Erreur("L'adresse du client n'est pas disponible."));
if (request.getParameter("cpCli") != null)
{
if (!request.getParameter("cpCli").equals(""))
cli.setCodePost(request.getParameter("cpCli"));
else
vErrs.add(new Erreur("Votre code postal n'est pas saisi."));
}
else
vErrs.add(new Erreur("Le code postal du client n'est pas disponible."));
if (request.getParameter("villeCli") != null)
{
if (!request.getParameter("villeCli").equals(""))
cli.setVille(request.getParameter("villeCli"));
else
vErrs.add(new Erreur("Votre ville n'est pas saisi."));
}
else
vErrs.add(new Erreur("La ville du client n'est pas disponible."));
}
if (vErrs.isEmpty())
{
//
// Affiche la liste des articles du panier
//
//R<>cup<75>re la liste des articles
vArts = panier.donneContenu();
if (!vArts.isEmpty())
{
request.setAttribute("articles", vArts);
request.setAttribute("panierTotal", new Panier(panier.getPrixTotalPanier()));
//V<>rifie si on a d<>j<EFBFBD> saisi les infos client
if (cli != null)
{
request.setAttribute("client", cli);
sPageAffichage = "/resultPayement.jsp";
//Signale que le panier est pr<70>t <20> <20>tre supprim<69>
panier.setEstPaye(true);
}
else
sPageAffichage = "/payement.jsp";
}
else
{
sPageAffichage = "/panierVide.jsp";
}
}
else
{
request.setAttribute("erreurs", vErrs);
sPageAffichage = "/erreurs.jsp";
}
ServletContext ctx = getServletContext();
RequestDispatcher rd = ctx.getRequestDispatcher(sPageAffichage);
rd.forward(request,response);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
this.affPayement(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
this.affPayement(request, response);
}
public String getServletInfo() {
return "Gestion du client";
}
// </editor-fold>
}

View File

@ -0,0 +1,187 @@
/*
* Panier.java
*
* Created on 11 janvier 2008, 15:06
*/
package com.servlets;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.Vector;
import com.articles.Article;
import com.articles.Panier;
import com.articles.Client;
import com.gestionnaires.Erreur;
import com.gestionnaires.GestionnairePanier;
/**
* Servlet G<>rant l'affichage des commandes d'un client.<br>
* - payement et confirmation de payement.
* @author 3fvorillion
* @version
*/
public class ClientServlet
extends HttpServlet
{
com.gestionnaires.GestionnaireArticles gestArts = null;
/**
* Traite les messages et affiche en cons<6E>quence.
* @param request
* @param response
* @throws ServletException
* @throws IOException
*/
private void affPayement(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
GestionnairePanier panier = null;
Vector<Erreur> vErrs = new Vector<Erreur>();
Vector<Article> vArts = null;
Client cli = null;
String sAction;
String sPageAffichage;
//
// R<>cup<75>re l'objet de la session
//
panier = PanierServlet.getPanierSession(request);
//
// Traite les actions
//
sAction = request.getParameter("action");
if (sAction == null)
{ ; }
else if (sAction.equals("payer"))
{
cli = new Client();
//R<>cup<75>re les infos de l'utilisateur
if (request.getParameter("nomCli") != null)
{
if (!request.getParameter("nomCli").equals(""))
cli.setNom(request.getParameter("nomCli"));
else
vErrs.add(new Erreur("Votre nom n'est pas saisi."));
}
else
vErrs.add(new Erreur("Le nom du client n'est pas disponible."));
if (request.getParameter("prenomCli") != null)
{
if (!request.getParameter("prenomCli").equals(""))
cli.setPrenom(request.getParameter("prenomCli"));
else
vErrs.add(new Erreur("Votre prenom n'est pas saisi."));
}
else
vErrs.add(new Erreur("Le prenom du client n'est pas disponible."));
if (request.getParameter("addrCli") != null)
{
if (!request.getParameter("addrCli").equals(""))
cli.setAdresse(request.getParameter("addrCli"));
else
vErrs.add(new Erreur("Votre adresse n'est pas saisi."));
}
else
vErrs.add(new Erreur("L'adresse du client n'est pas disponible."));
if (request.getParameter("cpCli") != null)
{
if (!request.getParameter("cpCli").equals(""))
cli.setCodePost(request.getParameter("cpCli"));
else
vErrs.add(new Erreur("Votre code postal n'est pas saisi."));
}
else
vErrs.add(new Erreur("Le code postal du client n'est pas disponible."));
if (request.getParameter("villeCli") != null)
{
if (!request.getParameter("villeCli").equals(""))
cli.setVille(request.getParameter("villeCli"));
else
vErrs.add(new Erreur("Votre ville n'est pas saisi."));
}
else
vErrs.add(new Erreur("La ville du client n'est pas disponible."));
}
if (vErrs.isEmpty())
{
//
// Affiche la liste des articles du panier
//
//R<>cup<75>re la liste des articles
vArts = panier.donneContenu();
if (!vArts.isEmpty())
{
request.setAttribute("articles", vArts);
request.setAttribute("panierTotal", new Panier(panier.getPrixTotalPanier()));
//V<>rifie si on a d<>j<EFBFBD> saisi les infos client
if (cli != null)
{
request.setAttribute("client", cli);
sPageAffichage = "/resultPayement.jsp";
//Signale que le panier est pr<70>t <20> <20>tre supprim<69>
panier.setEstPaye(true);
}
else
sPageAffichage = "/payement.jsp";
}
else
{
sPageAffichage = "/panierVide.jsp";
}
}
else
{
request.setAttribute("erreurs", vErrs);
sPageAffichage = "/erreurs.jsp";
}
ServletContext ctx = getServletContext();
RequestDispatcher rd = ctx.getRequestDispatcher(sPageAffichage);
rd.forward(request,response);
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/** Handles the HTTP <code>GET</code> method.
* @param request servlet request
* @param response servlet response
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
this.affPayement(request, response);
}
/** Handles the HTTP <code>POST</code> method.
* @param request servlet request
* @param response servlet response
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
this.affPayement(request, response);
}
/** Returns a short description of the servlet.
*/
public String getServletInfo() {
return "Gestion du client";
}
// </editor-fold>
}

View File

@ -0,0 +1,189 @@
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.Panier;
import com.gestionnaires.Erreur;
import com.gestionnaires.GestionnairePanier;
public class PanierServlet
extends HttpServlet
{
com.gestionnaires.GestionnaireArticles gestArts = null;
public static GestionnairePanier getPanierSession(HttpServletRequest request)
{
HttpSession session = request.getSession(true);
//
// R<>cup<75>re l'objet de la session
//
GestionnairePanier panier = (GestionnairePanier)session.getAttribute("caddy");
if ( panier == null )
{
panier = new GestionnairePanier();
panier.setEstPaye(false);
session.setAttribute("caddy", panier) ;
}
else if ( panier.getEstPaye() )
{
//Supprime l'ancien de la liste de la session
session.removeAttribute("caddy") ;
//Cr<43><72> un nouveau
panier = new GestionnairePanier();
panier.setEstPaye(false);
session.setAttribute("caddy", panier) ;
}
return panier;
}
private void affArticlesPanier(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
GestionnairePanier panier = null;
Vector<Article> vArts = null;
String sAction;
String sPageAffichage;
String sCondReqSQL;
//
// R<>cup<75>re l'objet de la session
//
panier = PanierServlet.getPanierSession(request);
//
// Traite les actions
//
sAction = request.getParameter("action");
if (sAction == null)
{ ; }
else if (sAction.equals("add"))
{
if (request.getParameter("artRef") != null)
{
sCondReqSQL = "REFERENCE = '" + request.getParameter("artRef") + "'";
//R<>cup<75>re le gestionnaire d'articles
try
{
//
// R<>cup<75>re les articles depuis la base
//
this.gestArts = com.gestionnaires.GestionnaireArticles.getInstanceUnique();
//R<>cup<75>re la liste des articles
vArts = this.gestArts.donnerListeArticles(sCondReqSQL);
if (vArts.size() == 1)
{
panier.ajouterAchat(vArts.get(0));
}
else
{
Vector<Erreur> vErrs = new Vector<Erreur>();
if (vArts.isEmpty())
vErrs.add(new Erreur("Aucun article n'est disponible dans la boutique"));
else
vErrs.add(new Erreur("Trop d'articles correspondent <20> la s<>lection"));
request.setAttribute("erreurs", vErrs);
sPageAffichage = "/erreurs.jsp";
ServletContext ctx = getServletContext();
RequestDispatcher rd = ctx.getRequestDispatcher(sPageAffichage);
rd.forward(request,response);
return;
}
}
catch (Exception ex)
{
Vector<Erreur> vErrs = new Vector<Erreur>();
vErrs.add(new Erreur(ex.getMessage()));
request.setAttribute("erreurs", vErrs);
sPageAffichage = "/erreurs.jsp";
ServletContext ctx = getServletContext();
RequestDispatcher rd = ctx.getRequestDispatcher(sPageAffichage);
rd.forward(request,response);
return;
}
}
}
else if (sAction.equals("del"))
{
if (request.getParameter("artRef") != null)
panier.enleverAchat(request.getParameter("artRef"));
}
else if (sAction.equals("modif"))
{
//R<>cup<75>re la liste des articles
vArts = panier.donneContenu();
for (int i=0;i<vArts.size(); i++)
if (request.getParameter(vArts.get(i).getRef()) != null)
panier.modifieAchat(vArts.get(i).getRef(),
Integer.parseInt(request.getParameter(vArts.get(i).getRef())));
}
//
// Affiche la liste des articles du panier
//
//R<>cup<75>re la liste des articles
vArts = panier.donneContenu();
if (!vArts.isEmpty())
{
request.setAttribute("articles", vArts);
request.setAttribute("panierTotal", new Panier(panier.getPrixTotalPanier()));
//Si on valide, on affiche le r<>sum<75> (affichage normal, sans modification)
if (sAction != null)
{
if (sAction.equals("valider"))
sPageAffichage = "/resumePanier.jsp";
else
sPageAffichage = "/contenuPanier.jsp";
}
//Sinon, on affiche le panier et on permet la modification des quantit<69>s
else
sPageAffichage = "/contenuPanier.jsp";
}
else
{
sPageAffichage = "/panierVide.jsp";
}
ServletContext ctx = getServletContext();
RequestDispatcher rd = ctx.getRequestDispatcher(sPageAffichage);
rd.forward(request,response);
}
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
this.affArticlesPanier(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
this.affArticlesPanier(request, response);
}
public String getServletInfo() {
return "Gestion du panier";
}
// </editor-fold>
}

View File

@ -0,0 +1,228 @@
/*
* Panier.java
*
* Created on 11 janvier 2008, 15:06
*/
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.Panier;
import com.gestionnaires.Erreur;
import com.gestionnaires.GestionnairePanier;
/**
* Servlet G<>rant l'affichage des articles du panier.<br>
* - affichage des articles et de leurs caract<63>ristiques.
* - modification des quantit<69>s.
* - suppression des articles du panier.
* @author 3fvorillion
* @version
*/
public class PanierServlet
extends HttpServlet
{
com.gestionnaires.GestionnaireArticles gestArts = null;
/**
* R<>cup<75>re le panier courant de la session courante.<br>
* Si pas de panier disponibles, en cr<63><72> un.<br>
* Si le painier courant en d<>j<EFBFBD> pay<61>, en cr<63><72> un autre.
* @param request requete du servlet
* @return le panier courant de la session
*/
public static GestionnairePanier getPanierSession(HttpServletRequest request)
{
HttpSession session = request.getSession(true);
//
// R<>cup<75>re l'objet de la session
//
GestionnairePanier panier = (GestionnairePanier)session.getAttribute("caddy");
if ( panier == null )
{
panier = new GestionnairePanier();
panier.setEstPaye(false);
session.setAttribute("caddy", panier) ;
}
else if ( panier.getEstPaye() )
{
//Supprime l'ancien de la liste de la session
session.removeAttribute("caddy") ;
//Cr<43><72> un nouveau
panier = new GestionnairePanier();
panier.setEstPaye(false);
session.setAttribute("caddy", panier) ;
}
return panier;
}
/**
* Traite les messages et affiche en cons<6E>quence.
* @param request
* @param response
* @throws ServletException
* @throws IOException
*/
private void affArticlesPanier(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
GestionnairePanier panier = null;
Vector<Article> vArts = null;
String sAction;
String sPageAffichage;
String sCondReqSQL;
//
// R<>cup<75>re l'objet de la session
//
panier = PanierServlet.getPanierSession(request);
//
// Traite les actions
//
sAction = request.getParameter("action");
if (sAction == null)
{ ; }
else if (sAction.equals("add"))
{
if (request.getParameter("artRef") != null)
{
sCondReqSQL = "REFERENCE = '" + request.getParameter("artRef") + "'";
//R<>cup<75>re le gestionnaire d'articles
try
{
//
// R<>cup<75>re les articles depuis la base
//
this.gestArts = com.gestionnaires.GestionnaireArticles.getInstanceUnique();
//R<>cup<75>re la liste des articles
vArts = this.gestArts.donnerListeArticles(sCondReqSQL);
if (vArts.size() == 1)
{
panier.ajouterAchat(vArts.get(0));
}
else
{
Vector<Erreur> vErrs = new Vector<Erreur>();
if (vArts.isEmpty())
vErrs.add(new Erreur("Aucun article n'est disponible dans la boutique"));
else
vErrs.add(new Erreur("Trop d'articles correspondent <20> la s<>lection"));
request.setAttribute("erreurs", vErrs);
sPageAffichage = "/erreurs.jsp";
ServletContext ctx = getServletContext();
RequestDispatcher rd = ctx.getRequestDispatcher(sPageAffichage);
rd.forward(request,response);
return;
}
}
catch (Exception ex)
{
Vector<Erreur> vErrs = new Vector<Erreur>();
vErrs.add(new Erreur(ex.getMessage()));
request.setAttribute("erreurs", vErrs);
sPageAffichage = "/erreurs.jsp";
ServletContext ctx = getServletContext();
RequestDispatcher rd = ctx.getRequestDispatcher(sPageAffichage);
rd.forward(request,response);
return;
}
}
}
else if (sAction.equals("del"))
{
if (request.getParameter("artRef") != null)
panier.enleverAchat(request.getParameter("artRef"));
}
else if (sAction.equals("modif"))
{
//R<>cup<75>re la liste des articles
vArts = panier.donneContenu();
for (int i=0;i<vArts.size(); i++)
if (request.getParameter(vArts.get(i).getRef()) != null)
panier.modifieAchat(vArts.get(i).getRef(),
Integer.parseInt(request.getParameter(vArts.get(i).getRef())));
}
//
// Affiche la liste des articles du panier
//
//R<>cup<75>re la liste des articles
vArts = panier.donneContenu();
if (!vArts.isEmpty())
{
request.setAttribute("articles", vArts);
request.setAttribute("panierTotal", new Panier(panier.getPrixTotalPanier()));
//Si on valide, on affiche le r<>sum<75> (affichage normal, sans modification)
if (sAction != null)
{
if (sAction.equals("valider"))
sPageAffichage = "/resumePanier.jsp";
else
sPageAffichage = "/contenuPanier.jsp";
}
//Sinon, on affiche le panier et on permet la modification des quantit<69>s
else
sPageAffichage = "/contenuPanier.jsp";
}
else
{
sPageAffichage = "/panierVide.jsp";
}
ServletContext ctx = getServletContext();
RequestDispatcher rd = ctx.getRequestDispatcher(sPageAffichage);
rd.forward(request,response);
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/** Handles the HTTP <code>GET</code> method.
* @param request servlet request
* @param response servlet response
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
this.affArticlesPanier(request, response);
}
/** Handles the HTTP <code>POST</code> method.
* @param request servlet request
* @param response servlet response
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
this.affArticlesPanier(request, response);
}
/** Returns a short description of the servlet.
*/
public String getServletInfo() {
return "Gestion du panier";
}
// </editor-fold>
}

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<context-param>
<param-name>com.sun.faces.verifyObjects</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<servlet>
<servlet-name>PanierServlet</servlet-name>
<servlet-class>com.servlets.PanierServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>PanierServlet</servlet-name>
<url-pattern>/Panier</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>ArticlesServlet</servlet-name>
<servlet-class>com.servlets.ArticlesServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ArticlesServlet</servlet-name>
<url-pattern>/Articles</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>ClientServlet</servlet-name>
<servlet-class>com.servlets.ClientServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ClientServlet</servlet-name>
<url-pattern>/Client</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
<jsp-config>
<jsp-property-group>
<description>Toutes les pages</description>
<url-pattern>*.jsp</url-pattern>
<page-encoding>UTF-8</page-encoding>
<include-prelude>/includes/entete.jsp</include-prelude>
<include-coda>/includes/enqueue.jsp</include-coda>
</jsp-property-group>
</jsp-config>
</web-app>

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<context-param>
<param-name>com.sun.faces.verifyObjects</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<servlet>
<servlet-name>PanierServlet</servlet-name>
<servlet-class>com.servlets.PanierServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>PanierServlet</servlet-name>
<url-pattern>/Panier</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>ArticlesServlet</servlet-name>
<servlet-class>com.servlets.ArticlesServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ArticlesServlet</servlet-name>
<url-pattern>/Articles</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>ClientServlet</servlet-name>
<servlet-class>com.servlets.ClientServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ClientServlet</servlet-name>
<url-pattern>/Client</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
</web-app>

View File

@ -0,0 +1,59 @@
<p><a href="./Panier?action=valider">Achat</a></p>
<h2>Panier</h2>
<form method="post" action="./Panier">
<table border="0" width="100%">
<thead>
<tr>
<th>Aper<65>u</th>
<th>Propri<72>t<EFBFBD>s</th>
<th>Quantit<69></th>
<th>Action</th>
</tr>
</thead>
<tbody>
<c:forEach items="${articles}" var="artRef" >
<tr>
<td>
<img src="./img/${artRef.photo}" width="50" height="50" alt="image"/>
</td>
<td>
<table border="0" width="100%" height="100%">
<tbody>
<tr>
<td>R&eacute;f&eacute;rence : ${artRef.ref}</td>
</tr>
<tr>
<td>Marque : ${artRef.marque}</td>
</tr>
<tr>
<td>Mod&egrave;le : ${artRef.modele}</td>
</tr>
<tr>
<td>Prix : ${artRef.prix}</td>
</tr>
</tbody>
</table>
</td>
<td>
<input type="text" id="${artRef.ref}" name="${artRef.ref}" maxLength="3" size="3" value="${artRef.quantite}" />
</td>
<td>
<a href="./Panier?action=del&artRef=${artRef.ref}">enlever</a>
</td>
</tr>
</c:forEach>
<tr>
<td colspan="3" class="tabTotal">Total :</td>
<td>
<jsp:useBean id="panierTotal" class="com.articles.Panier" scope="request" />
<jsp:getProperty name="panierTotal" property="prixTotal" />
</td>
</tr>
</tbody>
</table>
<br />
<input type="hidden" name="action" value="modif" />
<input type="submit" value="Calculer <20> nouveau">
</form>

View File

@ -0,0 +1,4 @@
<h2>Erreur !</h2>
<c:forEach items="${erreurs}" var="err" >
<p>${err.message}</p>
</c:forEach>

View File

@ -0,0 +1,6 @@
</div>
<div id="pied"><p>Propulsé par J2EE sur Tomcat5, écrit à l'aide de VIM</p></div>
</div>
</body>
</html>

View File

@ -0,0 +1,28 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:url var="charte" value="/style.css" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>I comme Herse</title>
<link rel="stylesheet" type="text/css" href="${charte}" />
</head>
<body>
<div id="contenu_principal">
<div id="tete"><h1 title="I, comme Herse">I, comme Herse</h1></div>
<div id="menu">
<ul id="menu_principal">
<c:url var="accueil" value="/" />
<c:url var="article" value="/Articles" />
<c:url var="panier" value="/Panier" />
<li><a href="${accueil}">Accueil</a></li>
<li><a href="${article}">Articles</a></li>
<li><a href="${panier}">Panier</a></li>
</ul>
</div>
<div id="contenu_secondaire">

View File

@ -0,0 +1,28 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:url var="charte" value="/public/css/style.css" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>I comme Herse</title>
<link rel="stylesheet" type="text/css" href="${charte}" />
</head>
<body>
<div id="contenu_principal">
<div id="tete"><h1 title="I, comme Herse">I, comme Herse</h1></div>
<div id="menu">
<ul id="menu_principal">
<c:url var="accueil" value="/" />
<c:url var="article" value="/Articles" />
<c:url var="panier" value="/Panier" />
<li><a href="${accueil}">Accueil</a></li>
<li><a href="${article}">Articles</a></li>
<li><a href="${panier}">Panier</a></li>
</ul>
</div>
<div id="contenu_secondaire">

View File

@ -0,0 +1 @@
<p>Bienvenue dans le site d'Ecommerce</p>

View File

@ -0,0 +1,53 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:useBean id="article" class="com.articles.Article" scope="request" />
<h2>Article -Informations</h2>
<table border="0" width="100%">
<thead>
<tr>
<th>Aper<65>u</th>
<th>Propri<72>t<EFBFBD>s</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<img src="./img/<jsp:getProperty name="art" property="photo" />" width="50" height="50" alt="image"/>
</td>
<td>
<table border="0" width="100%" height="100%">
<tbody>
<tr>
<td>R&eacute;f&eacute;rence :
<jsp:getProperty name="art" property="ref" /></td>
</tr>
<tr>
<td>Marque :
<jsp:getProperty name="art" property="marque" /></td>
</tr>
<tr>
<td>Mod&egrave;le :
<jsp:getProperty name="art" property="modele" /></td>
</tr>
<tr>
<td>Description :
<jsp:getProperty name="art" property="description" /></td>
</tr>
<tr>
<td>Prix :
<jsp:getProperty name="art" property="prix" /></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<hr width="100%" size="1">
<h2>Acheter l'article</h2>
<form method="post" action="./Panier?action=add">
<input type="hidden" id="ref" name="ref" value="<jsp:getProperty name="art" property="ref" />">
Quantit<69> :<br />
<input type="text" id="txtQte" name="txtQte" maxLength="3" size="3" /><br />
<input type="submit" value="Acheter">
</form>

View File

@ -0,0 +1,54 @@
<h2>Filtre</h2>
<form method="post" action="./Articles">
<select id="lstCategs" name="lstCategs" size="1">
<c:forEach items="${categories}" var="categ" >
<option value="${categ.id}">${categ.cat}</option>
</c:forEach>
</select>
<input type="submit" value="Appliquer le filtre">
</form>
<h2>Liste des articles disponibles</h2>
<table border="0" width="100%">
<thead>
<tr>
<th>Aper<65>u</th>
<th>Propri<72>t<EFBFBD>s</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<c:forEach items="${articles}" var="artRef" >
<tr>
<td>
<img src="./img/${artRef.photo}" width="50" height="50" alt="image"/>
</td>
<td>
<table border="0" width="100%" height="100%">
<tbody>
<tr>
<td>R&eacute;f&eacute;rence : ${artRef.ref}</td>
</tr>
<tr>
<td>Marque : ${artRef.marque}</td>
</tr>
<tr>
<td>Mod&egrave;le : ${artRef.modele}</td>
</tr>
<tr>
<td>Description : ${artRef.description}</td>
</tr>
<tr>
<td>Prix : ${artRef.prix}</td>
</tr>
</tbody>
</table>
</td>
<td>
<a href="./Panier?action=add&artRef=${artRef.ref}">ajouter au panier</a>
</td>
</tr>
</c:forEach>
</tbody>
</table>

View File

@ -0,0 +1,4 @@
<h2>Liste des articles disponibles</h2>
<P>Nous somme actuellement en rupture de stock !</P>
<P>Nous serons livr<76> tr<74>s prochainement.</P>
<a href="./index.jsp">Accueil</a>

View File

@ -0,0 +1 @@
://tetras.u-strasbg.fr/prive/pedagogie/outils/oragrive/requete.php

View File

@ -0,0 +1,3 @@
<h2>Contenu Panier</h2>
<p>Rien</p>
<a href="./Articles">Continuez les achats</a>

View File

@ -0,0 +1,67 @@
<h2>Payement</h2>
<p>Rappel de la commande :</p>
<table border="0" width="100%">
<thead>
<tr>
<th>Reference</th>
<th>Modele</th>
<th>Prix</th>
</tr>
</thead>
<tbody>
<c:forEach items="${articles}" var="artRef" >
<tr>
<td>
R&eacute;f&eacute;rence : ${artRef.ref}
</td>
<td>
Mod&egrave;le : ${artRef.modele}
</td>
<td>
Prix : ${artRef.prix}
</td>
</tr>
</c:forEach>
<tr>
<td colspan="2" class="tabTotal">Total :</td>
<td>
<jsp:useBean id="panierTotal" class="com.articles.Panier" scope="request" />
<jsp:getProperty name="panierTotal" property="prixTotal" />
</td>
</tr>
</tbody>
</table>
<hr width="100%" size="1">
<form method="post" action="./Client">
<table border="0">
<tbody>
<tr>
<td>Nom :</td>
<td><input type="text" id="nomCli" name="nomCli" size="10" value="" /></td>
</tr>
<tr>
<td>Pr<50>nom :</td>
<td><input type="text" id="prenomCli" name="prenomCli" size="10" value="" /></td>
</tr>
<tr>
<td>Adresse :</td>
<td><input type="text" id="addrCli" name="addrCli" size="10" value="" /></td>
</tr>
<tr>
<td>Code postal :</td>
<td><input type="text" id="cpCli" name="cpCli" size="10" value="" /></td>
</tr>
<tr>
<td>Ville :</td>
<td><input type="text" id="villeCli" name="villeCli" size="10" value="" /></td>
</tr>
</tbody>
</table>
<p>Note : le payement se fera <20> la livraison de la commande.</p>
<input type="hidden" name="action" value="payer" />
<input type="button" value="Annuler" onclick="javascript:document.location='./Articles'" />&nbsp;
<input type="submit" value="Payer" />
</form>

View File

@ -0,0 +1,44 @@
<h2>Confirmation de la commande</h2>
<p>Rappel de la commande :</p>
<table border="0" width="100%">
<thead>
<tr>
<th>Reference</th>
<th>Modele</th>
<th>Prix</th>
</tr>
</thead>
<tbody>
<c:forEach items="${articles}" var="artRef" >
<tr>
<td>
R&eacute;f&eacute;rence : ${artRef.ref}
</td>
<td>
Mod&egrave;le : ${artRef.modele}
</td>
<td>
Prix : ${artRef.prix}
</td>
</tr>
</c:forEach>
<tr>
<td colspan="2" class="tabTotal">Total :</td>
<td>
<jsp:useBean id="panierTotal" class="com.articles.Panier" scope="request" />
<jsp:getProperty name="panierTotal" property="prixTotal" />
</td>
</tr>
</tbody>
</table>
<hr width="100%" size="1">
<jsp:useBean id="client" class="com.articles.Client" scope="request" />
<p>Note : le payement se fera <20> la livraison de la commande <20> l'adresse suivante :<br />
<jsp:getProperty name="client" property="nom" />&nbsp;<jsp:getProperty name="client" property="prenom" /><br />
<jsp:getProperty name="client" property="adresse" /><br />
<jsp:getProperty name="client" property="codePost" />&nbsp;<jsp:getProperty name="client" property="ville" />
</p>

View File

@ -0,0 +1,53 @@
<h2>Contenu du Panier</h2>
<form method="post" action="./Client">
<table border="0" width="100%">
<thead>
<tr>
<th>Aper<65>u</th>
<th>Propri<72>t<EFBFBD>s</th>
<th>Quantit<69></th>
</tr>
</thead>
<tbody>
<c:forEach items="${articles}" var="artRef" >
<tr>
<td>
<img src="./img/${artRef.photo}" width="50" height="50" alt="image"/>
</td>
<td>
<table border="0" width="100%" height="100%">
<tbody>
<tr>
<td>R&eacute;f&eacute;rence : ${artRef.ref}</td>
</tr>
<tr>
<td>Marque : ${artRef.marque}</td>
</tr>
<tr>
<td>Mod&egrave;le : ${artRef.modele}</td>
</tr>
<tr>
<td>Prix : ${artRef.prix}</td>
</tr>
</tbody>
</table>
</td>
<td>
${artRef.quantite}
</td>
</tr>
</c:forEach>
<tr>
<td colspan="2" class="tabTotal">Total :</td>
<td>
<jsp:useBean id="panierTotal" class="com.articles.Panier" scope="request" />
<jsp:getProperty name="panierTotal" property="prixTotal" />
</td>
</tr>
</tbody>
</table>
<br />
<input type="button" value="Annuler" onclick="javascript:document.location='./Articles'" />&nbsp;
<input type="submit" value="Valider" />
</form>

View File

@ -0,0 +1,134 @@
body, html {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
a {
}
a:link {
color: white;
text-decoration: underline;
}
a:visited {
color: gray;
text-decoration: underline;
}
a:active {
}
a:hover {
}
div#contenu_principal {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
background-color: black;
color: orange;
}
div#contenu_principal div#tete {
width: 100%;
height: 70px;
margin: 0;
position: absolute;
top: 0;
left: 0;
background-color: #00bb00;
color: white;
text-align: center;
}
div#contenu_principal div#tete h1 {
margin: 0;
position: absolute;
left: 22%;
top: 22%;
color: lightgreen;
}
div#contenu_principal div#tete h1:after {
display: block;
margin-top: -1.15em;
margin-left: -0.1em;
color: green;
content: attr(title);
}
div#contenu_principal div#menu {
position: absolute;
width: 100%;
height: 25px;
margin: 0;
padding: 0;
top: 70px;
left: 0;
background-color: lightblue;
}
div#contenu_principal div#menu ul#menu_principal
{
height: 25px ;
margin: 0 ;
padding: 0 ;
background-color: #009933;
list-style-type: none ;
}
div#contenu_principal div#menu ul#menu_principal li
{
float: left ;
text-align: center ;
}
div#contenu_principal div#menu ul#menu_principal li a
{
width: 125px ;
line-height: 25px ;
font-size: 1.2em ;
font-weight: bold ;
letter-spacing: 2px ;
color: #fff ;
display: block ;
text-decoration: none ;
border-right: 2px solid #8BB18B ;
}
div#contenu_principal div#menu ul#menu_principal li a:hover
{
color: #AFCAAF;
background-color: #ceb;
}
div#contenu_principal div#contenu_secondaire {
width: 100%;
height: auto;
margin: 0;
padding: 0;
position: absolute;
top: 95px;
right: 0;
overflow: auto;
}
div#contenu_principal div#pied {
width: auto;
height: 15px;
margin: -14px 0 0 0;
padding-right: 3px;
position: absolute;
top: 70px;
right: 0;
color: green;
}
div#contenu_principal div#pied p {
margin: 0;
font-size: 13px;
}

View File

@ -0,0 +1,221 @@
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class contenuPanier_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List _jspx_dependants;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.AnnotationProcessor _jsp_annotationprocessor;
public Object getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
}
public void _jspDestroy() {
_005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems.release();
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\r\n");
out.write(" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("\r\n");
out.write("<html>\r\n");
out.write(" <head>\r\n");
out.write(" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
out.write("\t\t<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />\r\n");
out.write(" <title>RandoOnLine - Contenu du Panier</title>\r\n");
out.write(" </head>\r\n");
out.write(" <body>\r\n");
out.write("\r\n");
out.write(" <h1>RandoOnLine</h1>\r\n");
out.write(" <table border=\"0\" width=\"100%\">\r\n");
out.write(" <thead>\r\n");
out.write(" <tr>\r\n");
out.write(" <th><a href=\"./index.jsp\">Accueil</a></th>\r\n");
out.write(" <th>Panier</th>\r\n");
out.write(" <th><a href=\"./Articles\">Liste des articles</a></th>\r\n");
out.write(" <th><a href=\"./Panier?action=valider\">Passer <20> la caisse</a></th>\r\n");
out.write(" </tr>\r\n");
out.write(" </thead>\r\n");
out.write(" </table>\r\n");
out.write(" \r\n");
out.write(" <h2>Contenu du Panier</h2>\r\n");
out.write("\r\n");
out.write("\t<form method=\"post\" action=\"./Panier\">\r\n");
out.write(" <table border=\"0\" width=\"100%\">\r\n");
out.write(" <thead>\r\n");
out.write(" <tr>\r\n");
out.write(" <th>Aper<65>u</th>\r\n");
out.write(" <th>Propri<72>t<EFBFBD>s</th>\r\n");
out.write(" <th>Quantit<69></th>\r\n");
out.write(" <th>Action</th>\r\n");
out.write(" </tr>\r\n");
out.write(" </thead>\r\n");
out.write(" <tbody>\r\n");
if (_jspx_meth_c_005fforEach_005f0(_jspx_page_context))
return;
out.write("\r\n");
out.write("\t\t\t<tr>\r\n");
out.write(" <td colspan=\"3\" class=\"tabTotal\">Total :</td>\r\n");
out.write(" <td>\r\n");
com.articles.Panier panierTotal = null;
synchronized (request) {
panierTotal = (com.articles.Panier) _jspx_page_context.getAttribute("panierTotal", PageContext.REQUEST_SCOPE);
if (panierTotal == null){
panierTotal = new com.articles.Panier();
_jspx_page_context.setAttribute("panierTotal", panierTotal, PageContext.REQUEST_SCOPE);
}
}
out.write("\r\n");
out.write("\t\t\t\t\t");
out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((com.articles.Panier)_jspx_page_context.findAttribute("panierTotal")).getPrixTotal())));
out.write("\r\n");
out.write(" </td>\r\n");
out.write("\t\t\t</tr>\r\n");
out.write(" </tbody>\r\n");
out.write(" </table>\r\n");
out.write(" <br />\r\n");
out.write(" <input type=\"hidden\" name=\"action\" value=\"modif\" />\r\n");
out.write(" <input type=\"submit\" value=\"Recalculer\">\r\n");
out.write("\t</form>\r\n");
out.write(" </body>\r\n");
out.write("</html>\r\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
private boolean _jspx_meth_c_005fforEach_005f0(PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f0 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_005fforEach_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fforEach_005f0.setParent(null);
// /contenuPanier.jsp(42,0) name = items type = java.lang.Object reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setItems((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${articles}", java.lang.Object.class, (PageContext)_jspx_page_context, null, false));
// /contenuPanier.jsp(42,0) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setVar("artRef");
int[] _jspx_push_body_count_c_005fforEach_005f0 = new int[] { 0 };
try {
int _jspx_eval_c_005fforEach_005f0 = _jspx_th_c_005fforEach_005f0.doStartTag();
if (_jspx_eval_c_005fforEach_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\r\n");
out.write(" <tr>\r\n");
out.write(" <td>\r\n");
out.write(" <img src=\"./img/");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.photo}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("\" width=\"50\" height=\"50\" alt=\"image\"/>\r\n");
out.write(" </td>\r\n");
out.write(" <td>\r\n");
out.write(" <table border=\"0\" width=\"100%\" height=\"100%\">\r\n");
out.write(" <tbody>\r\n");
out.write(" <tr>\r\n");
out.write(" <td>R&eacute;f&eacute;rence : ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.ref}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("</td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td>Marque : ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.marque}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("</td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td>Mod&egrave;le : ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.modele}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("</td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td>Prix : ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.prix}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("</td>\r\n");
out.write(" </tr>\r\n");
out.write(" </tbody>\r\n");
out.write(" </table>\r\n");
out.write(" </td>\r\n");
out.write(" <td>\r\n");
out.write(" <input type=\"text\" id=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.ref}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("\" name=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.ref}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("\" maxLength=\"3\" size=\"3\" value=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.quantite}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("\" />\r\n");
out.write(" </td>\r\n");
out.write(" <td>\r\n");
out.write(" <a href=\"./Panier?action=del&artRef=");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.ref}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("\">enlever</a>\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
int evalDoAfterBody = _jspx_th_c_005fforEach_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fforEach_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (Throwable _jspx_exception) {
while (_jspx_push_body_count_c_005fforEach_005f0[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_c_005fforEach_005f0.doCatch(_jspx_exception);
} finally {
_jspx_th_c_005fforEach_005f0.doFinally();
_005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f0);
}
return false;
}
}

View File

@ -0,0 +1,147 @@
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class erreurs_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List _jspx_dependants;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.AnnotationProcessor _jsp_annotationprocessor;
public Object getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
}
public void _jspDestroy() {
_005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems.release();
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\r\n");
out.write(" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("\r\n");
out.write("<html>\r\n");
out.write(" <head>\r\n");
out.write(" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
out.write("\t\t<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />\r\n");
out.write(" <title>RandoOnLine - Erreurs</title>\r\n");
out.write(" </head>\r\n");
out.write(" <body>\r\n");
out.write("\r\n");
out.write(" <h1>RandoOnLine</h1>\r\n");
out.write(" <table border=\"0\" width=\"100%\">\r\n");
out.write(" <thead>\r\n");
out.write(" <tr>\r\n");
out.write(" <th><a href=\"./index.jsp\">Accueil</a></th>\r\n");
out.write(" <th><a href=\"./Panier\">Panier</a></th>\r\n");
out.write(" <th><a href=\"./Articles\">Liste des articles</a></th>\r\n");
out.write(" </tr>\r\n");
out.write(" </thead>\r\n");
out.write(" </table>\r\n");
out.write(" \r\n");
out.write("\t\t<h2>Les erreurs suivantes se sont produites : </h2>\r\n");
out.write("\t\t<ul>\r\n");
out.write("\t\t\t");
if (_jspx_meth_c_005fforEach_005f0(_jspx_page_context))
return;
out.write("\r\n");
out.write("\t\t</ul>\r\n");
out.write("\t</body>\r\n");
out.write("</html>\r\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
private boolean _jspx_meth_c_005fforEach_005f0(PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f0 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_005fforEach_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fforEach_005f0.setParent(null);
// /erreurs.jsp(30,3) name = items type = java.lang.Object reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setItems((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${erreurs}", java.lang.Object.class, (PageContext)_jspx_page_context, null, false));
// /erreurs.jsp(30,3) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setVar("err");
int[] _jspx_push_body_count_c_005fforEach_005f0 = new int[] { 0 };
try {
int _jspx_eval_c_005fforEach_005f0 = _jspx_th_c_005fforEach_005f0.doStartTag();
if (_jspx_eval_c_005fforEach_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\r\n");
out.write("\t\t\t\t\t<li>\r\n");
out.write("\t\t\t\t\t\t");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${err.message}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("\r\n");
out.write("\t\t\t\t\t</li>\r\n");
out.write("\t\t\t");
int evalDoAfterBody = _jspx_th_c_005fforEach_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fforEach_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (Throwable _jspx_exception) {
while (_jspx_push_body_count_c_005fforEach_005f0[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_c_005fforEach_005f0.doCatch(_jspx_exception);
} finally {
_jspx_th_c_005fforEach_005f0.doFinally();
_005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f0);
}
return false;
}
}

View File

@ -0,0 +1,84 @@
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List _jspx_dependants;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.AnnotationProcessor _jsp_annotationprocessor;
public Object getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
}
public void _jspDestroy() {
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\r\n");
out.write(" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("\r\n");
out.write("<html>\r\n");
out.write(" <head>\r\n");
out.write(" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
out.write("\t\t<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />\r\n");
out.write(" <title>RandoOnLine</title>\r\n");
out.write(" </head>\r\n");
out.write(" <body>\r\n");
out.write("\r\n");
out.write(" <h1>RandoOnLine</h1>\r\n");
out.write(" <br/>\r\n");
out.write(" <a href=\"./Articles\">Afficher les articles</a>\r\n");
out.write(" \r\n");
out.write(" </body>\r\n");
out.write("</html>\r\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}

View File

@ -0,0 +1,159 @@
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class infos_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List _jspx_dependants;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.AnnotationProcessor _jsp_annotationprocessor;
public Object getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
}
public void _jspDestroy() {
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\r\n");
out.write(" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("\r\n");
out.write("<html>\r\n");
out.write(" <head>\r\n");
out.write(" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
out.write("\t\t<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />\r\n");
out.write(" <title>Contenu du Panier</title>\r\n");
out.write(" </head>\r\n");
out.write(" <body>\r\n");
com.articles.Article art = null;
synchronized (request) {
art = (com.articles.Article) _jspx_page_context.getAttribute("art", PageContext.REQUEST_SCOPE);
if (art == null){
art = new com.articles.Article();
_jspx_page_context.setAttribute("art", art, PageContext.REQUEST_SCOPE);
}
}
out.write("\r\n");
out.write(" \r\n");
out.write("\t<h2>Infos sur l'article</h2>\r\n");
out.write(" <table border=\"0\" width=\"100%\">\r\n");
out.write(" <thead>\r\n");
out.write(" <tr>\r\n");
out.write(" <th>Aper<65>u</th>\r\n");
out.write(" <th>Propri<72>t<EFBFBD>s</th>\r\n");
out.write(" </tr>\r\n");
out.write(" </thead>\r\n");
out.write(" <tbody>\r\n");
out.write(" <tr>\r\n");
out.write(" <td>\r\n");
out.write(" <img src=\"./img/");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.photo}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("\" width=\"50\" height=\"50\" alt=\"image\"/>\r\n");
out.write(" </td>\r\n");
out.write(" <td>\r\n");
out.write(" <table border=\"0\" width=\"100%\" height=\"100%\">\r\n");
out.write(" <tbody>\r\n");
out.write(" <tr>\r\n");
out.write(" <td>R&eacute;f&eacute;rence :\r\n");
out.write(" ");
out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((com.articles.Article)_jspx_page_context.findAttribute("art")).getRef())));
out.write("</td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td>Marque : \r\n");
out.write(" ");
out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((com.articles.Article)_jspx_page_context.findAttribute("art")).getMarque())));
out.write("</td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td>Mod&egrave;le : \r\n");
out.write(" ");
out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((com.articles.Article)_jspx_page_context.findAttribute("art")).getModele())));
out.write("</td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td>Description : \r\n");
out.write(" ");
out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((com.articles.Article)_jspx_page_context.findAttribute("art")).getDescription())));
out.write("</td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td>Prix : \r\n");
out.write(" ");
out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((com.articles.Article)_jspx_page_context.findAttribute("art")).getPrix())));
out.write("</td>\r\n");
out.write(" </tr>\r\n");
out.write(" </tbody>\r\n");
out.write(" </table>\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
out.write(" </tbody>\r\n");
out.write(" </table>\r\n");
out.write("\t\t<hr width=\"100%\" size=\"1\">\r\n");
out.write("\t\t<form method=\"post\" action=\"./Panier?action=add\">\r\n");
out.write("\t\t\t<table>\r\n");
out.write("\t\t\t\t<tr>\r\n");
out.write("\t\t\t\t\t<td><input type=\"submit\" value=\"");
out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((com.articles.Article)_jspx_page_context.findAttribute("art")).getRef())));
out.write("\"></td>\r\n");
out.write("\t\t\t\t\t<td>Qt<51></td>\r\n");
out.write("\t\t\t\t\t<td>\r\n");
out.write("\t\t\t\t\t<input type=\"hidden\" value=\"Acheter\">\r\n");
out.write("\t\t\t\t\t<input type=\"text\" maxLength=\"3\" size=\"3\" id=\"txtQte\" name=\"txtQte\" /></td>\r\n");
out.write("\t\t\t\t\t</td>\r\n");
out.write("\t\t\t\t</tr>\r\n");
out.write("\t\t\t</table>\r\n");
out.write("\t\t</form>\r\n");
out.write("\t</body>\r\n");
out.write("</html>\r\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}

View File

@ -0,0 +1,95 @@
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class listeArticlesVide_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List _jspx_dependants;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.AnnotationProcessor _jsp_annotationprocessor;
public Object getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
}
public void _jspDestroy() {
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\r\n");
out.write(" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("\r\n");
out.write("<html>\r\n");
out.write(" <head>\r\n");
out.write(" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
out.write("\t\t<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />\r\n");
out.write(" <title>RandoOnLine - Articles disponibles</title>\r\n");
out.write(" </head>\r\n");
out.write(" <body>\r\n");
out.write(" <h1>RandoOnLine</h1>\r\n");
out.write(" <table border=\"0\" width=\"100%\">\r\n");
out.write(" <thead>\r\n");
out.write(" <tr>\r\n");
out.write(" <th><a href=\"./index.jsp\">Accueil</a></th>\r\n");
out.write(" <th><a href=\"./Panier\">Panier</a></th>\r\n");
out.write(" <th>Liste des articles</th>\r\n");
out.write(" </tr>\r\n");
out.write(" </thead>\r\n");
out.write(" </table>\r\n");
out.write(" \r\n");
out.write("\t\t<h2>Liste des articles disponibles</h2>\r\n");
out.write("\t\t<P>Nous somme actuellement en rupture de stock !</P>\r\n");
out.write("\t\t<P>Nous serons livr<76> tr<74>s prochainement.</P>\r\n");
out.write(" \t<a href=\"./index.jsp\">Accueil</a>\r\n");
out.write("\t</body>\r\n");
out.write("</html>\r\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}

View File

@ -0,0 +1,246 @@
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class listeArticles_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List _jspx_dependants;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.AnnotationProcessor _jsp_annotationprocessor;
public Object getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
}
public void _jspDestroy() {
_005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems.release();
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\r\n");
out.write(" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("\r\n");
out.write("<html>\r\n");
out.write(" <head>\r\n");
out.write(" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
out.write("\t\t<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />\r\n");
out.write(" <title>RandoOnLine - Articles disponibles</title>\r\n");
out.write(" </head>\r\n");
out.write(" <body>\r\n");
out.write(" \r\n");
out.write(" <h1>RandoOnLine</h1>\r\n");
out.write(" <table border=\"0\" width=\"100%\">\r\n");
out.write(" <thead>\r\n");
out.write(" <tr>\r\n");
out.write(" <th><a href=\"./index.jsp\">Accueil</a></th>\r\n");
out.write(" <th><a href=\"./Panier\">Panier</a></th>\r\n");
out.write(" <th>Liste des articles</th>\r\n");
out.write(" </tr>\r\n");
out.write(" </thead>\r\n");
out.write(" </table>\r\n");
out.write(" \r\n");
out.write("\t<h2>Filtre</h2>\r\n");
out.write("\t<form method=\"post\" action=\"./Articles\">\r\n");
out.write("\t\t<select id=\"lstCategs\" name=\"lstCategs\" size=\"1\">\r\n");
if (_jspx_meth_c_005fforEach_005f0(_jspx_page_context))
return;
out.write("\r\n");
out.write("\t\t</select>\r\n");
out.write(" <input type=\"submit\" value=\"Appliquer le filtre\">\r\n");
out.write("\t</form>\r\n");
out.write("\t\r\n");
out.write("\t<h2>Liste des articles disponibles</h2>\r\n");
out.write(" <table border=\"0\" width=\"100%\">\r\n");
out.write(" <thead>\r\n");
out.write(" <tr>\r\n");
out.write(" <th>Aper<65>u</th>\r\n");
out.write(" <th>Propri<72>t<EFBFBD>s</th>\r\n");
out.write(" <th>Action</th>\r\n");
out.write(" </tr>\r\n");
out.write(" </thead>\r\n");
out.write(" <tbody>\r\n");
if (_jspx_meth_c_005fforEach_005f1(_jspx_page_context))
return;
out.write("\r\n");
out.write(" </tbody>\r\n");
out.write(" </table>\r\n");
out.write("\t</body>\r\n");
out.write("</HTML>\r\n");
out.write(" ");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
private boolean _jspx_meth_c_005fforEach_005f0(PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f0 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_005fforEach_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fforEach_005f0.setParent(null);
// /listeArticles.jsp(31,0) name = items type = java.lang.Object reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setItems((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${categories}", java.lang.Object.class, (PageContext)_jspx_page_context, null, false));
// /listeArticles.jsp(31,0) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setVar("categ");
int[] _jspx_push_body_count_c_005fforEach_005f0 = new int[] { 0 };
try {
int _jspx_eval_c_005fforEach_005f0 = _jspx_th_c_005fforEach_005f0.doStartTag();
if (_jspx_eval_c_005fforEach_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\r\n");
out.write("\t\t\t<option value=\"");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${categ.id}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write('"');
out.write('>');
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${categ.cat}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("</option>\r\n");
int evalDoAfterBody = _jspx_th_c_005fforEach_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fforEach_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (Throwable _jspx_exception) {
while (_jspx_push_body_count_c_005fforEach_005f0[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_c_005fforEach_005f0.doCatch(_jspx_exception);
} finally {
_jspx_th_c_005fforEach_005f0.doFinally();
_005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f0);
}
return false;
}
private boolean _jspx_meth_c_005fforEach_005f1(PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f1 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_005fforEach_005f1.setPageContext(_jspx_page_context);
_jspx_th_c_005fforEach_005f1.setParent(null);
// /listeArticles.jsp(48,0) name = items type = java.lang.Object reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f1.setItems((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${articles}", java.lang.Object.class, (PageContext)_jspx_page_context, null, false));
// /listeArticles.jsp(48,0) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f1.setVar("artRef");
int[] _jspx_push_body_count_c_005fforEach_005f1 = new int[] { 0 };
try {
int _jspx_eval_c_005fforEach_005f1 = _jspx_th_c_005fforEach_005f1.doStartTag();
if (_jspx_eval_c_005fforEach_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\r\n");
out.write(" <tr>\r\n");
out.write(" <td>\r\n");
out.write(" <img src=\"./img/");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.photo}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("\" width=\"50\" height=\"50\" alt=\"image\"/>\r\n");
out.write(" </td>\r\n");
out.write(" <td>\r\n");
out.write(" <table border=\"0\" width=\"100%\" height=\"100%\">\r\n");
out.write(" <tbody>\r\n");
out.write(" <tr>\r\n");
out.write(" <td>R&eacute;f&eacute;rence : ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.ref}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("</td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td>Marque : ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.marque}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("</td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td>Mod&egrave;le : ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.modele}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("</td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td>Description : ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.description}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("</td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td>Prix : ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.prix}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("</td>\r\n");
out.write(" </tr>\r\n");
out.write(" </tbody>\r\n");
out.write(" </table>\r\n");
out.write(" </td>\r\n");
out.write(" <td>\r\n");
out.write(" <a href=\"./Panier?action=add&artRef=");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.ref}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("\">ajouter au panier</a>\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
int evalDoAfterBody = _jspx_th_c_005fforEach_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fforEach_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (Throwable _jspx_exception) {
while (_jspx_push_body_count_c_005fforEach_005f1[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_c_005fforEach_005f1.doCatch(_jspx_exception);
} finally {
_jspx_th_c_005fforEach_005f1.doFinally();
_005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f1);
}
return false;
}
}

View File

@ -0,0 +1,94 @@
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class panierVide_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List _jspx_dependants;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.AnnotationProcessor _jsp_annotationprocessor;
public Object getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
}
public void _jspDestroy() {
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\r\n");
out.write(" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("\r\n");
out.write("<html>\r\n");
out.write(" <head>\r\n");
out.write(" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
out.write("\t\t<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />\r\n");
out.write(" <title>RandoOnLine - Contenu du Panier</title>\r\n");
out.write(" </head>\r\n");
out.write(" <body>\r\n");
out.write(" <h1>RandoOnLine</h1>\r\n");
out.write(" <table border=\"0\" width=\"100%\">\r\n");
out.write(" <thead>\r\n");
out.write(" <tr>\r\n");
out.write(" <th><a href=\"./index.jsp\">Accueil</a></th>\r\n");
out.write(" <th>Panier</th>\r\n");
out.write(" <th><a href=\"./Articles\">Liste des articles</a></th>\r\n");
out.write(" </tr>\r\n");
out.write(" </thead>\r\n");
out.write(" </table>\r\n");
out.write(" \r\n");
out.write("\t\t<h2>Contenu de votre panier</h2>\r\n");
out.write("\t\t<P>Votre panier est vide</P>\r\n");
out.write(" \t<a href=\"./Articles\">Continuez vos achats</a>\r\n");
out.write("\t</body>\r\n");
out.write("</html>\r\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}

View File

@ -0,0 +1,219 @@
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class payement_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List _jspx_dependants;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.AnnotationProcessor _jsp_annotationprocessor;
public Object getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
}
public void _jspDestroy() {
_005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems.release();
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\r\n");
out.write(" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("\r\n");
out.write("<html>\r\n");
out.write(" <head>\r\n");
out.write(" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
out.write("\t\t<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />\r\n");
out.write(" <title>RandoOnLine - Payement</title>\r\n");
out.write(" </head>\r\n");
out.write(" <body>\r\n");
out.write("\r\n");
out.write(" <h1>RandoOnLine</h1>\r\n");
out.write(" <table border=\"0\" width=\"100%\">\r\n");
out.write(" <thead>\r\n");
out.write(" <tr>\r\n");
out.write(" <th><a href=\"./index.jsp\">Accueil</a></th>\r\n");
out.write(" <th><a href=\"./Panier\">Panier</a></th>\r\n");
out.write(" <th><a href=\"./Articles\">Liste des articles</a></th>\r\n");
out.write(" <th>Passer <20> la caisse</th>\r\n");
out.write(" </tr>\r\n");
out.write(" </thead>\r\n");
out.write(" </table>\r\n");
out.write(" \r\n");
out.write(" <h2>Payement</h2>\r\n");
out.write("\r\n");
out.write("\t<p>Rappel de la commande :</p>\r\n");
out.write(" <table border=\"0\" width=\"100%\">\r\n");
out.write(" <thead>\r\n");
out.write(" <tr>\r\n");
out.write(" <th>Reference</th>\r\n");
out.write(" <th>Modele</th>\r\n");
out.write(" <th>Prix</th>\r\n");
out.write(" </tr>\r\n");
out.write(" </thead>\r\n");
out.write(" <tbody>\r\n");
if (_jspx_meth_c_005fforEach_005f0(_jspx_page_context))
return;
out.write("\r\n");
out.write("\t\t\t<tr>\r\n");
out.write(" <td colspan=\"2\" class=\"tabTotal\">Total :</td>\r\n");
out.write(" <td>\r\n");
com.articles.Panier panierTotal = null;
synchronized (request) {
panierTotal = (com.articles.Panier) _jspx_page_context.getAttribute("panierTotal", PageContext.REQUEST_SCOPE);
if (panierTotal == null){
panierTotal = new com.articles.Panier();
_jspx_page_context.setAttribute("panierTotal", panierTotal, PageContext.REQUEST_SCOPE);
}
}
out.write("\r\n");
out.write("\t\t\t\t\t");
out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((com.articles.Panier)_jspx_page_context.findAttribute("panierTotal")).getPrixTotal())));
out.write("\r\n");
out.write(" </td>\r\n");
out.write("\t\t\t</tr>\r\n");
out.write(" </tbody>\r\n");
out.write(" </table>\r\n");
out.write("\r\n");
out.write("\t\t<hr width=\"100%\" size=\"1\">\r\n");
out.write("\r\n");
out.write("\t<form method=\"post\" action=\"./Client\">\r\n");
out.write("\t<table border=\"0\">\r\n");
out.write(" <tbody>\r\n");
out.write(" \t<tr>\r\n");
out.write(" \t\t<td>Nom :</td>\r\n");
out.write(" \t\t<td><input type=\"text\" id=\"nomCli\" name=\"nomCli\" size=\"10\" value=\"\" /></td>\r\n");
out.write(" \t</tr>\r\n");
out.write(" \t<tr>\r\n");
out.write(" \t\t<td>Pr<50>nom :</td>\r\n");
out.write(" \t\t<td><input type=\"text\" id=\"prenomCli\" name=\"prenomCli\" size=\"10\" value=\"\" /></td>\r\n");
out.write(" \t</tr>\r\n");
out.write(" \t<tr>\r\n");
out.write(" \t\t<td>Adresse :</td>\r\n");
out.write(" \t\t<td><input type=\"text\" id=\"addrCli\" name=\"addrCli\" size=\"10\" value=\"\" /></td>\r\n");
out.write(" \t</tr>\r\n");
out.write(" \t<tr>\r\n");
out.write(" \t\t<td>Code postal :</td>\r\n");
out.write(" \t\t<td><input type=\"text\" id=\"cpCli\" name=\"cpCli\" size=\"10\" value=\"\" /></td>\r\n");
out.write(" \t</tr>\r\n");
out.write(" \t<tr>\r\n");
out.write(" \t\t<td>Ville :</td>\r\n");
out.write(" \t\t<td><input type=\"text\" id=\"villeCli\" name=\"villeCli\" size=\"10\" value=\"\" /></td>\r\n");
out.write(" \t</tr>\r\n");
out.write(" </tbody>\r\n");
out.write(" </table>\r\n");
out.write(" <p>Note : le payement se fera <20> la livraison de la commande.</p>\r\n");
out.write(" <input type=\"hidden\" name=\"action\" value=\"payer\" />\r\n");
out.write(" <input type=\"button\" value=\"Annuler\" onclick=\"javascript:document.location='./index.jsp'\" />&nbsp;\r\n");
out.write(" <input type=\"submit\" value=\"Payer\" />\r\n");
out.write("\t</form>\r\n");
out.write(" </body>\r\n");
out.write("</html>\r\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
private boolean _jspx_meth_c_005fforEach_005f0(PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f0 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_005fforEach_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fforEach_005f0.setParent(null);
// /payement.jsp(41,0) name = items type = java.lang.Object reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setItems((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${articles}", java.lang.Object.class, (PageContext)_jspx_page_context, null, false));
// /payement.jsp(41,0) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setVar("artRef");
int[] _jspx_push_body_count_c_005fforEach_005f0 = new int[] { 0 };
try {
int _jspx_eval_c_005fforEach_005f0 = _jspx_th_c_005fforEach_005f0.doStartTag();
if (_jspx_eval_c_005fforEach_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\r\n");
out.write(" <tr>\r\n");
out.write(" <td>\r\n");
out.write(" \tR&eacute;f&eacute;rence : ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.ref}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("\r\n");
out.write(" </td>\r\n");
out.write("\t\t\t\t<td>\r\n");
out.write("\t\t\t\t\tMod&egrave;le : ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.modele}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("\r\n");
out.write("\t\t\t\t</td>\r\n");
out.write("\t <td>\r\n");
out.write("\t \tPrix : ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.prix}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("\r\n");
out.write("\t </td>\r\n");
out.write(" </tr>\r\n");
int evalDoAfterBody = _jspx_th_c_005fforEach_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fforEach_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (Throwable _jspx_exception) {
while (_jspx_push_body_count_c_005fforEach_005f0[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_c_005fforEach_005f0.doCatch(_jspx_exception);
} finally {
_jspx_th_c_005fforEach_005f0.doFinally();
_005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f0);
}
return false;
}
}

View File

@ -0,0 +1,214 @@
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class resultPayement_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List _jspx_dependants;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.AnnotationProcessor _jsp_annotationprocessor;
public Object getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
}
public void _jspDestroy() {
_005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems.release();
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\r\n");
out.write(" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("\r\n");
out.write("<html>\r\n");
out.write(" <head>\r\n");
out.write(" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
out.write("\t\t<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />\r\n");
out.write(" <title>RandoOnLine - Payement</title>\r\n");
out.write(" </head>\r\n");
out.write(" <body>\r\n");
out.write("\r\n");
out.write(" <h1>RandoOnLine</h1>\r\n");
out.write(" <table border=\"0\" width=\"100%\">\r\n");
out.write(" <thead>\r\n");
out.write(" <tr>\r\n");
out.write(" <th><a href=\"./index.jsp\">Accueil</a></th>\r\n");
out.write(" <th><a href=\"./Panier\">Panier</a></th>\r\n");
out.write(" <th><a href=\"./Articles\">Liste des articles</a></th>\r\n");
out.write(" <th>Passer <20> la caisse</th>\r\n");
out.write(" </tr>\r\n");
out.write(" </thead>\r\n");
out.write(" </table>\r\n");
out.write(" \r\n");
out.write(" <h2>Confirmation de la commande</h2>\r\n");
out.write("\r\n");
out.write("\t<p>Rappel de la commande :</p>\r\n");
out.write(" <table border=\"0\" width=\"100%\">\r\n");
out.write(" <thead>\r\n");
out.write(" <tr>\r\n");
out.write(" <th>Reference</th>\r\n");
out.write(" <th>Modele</th>\r\n");
out.write(" <th>Prix</th>\r\n");
out.write(" </tr>\r\n");
out.write(" </thead>\r\n");
out.write(" <tbody>\r\n");
if (_jspx_meth_c_005fforEach_005f0(_jspx_page_context))
return;
out.write("\r\n");
out.write("\t\t\t<tr>\r\n");
out.write(" <td colspan=\"2\" class=\"tabTotal\">Total :</td>\r\n");
out.write(" <td>\r\n");
com.articles.Panier panierTotal = null;
synchronized (request) {
panierTotal = (com.articles.Panier) _jspx_page_context.getAttribute("panierTotal", PageContext.REQUEST_SCOPE);
if (panierTotal == null){
panierTotal = new com.articles.Panier();
_jspx_page_context.setAttribute("panierTotal", panierTotal, PageContext.REQUEST_SCOPE);
}
}
out.write("\r\n");
out.write("\t\t\t\t\t");
out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((com.articles.Panier)_jspx_page_context.findAttribute("panierTotal")).getPrixTotal())));
out.write("\r\n");
out.write(" </td>\r\n");
out.write("\t\t\t</tr>\r\n");
out.write(" </tbody>\r\n");
out.write(" </table>\r\n");
out.write("\r\n");
out.write("\t\t<hr width=\"100%\" size=\"1\">\r\n");
out.write("\r\n");
out.write("\t");
com.articles.Client client = null;
synchronized (request) {
client = (com.articles.Client) _jspx_page_context.getAttribute("client", PageContext.REQUEST_SCOPE);
if (client == null){
client = new com.articles.Client();
_jspx_page_context.setAttribute("client", client, PageContext.REQUEST_SCOPE);
}
}
out.write("\r\n");
out.write(" <p>Note : le payement se fera <20> la livraison de la commande <20> l'adresse suivante :<br />\r\n");
out.write("\t\t");
out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((com.articles.Client)_jspx_page_context.findAttribute("client")).getNom())));
out.write("&nbsp;");
out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((com.articles.Client)_jspx_page_context.findAttribute("client")).getPrenom())));
out.write("<br />\r\n");
out.write(" \t");
out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((com.articles.Client)_jspx_page_context.findAttribute("client")).getAdresse())));
out.write("<br />\r\n");
out.write(" \t");
out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((com.articles.Client)_jspx_page_context.findAttribute("client")).getCodePost())));
out.write("&nbsp;");
out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((com.articles.Client)_jspx_page_context.findAttribute("client")).getVille())));
out.write("\r\n");
out.write(" </p>\r\n");
out.write(" </body>\r\n");
out.write("</html>\r\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
private boolean _jspx_meth_c_005fforEach_005f0(PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f0 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_005fforEach_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fforEach_005f0.setParent(null);
// /resultPayement.jsp(41,0) name = items type = java.lang.Object reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setItems((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${articles}", java.lang.Object.class, (PageContext)_jspx_page_context, null, false));
// /resultPayement.jsp(41,0) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setVar("artRef");
int[] _jspx_push_body_count_c_005fforEach_005f0 = new int[] { 0 };
try {
int _jspx_eval_c_005fforEach_005f0 = _jspx_th_c_005fforEach_005f0.doStartTag();
if (_jspx_eval_c_005fforEach_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\r\n");
out.write(" <tr>\r\n");
out.write(" <td>\r\n");
out.write(" \tR&eacute;f&eacute;rence : ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.ref}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("\r\n");
out.write(" </td>\r\n");
out.write("\t\t\t\t<td>\r\n");
out.write("\t\t\t\t\tMod&egrave;le : ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.modele}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("\r\n");
out.write("\t\t\t\t</td>\r\n");
out.write("\t <td>\r\n");
out.write("\t \tPrix : ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.prix}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("\r\n");
out.write("\t </td>\r\n");
out.write(" </tr>\r\n");
int evalDoAfterBody = _jspx_th_c_005fforEach_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fforEach_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (Throwable _jspx_exception) {
while (_jspx_push_body_count_c_005fforEach_005f0[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_c_005fforEach_005f0.doCatch(_jspx_exception);
} finally {
_jspx_th_c_005fforEach_005f0.doFinally();
_005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f0);
}
return false;
}
}

View File

@ -0,0 +1,211 @@
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class resumePanier_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List _jspx_dependants;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.AnnotationProcessor _jsp_annotationprocessor;
public Object getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
}
public void _jspDestroy() {
_005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems.release();
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\r\n");
out.write(" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("\r\n");
out.write("<html>\r\n");
out.write(" <head>\r\n");
out.write(" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
out.write("\t\t<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />\r\n");
out.write(" <title>RandoOnLine - Resume du Panier</title>\r\n");
out.write(" </head>\r\n");
out.write(" <body>\r\n");
out.write("\r\n");
out.write(" <h1>RandoOnLine</h1>\r\n");
out.write(" <table border=\"0\" width=\"100%\">\r\n");
out.write(" <thead>\r\n");
out.write(" <tr>\r\n");
out.write(" <th><a href=\"./index.jsp\">Accueil</a></th>\r\n");
out.write(" <th><a href=\"./Panier\">Panier</a></th>\r\n");
out.write(" <th><a href=\"./Articles\">Liste des articles</a></th>\r\n");
out.write(" <th>Passer <20> la caisse</th>\r\n");
out.write(" </tr>\r\n");
out.write(" </thead>\r\n");
out.write(" </table>\r\n");
out.write(" \r\n");
out.write(" <h2>Contenu du Panier</h2>\r\n");
out.write("\r\n");
out.write("\t<form method=\"post\" action=\"./Client\">\r\n");
out.write(" <table border=\"0\" width=\"100%\">\r\n");
out.write(" <thead>\r\n");
out.write(" <tr>\r\n");
out.write(" <th>Aper<65>u</th>\r\n");
out.write(" <th>Propri<72>t<EFBFBD>s</th>\r\n");
out.write(" <th>Quantit<69></th>\r\n");
out.write(" </tr>\r\n");
out.write(" </thead>\r\n");
out.write(" <tbody>\r\n");
if (_jspx_meth_c_005fforEach_005f0(_jspx_page_context))
return;
out.write("\r\n");
out.write("\t\t\t<tr>\r\n");
out.write(" <td colspan=\"2\" class=\"tabTotal\">Total :</td>\r\n");
out.write(" <td>\r\n");
com.articles.Panier panierTotal = null;
synchronized (request) {
panierTotal = (com.articles.Panier) _jspx_page_context.getAttribute("panierTotal", PageContext.REQUEST_SCOPE);
if (panierTotal == null){
panierTotal = new com.articles.Panier();
_jspx_page_context.setAttribute("panierTotal", panierTotal, PageContext.REQUEST_SCOPE);
}
}
out.write("\r\n");
out.write("\t\t\t\t\t");
out.write(org.apache.jasper.runtime.JspRuntimeLibrary.toString((((com.articles.Panier)_jspx_page_context.findAttribute("panierTotal")).getPrixTotal())));
out.write("\r\n");
out.write(" </td>\r\n");
out.write("\t\t\t</tr>\r\n");
out.write(" </tbody>\r\n");
out.write(" </table>\r\n");
out.write(" <br />\r\n");
out.write(" <input type=\"button\" value=\"Annuler\" onclick=\"javascript:document.location='./index.jsp'\" />&nbsp;\r\n");
out.write(" <input type=\"submit\" value=\"Valider\" />\r\n");
out.write("\t</form>\r\n");
out.write(" </body>\r\n");
out.write("</html>\r\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
private boolean _jspx_meth_c_005fforEach_005f0(PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:forEach
org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_005fforEach_005f0 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);
_jspx_th_c_005fforEach_005f0.setPageContext(_jspx_page_context);
_jspx_th_c_005fforEach_005f0.setParent(null);
// /resumePanier.jsp(41,0) name = items type = java.lang.Object reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setItems((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${articles}", java.lang.Object.class, (PageContext)_jspx_page_context, null, false));
// /resumePanier.jsp(41,0) name = var type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_c_005fforEach_005f0.setVar("artRef");
int[] _jspx_push_body_count_c_005fforEach_005f0 = new int[] { 0 };
try {
int _jspx_eval_c_005fforEach_005f0 = _jspx_th_c_005fforEach_005f0.doStartTag();
if (_jspx_eval_c_005fforEach_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
do {
out.write("\r\n");
out.write(" <tr>\r\n");
out.write(" <td>\r\n");
out.write(" <img src=\"./img/");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.photo}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("\" width=\"50\" height=\"50\" alt=\"image\"/>\r\n");
out.write(" </td>\r\n");
out.write(" <td>\r\n");
out.write(" <table border=\"0\" width=\"100%\" height=\"100%\">\r\n");
out.write(" <tbody>\r\n");
out.write(" <tr>\r\n");
out.write(" <td>R&eacute;f&eacute;rence : ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.ref}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("</td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td>Marque : ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.marque}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("</td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td>Mod&egrave;le : ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.modele}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("</td>\r\n");
out.write(" </tr>\r\n");
out.write(" <tr>\r\n");
out.write(" <td>Prix : ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.prix}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("</td>\r\n");
out.write(" </tr>\r\n");
out.write(" </tbody>\r\n");
out.write(" </table>\r\n");
out.write(" </td>\r\n");
out.write(" <td>\r\n");
out.write(" ");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${artRef.quantite}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
out.write("\r\n");
out.write(" </td>\r\n");
out.write(" </tr>\r\n");
int evalDoAfterBody = _jspx_th_c_005fforEach_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
}
if (_jspx_th_c_005fforEach_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
return true;
}
} catch (Throwable _jspx_exception) {
while (_jspx_push_body_count_c_005fforEach_005f0[0]-- > 0)
out = _jspx_page_context.popBody();
_jspx_th_c_005fforEach_005f0.doCatch(_jspx_exception);
} finally {
_jspx_th_c_005fforEach_005f0.doFinally();
_005fjspx_005ftagPool_005fc_005fforEach_005fvar_005fitems.reuse(_jspx_th_c_005fforEach_005f0);
}
return false;
}
}