IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Servlets/JSP Java Discussion :

Affichage erroné en JSP


Sujet :

Servlets/JSP Java

  1. #1
    Membre régulier
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2009
    Messages
    119
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : Canada

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2009
    Messages : 119
    Points : 114
    Points
    114
    Par défaut Affichage erroné en JSP
    Bjr,

    mon environnement de développement web est le wamp (windows 7, apache 2.4.2, mysql 5.5.24, php 5.4.3).

    mon wampserver est online (démarré).


    j'ai ma page jsp validerCommande.jsp contenant
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    <html>
    <body>
    Vous avez soumis les donn&eacute;es suivantes:
    <table border="1">
    <th> champ </th> <th> valeur </th>
    <tr>
    <td> Qte </td> <td> <%= out.println("Qte : " + request.getParameter("Qte"); %></td>
    <tr>
    <tr>
    <td> PrixIngredients </td> <td> <%= out.println("PrixIngredients : " + request.getParameter("PrixIngredients"); %></td>
    <tr>
    <td> PrixHT  </td> <td> <%= out.println("PrixHT : " + request.getParameter("PrixHT"); %></td>
    <tr>
    <td> PrixTTC  </td> <td> <%= out.println("PrixTTC : " + request.getParameter("PrixTTC"); %></td>
    </table>
    </body>
    </html>
    et mon formulaire
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    <form name="formPizza" method="post" action="validerCommande.jsp">
     
    							<table>
    								<!--ligne 1 -->
    								<tr>
    									<td><label for="idSelectChoix">Choix :</label></td>
     
    									<td>
    									<select onchange="affichImgPizza()" id="idSelectChoix">
    										<option value="napolitana">Napolitana</option>
    										<option value="troisfromages">Trois fromages</option>
    										<option value="quebecoise">Qu&eacute;becoise</option>
    										<option value="vegetarienne">V&eacute;g&eacute;tarienne</option>
    									</select></td>
    									<td rowspan="3"><img name="imgPizza" border="1" src="./img/napolitana.jpeg" height="200" width="400"/></td>
    								</tr>
     
    								<!--ligne 2 -->
    								<tr>
    									<td><label for="idQte">Quantit&eacute; :</label></td>
    									<td>
    									<input type="text" name="Qte" id="idQte" maxlength="3" onchange="affichImgPizza()"/>
    									</td>
    								</tr>
     
    								<!--ligne 3 -->
    								<tr>
    									<td colspan="2">
    									<fieldset>
    										<legend>
    											Autres choix ingr&eacute;dients / extras
    										</legend>
    										<label for="idCbFromage">Fromage</label>
    										<input type="checkbox" name="cbIngredients" value="IngredFromage" id="idCbFromage" onclick="affichPrixIngredients(this)">
     
    										<label for="idCbThon">Thon</label>
    										<input type="checkbox" name="cbIngredients" value="IngredThon" id="idCbThon" onclick="affichPrixIngredients(this)">
     
    										<label for="idCbFrites">Frites</label>
    										<input type="checkbox" name="cbIngredients" value="IngredFrites" id="idCbFrites" onclick="affichPrixIngredients(this)">
     
    										<label for="idCbChampignon">Champignon</label>
    										<input type="checkbox" name="cbIngredients" value="IngredChampignon" id="idCbChampignon" onclick="affichPrixIngredients(this)">
    									</td>
    									</fieldset>
    								</tr>
     
    								<!--ligne 4 -->
    								<tr>
    									<td><label for="idPrixTotalIngredients">Prix Ingr&eacute;dients :</label></td>
    									<td>
    									<input type="text" name="PrixIngredients" id="idPrixTotalIngredients" readonly align="right"/>
    									</td>
    								</tr>
     
    								<!--ligne 5 -->
    								<tr>
    									<td><label for="idPrixHT">Prix total av. taxes:</label></td>
    									<td>
    									<input type="text" name="PrixHT" id="idPrixHT" readonly align="right"/>
    									</td>
    								</tr>
     
    								<!--ligne 6 -->
    								<tr>
    									<td><label for="idPrixTTC">Prix Total taxes inc.:</label></td>
    									<td>
    									<input type="text" name="PrixTTC" id="idPrixTTC" readonly align="right"/>
    									</td>
    								</tr>
     
    								<tr>
    									<td>
    									<br/>
    									<br/>
    									<br/>
    									</td>
    								</tr>
     
    								<!--ligne 5 -->
    								<tr align="center">
    									<td colspan="5">
    									<input type="submit" value="Valider"/>
    									<input type="reset" value="Effacer"/>
    									</td>
    								</tr>
     
    							</table>
     
    						</form>

    mon probleme est quand je valide mon formulaire, tout le code jsp qui sera affiché dans le tableau, cad avec les caractères <, >, % et meme out.println... !

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    Vous avez soumis les données suivantes: 
    champ 	                  valeur 
     Qte 	                  <%= out.println("Qte : " + request.getParameter("Qte"); %>
     PrixIngredients 	       <%= out.println("PrixIngredients : " + request.getParameter("PrixIngredients"); %>
     PrixHT 	                  <%= out.println("PrixHT : " + request.getParameter("PrixHT"); %>
     PrixTTC 	       <%= out.println("PrixTTC : " + request.getParam

    Cordialement

  2. #2
    Membre habitué
    Homme Profil pro
    Developpeur web/Java
    Inscrit en
    Février 2008
    Messages
    98
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 36
    Localisation : France, Seine Maritime (Haute Normandie)

    Informations professionnelles :
    Activité : Developpeur web/Java
    Secteur : Industrie Pharmaceutique

    Informations forums :
    Inscription : Février 2008
    Messages : 98
    Points : 178
    Points
    178
    Par défaut
    Bonjour,

    Il me semble que WampServer ne permette pas d'exécuter des servlets/jsp et qu'il est uniquement dédié à PHP.
    Pour ça il faut que tu passes par un conteneur de servlet comme Tomcat.

  3. #3
    Membre régulier
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2009
    Messages
    119
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : Canada

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2009
    Messages : 119
    Points : 114
    Points
    114
    Par défaut
    Bonjour,

    mais wampserver contient apache cad tomcat, non?

    Cordialement

  4. #4
    Membre actif Avatar de hbennou
    Homme Profil pro
    Développeur Java
    Inscrit en
    Mai 2008
    Messages
    162
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mai 2008
    Messages : 162
    Points : 205
    Points
    205
    Par défaut
    Bonjour,

    mais wampserver contient apache cad tomcat, non?
    Ce que t'as c'est Apache HTTP Server ce n'est pas Apache Tomcat. Il te faut un conteneur servlet http://fr.wikipedia.org/wiki/Conteneur_de_servlets

  5. #5
    Membre régulier
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2009
    Messages
    119
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : Canada

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2009
    Messages : 119
    Points : 114
    Points
    114
    Par défaut
    Bjr,

    merci pour vos reponses tt le monde, je verrais ce ke je pourrais faire.

    Cordialement

  6. #6
    Membre régulier
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2009
    Messages
    119
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : Canada

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2009
    Messages : 119
    Points : 114
    Points
    114
    Par défaut
    Bjr,

    c bon j'ai lu sur les conteneurs mais j'ai commencé mon application et j'ai pas trouvé sous quel répertoire je mets mes pages html ainsi que jsp ou servlets.

    de l'aide svp?

    Cordialement

  7. #7
    Membre régulier
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2009
    Messages
    119
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : Canada

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2009
    Messages : 119
    Points : 114
    Points
    114
    Par défaut
    Bjr,

    j'ai resolu le prob en mettant le repertoire de mon projet sous l'arborescence adequate pour les applications tournants sous tomcat.

    Cordialement.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 3
    Dernier message: 22/08/2007, 16h53
  2. Affichage dans une jsp
    Par techtonyc dans le forum Servlets/JSP
    Réponses: 5
    Dernier message: 07/03/2007, 11h30
  3. [Spring MVC] Probleme d'affichage de pages jsp
    Par nouida dans le forum Spring Web
    Réponses: 1
    Dernier message: 04/02/2007, 23h45
  4. Resultset source a.priori d'erreur pour l'affichage d'une jsp
    Par jalaquesnacc dans le forum Dreamweaver
    Réponses: 1
    Dernier message: 20/10/2006, 14h18
  5. [Struts] Probleme d'affichage d'un JSP et surtout un fom
    Par adilou1981 dans le forum Struts 1
    Réponses: 7
    Dernier message: 21/04/2006, 12h20

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo