Bonsoir, je débute en JEE et j'ai un problème de compilation avec la page index.jsp. Le code de la page est très simple il s'agit de 2 directives include pour l'entête et le pied de page.
Je vous met la servlet créée après compilation.
Je rajoute le fichier web.xml.
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289 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; static { _jspx_dependants = new java.util.ArrayList(3); _jspx_dependants.add("/vues/outils/entete.jspf"); _jspx_dependants.add("/vues/outils/navigation.jspf"); _jspx_dependants.add("/vues/outils/piedpage.jspf"); } 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"); 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("<html>\n"); out.write(" <head>\n"); out.write(" <title>BetaBoutique</title>\n"); out.write(" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n"); out.write(" <meta name=\"description\" content=\"BetaBoutique\">\n"); out.write(" <!-- Feuilles de styles -->\n"); out.write(" <link rel=\"stylesheet\" type=\"text/css\" href=\"css/styles.css\" title=\"default\"/>\n"); out.write(" <link rel=\"stylesheet\" type=\"text/css\" href=\"css/styles_panier.css\" title=\"default\"/>\n"); out.write(" <!-- javascript -->\n"); out.write(" <link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"javascript/jtip/jtip.css\"/>\n"); out.write(" <script type=\"text/javascript\" src=\"javascrip/jquery/jquery.js\"></script>\n"); out.write(" <script type=\"text/javascript\" src=\"javascript/jtip/jtip.js\"></script>\n"); out.write(" </head>\n"); out.write(" <body>\n"); out.write("\n"); out.write(" <div id=\"global\">\n"); out.write(" <div id=\"entete\">\n"); out.write(" <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" height=\"100%\">\n"); out.write(" <tr>\n"); out.write(" <td align=\"left\" valign=\"top\">\n"); out.write(" <a href=\"/\"><img src=\"img/application/bandeau_haut_gauche.jpg\" border=\"0\"/></a>\n"); out.write(" </td>\n"); out.write("\n"); out.write(" <td align=\"left\" valign=\"top\">\n"); out.write(" <img src=\"img/application/bandeau_haut_centre.jpg\"/>\n"); out.write(" </td>\n"); out.write("\n"); out.write(" <td align=\"left\" valign=\"top\" background=\"img/application/bandeau_haut_droite.jpg\" width=\"222\">\n"); out.write(" <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" height=\"100%\">\n"); out.write(" <tr><td height=\"50\">\n"); out.write(" <form id=\"formulairerecherche\" name=\"formulairerecherche\" action=\"\" methode=\"post\">\n"); out.write(" <div class=\"titregris\">RECHERCHE</div>\n"); out.write(" <input type=\"text\" id=\"recherche\" name=\"recherche\" value=\"\"/>\n"); out.write(" <input type=\"image\" src=\"img/application/ok.gif\" align=\"absmiddle\"/>\n"); out.write(" </form>\n"); out.write(" </td></tr>\n"); out.write(" <tr><td align=\"center\">\n"); out.write(" <span class=\"liengris\"><a href=\"\">MON COMPTE</a></span>\n"); out.write(" \n"); out.write(" <span class=\"liengris\"><a href=\"\">MON PANIER></a></span>\n"); out.write(" </td></tr>\n"); out.write(" <tr><td align=\"right\" height=\"20\">\n"); out.write(" <span class=\"liengris\"><a href=\"\">DECONNEXION</a> </span></br></br>\n"); out.write(" </td></tr>\n"); out.write(" </table>\n"); out.write(" </td>\n"); out.write(" </tr>\n"); out.write(" </table>\n"); out.write(" </div>\n"); out.write("\n"); out.write(" <div id=\"contenu\">\n"); out.write(" <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\n"); out.write(" <tr>\n"); out.write(" <td valign=\"top\" width=\"200\">\n"); out.write(" <!-- Colonne de gauche -->\n"); out.write(" "); out.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" name=\"menugauche\" id=\"menugauche\" style=\"background: url('img/application/fondmenu.gif') repeat-x;\" height=\"500\">\n"); out.write(" <tr>\n"); out.write(" <td width=\"100%\" valign=\"top\">\n"); out.write(" <ul class=\"menucategorie\">\n"); out.write(" <li><a href=\"\"><img src=\"img/application/fleche.gif\" border=\"0\" align=\"absmiddle\"/> Policier et Thriller</a></li>\n"); out.write(" <li><a href=\"\"><img src=\"img/application/fleche.gif\" border=\"0\" align=\"absmiddle\"/> Comédie</a></li>\n"); out.write(" <li><a href=\"\"><img src=\"img/application/fleche.gif\" border=\"0\" align=\"absmiddle\"/> Documentaires</a></li>\n"); out.write(" <li><a href=\"\"><img src=\"img/application/fleche.gif\" border=\"0\" align=\"absmiddle\"/> Jeunesse et Famille</a></li>\n"); out.write(" <li><a href=\"\"><img src=\"img/application/fleche.gif\" border=\"0\" align=\"absmiddle\"/> Série TV</a></li>\n"); out.write(" <li><a href=\"\"><img src=\"img/application/fleche.gif\" border=\"0\" align=\"absmiddle\"/> Spectacle et humour</a></li>\n"); out.write(" <li><a href=\"\"><img src=\"img/application/fleche.gif\" border=\"0\" align=\"absmiddle\"/> Fantastique</a></li>\n"); out.write(" </ul>\n"); out.write(" </td>\n"); out.write(" </tr>\n"); out.write(" <tr>\n"); out.write(" <td valign=\"top\" align=\"center\" bgcolor=\"#ffce00\" height=\"50\" class=\"textpanier\">\n"); out.write(" <a href=\"panierresume.php?width=400\" class=\"jTip\" id=\"aidedynamique\" name=\"Panier Dynamique\" onclick=\"javascript:window.location='';\">\n"); out.write(" <img src=\"img/application/panier.gif\" border=\"0\" style=\"padding-top:10px;\"/><span>Panier</span>\n"); out.write(" </a>\n"); out.write(" </br>\n"); out.write(" </td>\n"); out.write(" </tr>\n"); out.write(" <tr>\n"); out.write(" <td align=\"center\">\n"); out.write(" <img src=\"img/application/cartes.gif\" border=\"0\" style=\"margin-bottom:5px;\"/></br>\n"); out.write(" </td>\n"); out.write(" </tr>\n"); out.write("</table>"); out.write("\n"); out.write(" </td>\n"); out.write("\n"); out.write(" <!-- Colonne centre -->\n"); out.write(" <td valign=\"top\" width=\"100%\" style=\"padding-left:5px\">\n"); out.write(" <ul id=\"menuhaut\">\n"); out.write(" <li><a href=\"/\" title=\"Acceuil\">Acceuil</a></li>\n"); out.write(" <li><a href=\"\" title=\"Promotion\">Promotion</a></li>\n"); out.write(" <li><a href=\"\" title=\"Nouveaués\">Nouveautés</a></li>\n"); out.write(" <li><a href=\"\" title=\"CGV\">Conditions de vente</a></li>\n"); out.write(" <li><a href=\"\" title=\"Panier\">Commander</a></li>\n"); out.write(" </ul></br>\n"); out.write("\n"); out.write('\n'); out.write('\n'); out.write('\n'); out.write("<html>\n"); out.write(" <head>\n"); out.write(" <title>BetaBoutique</title>\n"); out.write(" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n"); out.write(" <meta name=\"description\" content=\"BetaBoutique\">\n"); out.write(" <!-- Feuilles de styles -->\n"); out.write(" <link rel=\"stylesheet\" type=\"text/css\" href=\"css/styles.css\" title=\"default\"/>\n"); out.write(" <link rel=\"stylesheet\" type=\"text/css\" href=\"css/styles_panier.css\" title=\"default\"/>\n"); out.write(" <!-- javascript -->\n"); out.write(" <link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"javascript/jtip/jtip.css\"/>\n"); out.write(" <script type=\"text/javascript\" src=\"javascrip/jquery/jquery.js\"></script>\n"); out.write(" <script type=\"text/javascript\" src=\"javascript/jtip/jtip.js\"></script>\n"); out.write(" </head>\n"); out.write(" <body>\n"); out.write("\n"); out.write(" <div id=\"global\">\n"); out.write(" <div id=\"entete\">\n"); out.write(" <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" height=\"100%\">\n"); out.write(" <tr>\n"); out.write(" <td align=\"left\" valign=\"top\">\n"); out.write(" <a href=\"/\"><img src=\"img/application/bandeau_haut_gauche.jpg\" border=\"0\"/></a>\n"); out.write(" </td>\n"); out.write("\n"); out.write(" <td align=\"left\" valign=\"top\">\n"); out.write(" <img src=\"img/application/bandeau_haut_centre.jpg\"/>\n"); out.write(" </td>\n"); out.write("\n"); out.write(" <td align=\"left\" valign=\"top\" background=\"img/application/bandeau_haut_droite.jpg\" width=\"222\">\n"); out.write(" <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" height=\"100%\">\n"); out.write(" <tr><td height=\"50\">\n"); out.write(" <form id=\"formulairerecherche\" name=\"formulairerecherche\" action=\"\" methode=\"post\">\n"); out.write(" <div class=\"titregris\">RECHERCHE</div>\n"); out.write(" <input type=\"text\" id=\"recherche\" name=\"recherche\" value=\"\"/>\n"); out.write(" <input type=\"image\" src=\"img/application/ok.gif\" align=\"absmiddle\"/>\n"); out.write(" </form>\n"); out.write(" </td></tr>\n"); out.write(" <tr><td align=\"center\">\n"); out.write(" <span class=\"liengris\"><a href=\"\">MON COMPTE</a></span>\n"); out.write(" \n"); out.write(" <span class=\"liengris\"><a href=\"\">MON PANIER></a></span>\n"); out.write(" </td></tr>\n"); out.write(" <tr><td align=\"right\" height=\"20\">\n"); out.write(" <span class=\"liengris\"><a href=\"\">DECONNEXION</a> </span></br></br>\n"); out.write(" </td></tr>\n"); out.write(" </table>\n"); out.write(" </td>\n"); out.write(" </tr>\n"); out.write(" </table>\n"); out.write(" </div>\n"); out.write("\n"); out.write(" <div id=\"contenu\">\n"); out.write(" <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\n"); out.write(" <tr>\n"); out.write(" <td valign=\"top\" width=\"200\">\n"); out.write(" <!-- Colonne de gauche -->\n"); out.write(" "); out.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" name=\"menugauche\" id=\"menugauche\" style=\"background: url('img/application/fondmenu.gif') repeat-x;\" height=\"500\">\n"); out.write(" <tr>\n"); out.write(" <td width=\"100%\" valign=\"top\">\n"); out.write(" <ul class=\"menucategorie\">\n"); out.write(" <li><a href=\"\"><img src=\"img/application/fleche.gif\" border=\"0\" align=\"absmiddle\"/> Policier et Thriller</a></li>\n"); out.write(" <li><a href=\"\"><img src=\"img/application/fleche.gif\" border=\"0\" align=\"absmiddle\"/> Comédie</a></li>\n"); out.write(" <li><a href=\"\"><img src=\"img/application/fleche.gif\" border=\"0\" align=\"absmiddle\"/> Documentaires</a></li>\n"); out.write(" <li><a href=\"\"><img src=\"img/application/fleche.gif\" border=\"0\" align=\"absmiddle\"/> Jeunesse et Famille</a></li>\n"); out.write(" <li><a href=\"\"><img src=\"img/application/fleche.gif\" border=\"0\" align=\"absmiddle\"/> Série TV</a></li>\n"); out.write(" <li><a href=\"\"><img src=\"img/application/fleche.gif\" border=\"0\" align=\"absmiddle\"/> Spectacle et humour</a></li>\n"); out.write(" <li><a href=\"\"><img src=\"img/application/fleche.gif\" border=\"0\" align=\"absmiddle\"/> Fantastique</a></li>\n"); out.write(" </ul>\n"); out.write(" </td>\n"); out.write(" </tr>\n"); out.write(" <tr>\n"); out.write(" <td valign=\"top\" align=\"center\" bgcolor=\"#ffce00\" height=\"50\" class=\"textpanier\">\n"); out.write(" <a href=\"panierresume.php?width=400\" class=\"jTip\" id=\"aidedynamique\" name=\"Panier Dynamique\" onclick=\"javascript:window.location='';\">\n"); out.write(" <img src=\"img/application/panier.gif\" border=\"0\" style=\"padding-top:10px;\"/><span>Panier</span>\n"); out.write(" </a>\n"); out.write(" </br>\n"); out.write(" </td>\n"); out.write(" </tr>\n"); out.write(" <tr>\n"); out.write(" <td align=\"center\">\n"); out.write(" <img src=\"img/application/cartes.gif\" border=\"0\" style=\"margin-bottom:5px;\"/></br>\n"); out.write(" </td>\n"); out.write(" </tr>\n"); out.write("</table>"); out.write("\n"); out.write(" </td>\n"); out.write("\n"); out.write(" <!-- Colonne centre -->\n"); out.write(" <td valign=\"top\" width=\"100%\" style=\"padding-left:5px\">\n"); out.write(" <ul id=\"menuhaut\">\n"); out.write(" <li><a href=\"/\" title=\"Acceuil\">Acceuil</a></li>\n"); out.write(" <li><a href=\"\" title=\"Promotion\">Promotion</a></li>\n"); out.write(" <li><a href=\"\" title=\"Nouveaués\">Nouveautés</a></li>\n"); out.write(" <li><a href=\"\" title=\"CGV\">Conditions de vente</a></li>\n"); out.write(" <li><a href=\"\" title=\"Panier\">Commander</a></li>\n"); out.write(" </ul></br>\n"); out.write("\n"); out.write('\n'); out.write("</td>\n"); out.write("</tr>\n"); out.write("</table>\n"); out.write("<div id=\"betaboutique\">\n"); out.write(" BetaBoutique est une boutique de et par la société BetaBoutique SARL au\n"); out.write(" Capital de 10 000 Euro numéro de siret 111 222 333 444 555\n"); out.write("</div>\n"); out.write("</div>\n"); out.write("</body>\n"); out.write("</html>\n"); out.write("</td>\n"); out.write("</tr>\n"); out.write("</table>\n"); out.write("<div id=\"betaboutique\">\n"); out.write(" BetaBoutique est une boutique de et par la société BetaBoutique SARL au\n"); out.write(" Capital de 10 000 Euro numéro de siret 111 222 333 444 555\n"); out.write("</div>\n"); out.write("</div>\n"); out.write("</body>\n"); out.write("</html>\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); } } }
Pour situer les choses, tout fonctionnait correctement jusqu'à ce que je met en place la librairie JSTL 1.1 . Une première fois avec le menu contextuel de Netbeans, puis manuelement avec les fichiers jstl.jar et standard.jar dans le dossier WEB-INF.
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 <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <error-page> <error-code>404</error-code> <location>/404.html</location> </error-page> <jsp-config> <jsp-property-group> <url-pattern>*.jsp</url-pattern> <include-prelude>/vues/outils/entete.jspf</include-prelude> <include-coda>/vues/outils/piedpage.jspf</include-coda> </jsp-property-group> </jsp-config> </web-app>
Voilà pour moi mon fichier web.xml est bon, du moins c'est celui que j'utilisais pendant que tout fonctionnait. Merci de votre aide.
Partager