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 contenantet 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 <html> <body> Vous avez soumis les donné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>
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ébecoise</option> <option value="vegetarienne">Végé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é :</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é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é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
Partager