Grosse MàJ
This commit is contained in:
6
workspace/ROOT/.classpath
Normal file
6
workspace/ROOT/.classpath
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path=""/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="output" path=""/>
|
||||
</classpath>
|
17
workspace/ROOT/.project
Normal file
17
workspace/ROOT/.project
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>ROOT</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>
|
||||
</natures>
|
||||
</projectDescription>
|
BIN
workspace/ROOT/Article.class
Normal file
BIN
workspace/ROOT/Article.class
Normal file
Binary file not shown.
78
workspace/ROOT/Article.java
Normal file
78
workspace/ROOT/Article.java
Normal file
@ -0,0 +1,78 @@
|
||||
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;
|
||||
}
|
||||
}
|
BIN
workspace/ROOT/ArticlePanier.class
Normal file
BIN
workspace/ROOT/ArticlePanier.class
Normal file
Binary file not shown.
25
workspace/ROOT/ArticlePanier.java
Normal file
25
workspace/ROOT/ArticlePanier.java
Normal file
@ -0,0 +1,25 @@
|
||||
public class ArticlePanier
|
||||
{
|
||||
private String ref = "";
|
||||
private int quantite = 0;
|
||||
|
||||
public String getRef()
|
||||
{
|
||||
return this.ref;
|
||||
}
|
||||
|
||||
public void setRef(String ref)
|
||||
{
|
||||
this.ref = ref;
|
||||
}
|
||||
|
||||
public int getQuantite()
|
||||
{
|
||||
return this.quantite;
|
||||
}
|
||||
|
||||
public void setQuantite(int quantite)
|
||||
{
|
||||
this.quantite = quantite;
|
||||
}
|
||||
}
|
BIN
workspace/ROOT/ArticlesTag.class
Normal file
BIN
workspace/ROOT/ArticlesTag.class
Normal file
Binary file not shown.
35
workspace/ROOT/ArticlesTag.java
Normal file
35
workspace/ROOT/ArticlesTag.java
Normal file
@ -0,0 +1,35 @@
|
||||
import javax.servlet.jsp.JspException;
|
||||
import javax.servlet.jsp.tagext.SimpleTagSupport;
|
||||
import java.io.IOException;
|
||||
import java.util.Vector;
|
||||
import com.articles.Article;
|
||||
|
||||
public class ArticlesTag
|
||||
extends SimpleTagSupport
|
||||
{
|
||||
private String var;
|
||||
|
||||
public void doTag()
|
||||
throws JspException, IOException
|
||||
{
|
||||
Vector<Article> vArts = (Vector<Article>)getJspContext().getAttribute("articles");
|
||||
|
||||
if (vArts == null)
|
||||
{
|
||||
getJspContext().setAttribute(this.var, new Article() );
|
||||
getJspBody().invoke(null);
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i=0; i<vArts.size(); i++)
|
||||
{
|
||||
getJspContext().setAttribute(this.var, (Article)vArts.get(i) );
|
||||
getJspBody().invoke(null);
|
||||
}
|
||||
}
|
||||
|
||||
public void setVar( String var )
|
||||
{
|
||||
this.var = var;
|
||||
}
|
||||
}
|
BIN
workspace/ROOT/GestionConnexion.class
Normal file
BIN
workspace/ROOT/GestionConnexion.class
Normal file
Binary file not shown.
357
workspace/ROOT/GestionConnexion.java
Normal file
357
workspace/ROOT/GestionConnexion.java
Normal file
@ -0,0 +1,357 @@
|
||||
import java.sql.*;
|
||||
import java.util.Vector;
|
||||
|
||||
enum OperationBDD
|
||||
{
|
||||
OP_BDD_SELECTION,
|
||||
OP_BDD_CREER_TABLE,
|
||||
OP_BDD_SUPPR_TABLE
|
||||
}
|
||||
|
||||
public class GestionConnexion
|
||||
{
|
||||
|
||||
private ParametresConnexion paramsConn;
|
||||
|
||||
private Connection connection = null;
|
||||
private Statement statement = null;
|
||||
|
||||
private String requeteSQL = "";
|
||||
private ResultSet resultSet = null;
|
||||
|
||||
private Vector<String> vs_erreurs = null;
|
||||
private Vector<String> vs_anomalies = null;
|
||||
|
||||
|
||||
public GestionConnexion()
|
||||
throws ClassNotFoundException, Exception
|
||||
{
|
||||
|
||||
this.statement = null;
|
||||
this.resultSet = null;
|
||||
this.requeteSQL = "";
|
||||
|
||||
this.paramsConn = new ParametresConnexion();
|
||||
|
||||
this.vs_erreurs = new Vector<String>();
|
||||
this.vs_anomalies = new Vector<String>();
|
||||
|
||||
try
|
||||
{
|
||||
Class.forName(ParametresConnexion.CLASSE).newInstance();
|
||||
}
|
||||
catch (ClassNotFoundException ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void ouvrir(ParametresConnexion params)
|
||||
{
|
||||
if (params == null)
|
||||
throw new NullPointerException();
|
||||
|
||||
this.paramsConn.CopierDepuis(params);
|
||||
|
||||
this.ouvrir();
|
||||
}
|
||||
|
||||
public void ouvrir()
|
||||
{
|
||||
try
|
||||
{
|
||||
this.fermerConnexion();
|
||||
|
||||
this.connection = DriverManager.getConnection(this.paramsConn.getUrl(),
|
||||
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
|
||||
{
|
||||
if (this.resultSet != null)
|
||||
{
|
||||
this.resultSet.close();
|
||||
this.resultSet = null;
|
||||
}
|
||||
|
||||
if (this.statement != null)
|
||||
{
|
||||
this.statement.close();
|
||||
this.statement = null;
|
||||
}
|
||||
|
||||
this.requeteSQL = "";
|
||||
}
|
||||
catch (SQLException ex)
|
||||
{
|
||||
this.traiterSQLException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public void fermerConnexion()
|
||||
{
|
||||
try
|
||||
{
|
||||
this.fermerRessourcesRequete();
|
||||
|
||||
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
|
||||
{
|
||||
if (this.connection != null)
|
||||
{
|
||||
this.fermerRessourcesRequete();
|
||||
|
||||
this.statement = this.connection.createStatement();
|
||||
this.traiterWarning(this.statement.getWarnings());
|
||||
|
||||
this.resultSet = this.statement.executeQuery(query);
|
||||
this.traiterWarning(this.resultSet.getWarnings());
|
||||
|
||||
this.requeteSQL = query;
|
||||
}
|
||||
}
|
||||
catch (SQLException ex)
|
||||
{
|
||||
this.traiterSQLException(ex);
|
||||
|
||||
this.fermerRessourcesRequete();
|
||||
|
||||
res = false;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
public int lancerRequeteModifBDD(String query)
|
||||
{
|
||||
int res = 0;
|
||||
|
||||
try
|
||||
{
|
||||
if (this.connection != null)
|
||||
{
|
||||
this.fermerRessourcesRequete();
|
||||
|
||||
this.statement = this.connection.createStatement();
|
||||
|
||||
res = this.statement.executeUpdate(query);
|
||||
this.traiterWarning(this.statement.getWarnings());
|
||||
|
||||
this.requeteSQL = query;
|
||||
}
|
||||
}
|
||||
catch (SQLException ex)
|
||||
{
|
||||
this.traiterSQLException(ex);
|
||||
|
||||
this.fermerRessourcesRequete();
|
||||
|
||||
res = -1;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
public ParametresConnexion getParametresConnexion()
|
||||
{
|
||||
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
|
||||
{
|
||||
if (this.estOuverte())
|
||||
{
|
||||
vs_infosConn.add("Etat de la connexion : ouverte");
|
||||
vs_infosConn.add("------------------------------");
|
||||
|
||||
dmd = this.connection.getMetaData();
|
||||
|
||||
vs_infosConn.add("Connexion : " + dmd.getURL());
|
||||
vs_infosConn.add("Driver : " + dmd.getDriverName());
|
||||
vs_infosConn.add("Version : " + dmd.getDriverVersion());
|
||||
}
|
||||
else
|
||||
{
|
||||
vs_infosConn.add("Etat de la connexion : ferm<72>e");
|
||||
vs_infosConn.add("------------------------------");
|
||||
|
||||
vs_infosConn.add("Connexion : " + this.paramsConn.getUrl());
|
||||
vs_infosConn.add("Utilisateur : " + this.paramsConn.Utilisateur);
|
||||
vs_infosConn.add("Mot de passe : " + this.paramsConn.Pwd.length() + " caract<63>re(s)");
|
||||
}
|
||||
}
|
||||
catch (SQLException ex)
|
||||
{
|
||||
this.traiterSQLException(ex);
|
||||
}
|
||||
|
||||
return vs_infosConn;
|
||||
}
|
||||
|
||||
public Vector<String> getNomsColonnes()
|
||||
{
|
||||
Vector<String> vs_cols = new Vector<String>();
|
||||
ResultSetMetaData rsmd;
|
||||
|
||||
try
|
||||
{
|
||||
if (this.resultSet != null)
|
||||
{
|
||||
rsmd = this.resultSet.getMetaData();
|
||||
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)
|
||||
this.vs_anomalies.add("Vous n'avez pas encore lanc<6E> la requ<71>te!!");
|
||||
}
|
||||
catch (SQLException ex)
|
||||
{
|
||||
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();
|
||||
if (rsmd.getColumnCount() > 0)
|
||||
{
|
||||
while (this.resultSet.next())
|
||||
{
|
||||
Vector<Object> vo_ligne = new Vector<Object>();
|
||||
for (int idCol = 1; idCol <= rsmd.getColumnCount(); idCol++)
|
||||
vo_ligne.add(this.resultSet.getObject(idCol));
|
||||
v_datas.add(vo_ligne);
|
||||
}
|
||||
}
|
||||
|
||||
if (v_datas.isEmpty())
|
||||
this.vs_anomalies.add("Aucune donn<6E>e trouv<75>e!!");
|
||||
}
|
||||
catch (SQLException ex)
|
||||
{
|
||||
this.traiterSQLException(ex);
|
||||
}
|
||||
|
||||
return v_datas;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
BIN
workspace/ROOT/ListeArticles.class
Normal file
BIN
workspace/ROOT/ListeArticles.class
Normal file
Binary file not shown.
84
workspace/ROOT/ListeArticles.java
Normal file
84
workspace/ROOT/ListeArticles.java
Normal file
@ -0,0 +1,84 @@
|
||||
import java.io.*;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.*;
|
||||
|
||||
import java.util.Vector;
|
||||
import com.articles.Article;
|
||||
import com.articles.ArticlePanier;
|
||||
import com.gestionnaires.Erreur;
|
||||
import com.gestionnaires.GestionnairePanier;
|
||||
|
||||
public class ListeArticles
|
||||
extends HttpServlet
|
||||
{
|
||||
com.gestionnaires.GestionnaireArticles gestArts = null;
|
||||
|
||||
private void traiteRequeteHttp(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException
|
||||
{
|
||||
String sAction;
|
||||
String sInfoArtRef;
|
||||
String sPageAffichage;
|
||||
Vector<Article> vArts = new Vector<Article>();
|
||||
Article tmpArt = null;
|
||||
|
||||
sAction = request.getParameter("action");
|
||||
if (sAction.equals("info"))
|
||||
{
|
||||
sInfoArtRef = request.getParameter("artRef");
|
||||
|
||||
tmpArt = new Article();
|
||||
tmpArt.setRef(sInfoArtRef);
|
||||
|
||||
request.setAttribute("art", tmpArt);
|
||||
sPageAffichage = "/infos.jsp";
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i=0; i<5; i++)
|
||||
{
|
||||
tmpArt = new Article();
|
||||
tmpArt.setRef("refArt"+i);
|
||||
tmpArt.setCateg("cat"+i);
|
||||
tmpArt.setDescription("desc"+1);
|
||||
vArts.add(tmpArt);
|
||||
}
|
||||
|
||||
if (!vArts.isEmpty())
|
||||
{
|
||||
request.setAttribute("articles", vArts);
|
||||
|
||||
sPageAffichage = "/listeArticles.jsp";
|
||||
}
|
||||
else
|
||||
{
|
||||
Vector<Erreur> vErrs = new Vector<Erreur>();
|
||||
vErrs.add(new Erreur("Articles non disponibles"));
|
||||
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.traiteRequeteHttp(request, response);
|
||||
}
|
||||
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException
|
||||
{
|
||||
this.traiteRequeteHttp(request, response);
|
||||
}
|
||||
|
||||
public String getServletInfo() {
|
||||
return "Gestion du panier";
|
||||
}
|
||||
}
|
4
workspace/ROOT/META-INF/MANIFEST.MF
Normal file
4
workspace/ROOT/META-INF/MANIFEST.MF
Normal file
@ -0,0 +1,4 @@
|
||||
Manifest-Version: 1.0
|
||||
Ant-Version: Apache Ant 1.6.5
|
||||
Created-By: 1.5.0_06-b05 (Sun Microsystems Inc.)
|
||||
|
BIN
workspace/ROOT/MesHaricots/utilisateur.class
Normal file
BIN
workspace/ROOT/MesHaricots/utilisateur.class
Normal file
Binary file not shown.
18
workspace/ROOT/MesHaricots/utilisateur.java
Normal file
18
workspace/ROOT/MesHaricots/utilisateur.java
Normal file
@ -0,0 +1,18 @@
|
||||
package MesHaricots;
|
||||
|
||||
public class utilisateur {
|
||||
|
||||
private String identifiant;
|
||||
|
||||
public utilisateur() {
|
||||
}
|
||||
|
||||
|
||||
public String getId() {
|
||||
return identifiant;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.identifiant = id;
|
||||
}
|
||||
}
|
BIN
workspace/ROOT/Panier.class
Normal file
BIN
workspace/ROOT/Panier.class
Normal file
Binary file not shown.
93
workspace/ROOT/Panier.java
Normal file
93
workspace/ROOT/Panier.java
Normal file
@ -0,0 +1,93 @@
|
||||
import java.io.*;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.*;
|
||||
|
||||
import java.lang.*;
|
||||
import java.util.Vector;
|
||||
import com.articles.Article;
|
||||
import com.articles.ArticlePanier;
|
||||
import com.gestionnaires.Erreur;
|
||||
import com.gestionnaires.GestionnairePanier;
|
||||
|
||||
public class Panier
|
||||
extends HttpServlet
|
||||
{
|
||||
com.gestionnaires.GestionnaireArticles gestArts = null;
|
||||
|
||||
private void traiteRequeteHttp(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException
|
||||
{
|
||||
HttpSession session = request.getSession(true);
|
||||
Vector<ArticlePanier> vArtsPan = null;
|
||||
Vector<Article> vArts = new Vector<Article>();
|
||||
Article tmpArt = null;
|
||||
String sAction;
|
||||
String sPageAffichage;
|
||||
|
||||
GestionnairePanier panier = (GestionnairePanier)session.getAttribute("caddy");
|
||||
if ( panier == null )
|
||||
{
|
||||
panier = new GestionnairePanier();
|
||||
|
||||
session.setAttribute("caddy", panier) ;
|
||||
}
|
||||
|
||||
sAction = request.getParameter("action");
|
||||
if (sAction == null)
|
||||
{
|
||||
;
|
||||
}
|
||||
else if (sAction.equals("add"))
|
||||
{
|
||||
panier.ajouterAchat(request.getParameter("artRef"), Integer.parseInt(request.getParameter("artQuant")));
|
||||
}
|
||||
else if (sAction.equals("del"))
|
||||
{
|
||||
panier.enleverAchat(request.getParameter("artRef"));
|
||||
}
|
||||
|
||||
vArtsPan = panier.donneContenu();
|
||||
|
||||
for (int i=0; i<vArtsPan.size(); i++)
|
||||
{
|
||||
tmpArt = new Article();
|
||||
tmpArt.setRef(vArtsPan.get(i).getRef());
|
||||
tmpArt.setQuantite(vArtsPan.get(i).getQuantite());
|
||||
tmpArt.setCateg("cat"+i);
|
||||
tmpArt.setDescription("desc"+1);
|
||||
vArts.add(tmpArt);
|
||||
}
|
||||
|
||||
if (!vArts.isEmpty())
|
||||
{
|
||||
request.setAttribute("articles", vArts);
|
||||
|
||||
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.traiteRequeteHttp(request, response);
|
||||
}
|
||||
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException
|
||||
{
|
||||
this.traiteRequeteHttp(request, response);
|
||||
}
|
||||
|
||||
public String getServletInfo() {
|
||||
return "Gestion du panier";
|
||||
}
|
||||
}
|
BIN
workspace/ROOT/ParametresConnexion.class
Normal file
BIN
workspace/ROOT/ParametresConnexion.class
Normal file
Binary file not shown.
42
workspace/ROOT/ParametresConnexion.java
Normal file
42
workspace/ROOT/ParametresConnexion.java
Normal file
@ -0,0 +1,42 @@
|
||||
public class ParametresConnexion
|
||||
{
|
||||
public String Serveur = "http://canette.u-strasbg.fr";
|
||||
public String Port = "3001";
|
||||
public String Base = "v920";
|
||||
public String Utilisateur = "dut";
|
||||
public String Pwd = "dut";
|
||||
public static final String CLASSE = "oracle.jdbc.driver.OracleDriver";
|
||||
public static final String URL_BASE = "jdbc:oracle:thin:";
|
||||
|
||||
|
||||
public ParametresConnexion( ParametresConnexion params )
|
||||
{
|
||||
this.CopierDepuis(params);
|
||||
}
|
||||
|
||||
public ParametresConnexion(String serveur, String port, String base,
|
||||
String utilisateur, String pwd)
|
||||
{
|
||||
this.Serveur = serveur;
|
||||
this.Port = port;
|
||||
this.Base = base;
|
||||
this.Utilisateur = utilisateur;
|
||||
this.Pwd = pwd;
|
||||
}
|
||||
|
||||
|
||||
public String getUrl()
|
||||
{
|
||||
return ParametresConnexion.URL_BASE + "@" + this.Serveur + ":" + this.Port + ":" + this.Base;
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
BIN
workspace/ROOT/ServletController.class
Normal file
BIN
workspace/ROOT/ServletController.class
Normal file
Binary file not shown.
53
workspace/ROOT/ServletController.java
Normal file
53
workspace/ROOT/ServletController.java
Normal file
@ -0,0 +1,53 @@
|
||||
import java.io.IOException;
|
||||
import javax.servlet.RequestDispatcher;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
/*import MesHaricots.utilisateur;
|
||||
/**
|
||||
* * Servlet implementation class for Servlet: ServTest
|
||||
* *
|
||||
* */
|
||||
public class ServletController extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
|
||||
static final long serialVersionUID = 1L;
|
||||
|
||||
/* (non-Java-doc)
|
||||
* * @see javax.servlet.http.HttpServlet#HttpServlet()
|
||||
* */
|
||||
public ServletController() {
|
||||
super();
|
||||
}
|
||||
|
||||
/* (non-Java-doc)
|
||||
* * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
* */
|
||||
protected void doGet(HttpServletRequest requete, HttpServletResponse reponse)
|
||||
throws ServletException, IOException {
|
||||
String jspPage = "/vues/loginForm.jsp";
|
||||
ServletContext sc = getServletContext();
|
||||
RequestDispatcher rd = sc.getRequestDispatcher(jspPage);
|
||||
rd.forward(requete,reponse);
|
||||
|
||||
}
|
||||
|
||||
/* (non-Java-doc)
|
||||
* * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
* */
|
||||
protected void doPost(HttpServletRequest requete, HttpServletResponse reponse)
|
||||
throws ServletException, IOException {
|
||||
|
||||
String identifiant = requete.getParameter("id");
|
||||
|
||||
String jspPage = "/vues/salut.jsp";
|
||||
ServletContext sc = getServletContext();
|
||||
RequestDispatcher rd = sc.getRequestDispatcher(jspPage);
|
||||
/* utilisateur user = new utilisateur();
|
||||
user.setId(identifiant);
|
||||
requete.setAttribute("monUtilisateur", user);*/
|
||||
rd.forward(requete,reponse);
|
||||
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
}
|
BIN
workspace/ROOT/balise/afficheutilisateur.class
Normal file
BIN
workspace/ROOT/balise/afficheutilisateur.class
Normal file
Binary file not shown.
14
workspace/ROOT/balise/afficheutilisateur.java
Normal file
14
workspace/ROOT/balise/afficheutilisateur.java
Normal file
@ -0,0 +1,14 @@
|
||||
package balise;
|
||||
|
||||
import javax.servlet.jsp.JspException;
|
||||
import javax.servlet.jsp.tagext.SimpleTagSupport;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* * * SimpleTag handler that prints "Hello, world!"
|
||||
* * */
|
||||
public class afficheutilisateur extends SimpleTagSupport {
|
||||
public void doTag() throws JspException, IOException {
|
||||
getJspContext().getOut().write( "Bonjour !" );
|
||||
}
|
||||
}
|
BIN
workspace/ROOT/javax/servlet/Filter.class
Normal file
BIN
workspace/ROOT/javax/servlet/Filter.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/FilterChain.class
Normal file
BIN
workspace/ROOT/javax/servlet/FilterChain.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/FilterConfig.class
Normal file
BIN
workspace/ROOT/javax/servlet/FilterConfig.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/GenericServlet.class
Normal file
BIN
workspace/ROOT/javax/servlet/GenericServlet.class
Normal file
Binary file not shown.
21
workspace/ROOT/javax/servlet/LocalStrings.properties
Normal file
21
workspace/ROOT/javax/servlet/LocalStrings.properties
Normal file
@ -0,0 +1,21 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Default localized string information
|
||||
# Localized for Locale en_US
|
||||
|
||||
err.not_iso8859_1=Not an ISO 8859-1 character: {0}
|
||||
value.true=true
|
||||
value.false=false
|
BIN
workspace/ROOT/javax/servlet/RequestDispatcher.class
Normal file
BIN
workspace/ROOT/javax/servlet/RequestDispatcher.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/Servlet.class
Normal file
BIN
workspace/ROOT/javax/servlet/Servlet.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/ServletConfig.class
Normal file
BIN
workspace/ROOT/javax/servlet/ServletConfig.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/ServletContext.class
Normal file
BIN
workspace/ROOT/javax/servlet/ServletContext.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/ServletContextAttributeEvent.class
Normal file
BIN
workspace/ROOT/javax/servlet/ServletContextAttributeEvent.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/ServletContextEvent.class
Normal file
BIN
workspace/ROOT/javax/servlet/ServletContextEvent.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/ServletContextListener.class
Normal file
BIN
workspace/ROOT/javax/servlet/ServletContextListener.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/ServletException.class
Normal file
BIN
workspace/ROOT/javax/servlet/ServletException.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/ServletInputStream.class
Normal file
BIN
workspace/ROOT/javax/servlet/ServletInputStream.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/ServletOutputStream.class
Normal file
BIN
workspace/ROOT/javax/servlet/ServletOutputStream.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/ServletRequest.class
Normal file
BIN
workspace/ROOT/javax/servlet/ServletRequest.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/ServletRequestAttributeEvent.class
Normal file
BIN
workspace/ROOT/javax/servlet/ServletRequestAttributeEvent.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/ServletRequestEvent.class
Normal file
BIN
workspace/ROOT/javax/servlet/ServletRequestEvent.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/ServletRequestListener.class
Normal file
BIN
workspace/ROOT/javax/servlet/ServletRequestListener.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/ServletRequestWrapper.class
Normal file
BIN
workspace/ROOT/javax/servlet/ServletRequestWrapper.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/ServletResponse.class
Normal file
BIN
workspace/ROOT/javax/servlet/ServletResponse.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/ServletResponseWrapper.class
Normal file
BIN
workspace/ROOT/javax/servlet/ServletResponseWrapper.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/SingleThreadModel.class
Normal file
BIN
workspace/ROOT/javax/servlet/SingleThreadModel.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/UnavailableException.class
Normal file
BIN
workspace/ROOT/javax/servlet/UnavailableException.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/http/Cookie.class
Normal file
BIN
workspace/ROOT/javax/servlet/http/Cookie.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/http/HttpServlet.class
Normal file
BIN
workspace/ROOT/javax/servlet/http/HttpServlet.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/http/HttpServletRequest.class
Normal file
BIN
workspace/ROOT/javax/servlet/http/HttpServletRequest.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/http/HttpServletResponse.class
Normal file
BIN
workspace/ROOT/javax/servlet/http/HttpServletResponse.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/http/HttpSession.class
Normal file
BIN
workspace/ROOT/javax/servlet/http/HttpSession.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/http/HttpSessionBindingEvent.class
Normal file
BIN
workspace/ROOT/javax/servlet/http/HttpSessionBindingEvent.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/http/HttpSessionContext.class
Normal file
BIN
workspace/ROOT/javax/servlet/http/HttpSessionContext.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/http/HttpSessionEvent.class
Normal file
BIN
workspace/ROOT/javax/servlet/http/HttpSessionEvent.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/http/HttpSessionListener.class
Normal file
BIN
workspace/ROOT/javax/servlet/http/HttpSessionListener.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/http/HttpUtils.class
Normal file
BIN
workspace/ROOT/javax/servlet/http/HttpUtils.class
Normal file
Binary file not shown.
28
workspace/ROOT/javax/servlet/http/LocalStrings.properties
Normal file
28
workspace/ROOT/javax/servlet/http/LocalStrings.properties
Normal file
@ -0,0 +1,28 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Default localized string information
|
||||
# Localized for Locale en_US
|
||||
|
||||
err.cookie_name_is_token=Cookie name \"{0}\" is a reserved token
|
||||
err.io.negativelength=Negative Length given in write method
|
||||
err.io.short_read=Short Read
|
||||
|
||||
http.method_not_implemented=Method {0} is not defined in RFC 2068 and is not supported by the Servlet API
|
||||
|
||||
http.method_get_not_supported=HTTP method GET is not supported by this URL
|
||||
http.method_post_not_supported=HTTP method POST is not supported by this URL
|
||||
http.method_put_not_supported=HTTP method PUT is not supported by this URL
|
||||
http.method_delete_not_supported=Http method DELETE is not supported by this URL
|
BIN
workspace/ROOT/javax/servlet/http/NoBodyOutputStream.class
Normal file
BIN
workspace/ROOT/javax/servlet/http/NoBodyOutputStream.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/http/NoBodyResponse.class
Normal file
BIN
workspace/ROOT/javax/servlet/http/NoBodyResponse.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/jsp/ErrorData.class
Normal file
BIN
workspace/ROOT/javax/servlet/jsp/ErrorData.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/jsp/HttpJspPage.class
Normal file
BIN
workspace/ROOT/javax/servlet/jsp/HttpJspPage.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/jsp/JspApplicationContext.class
Normal file
BIN
workspace/ROOT/javax/servlet/jsp/JspApplicationContext.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/jsp/JspContext.class
Normal file
BIN
workspace/ROOT/javax/servlet/jsp/JspContext.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/jsp/JspEngineInfo.class
Normal file
BIN
workspace/ROOT/javax/servlet/jsp/JspEngineInfo.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/jsp/JspException.class
Normal file
BIN
workspace/ROOT/javax/servlet/jsp/JspException.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/jsp/JspFactory.class
Normal file
BIN
workspace/ROOT/javax/servlet/jsp/JspFactory.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/jsp/JspPage.class
Normal file
BIN
workspace/ROOT/javax/servlet/jsp/JspPage.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/jsp/JspTagException.class
Normal file
BIN
workspace/ROOT/javax/servlet/jsp/JspTagException.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/jsp/JspWriter.class
Normal file
BIN
workspace/ROOT/javax/servlet/jsp/JspWriter.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/jsp/PageContext.class
Normal file
BIN
workspace/ROOT/javax/servlet/jsp/PageContext.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/jsp/SkipPageException.class
Normal file
BIN
workspace/ROOT/javax/servlet/jsp/SkipPageException.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/jsp/el/ELException.class
Normal file
BIN
workspace/ROOT/javax/servlet/jsp/el/ELException.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/jsp/el/ELParseException.class
Normal file
BIN
workspace/ROOT/javax/servlet/jsp/el/ELParseException.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/jsp/el/Expression.class
Normal file
BIN
workspace/ROOT/javax/servlet/jsp/el/Expression.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/jsp/el/ExpressionEvaluator.class
Normal file
BIN
workspace/ROOT/javax/servlet/jsp/el/ExpressionEvaluator.class
Normal file
Binary file not shown.
BIN
workspace/ROOT/javax/servlet/jsp/el/FunctionMapper.class
Normal file
BIN
workspace/ROOT/javax/servlet/jsp/el/FunctionMapper.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user