Bonsoir tout le monde
j'ai pris cet exemple de ce forum
ma classe java
ma page JSP
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 import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Vector; /*import org.apache.xmlrpc.client.XmlRpcClient; import org.apache.xmlrpc.XmlRpcException; import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;*/ import org.xml.sax.helpers.DefaultHandler; import java.lang.Object; import javax.naming.*; public class TestConnexion { // Global variable declaration String testJira = null; String testBd = null; public TestConnexion () { testJira = "JJ"; testBd="GG"; } public String testJIRA() { return testJira ; } }
j'ai télécharger aussi les jar:
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 <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Test server : JIRA et BD</title> </head> <body> On voit la page <%-- Déclaration d une variable globale à la classe --%> <%! String fct = null ; %> <% TestConnexion testC = new TestConnexion(); %> <%= testC.testJIRA()%> </body> </html>
jstl-api-1.2 et jstl-impl-1.2 je les ai mis dans
WebContent\WEB-INF\lib
mais il m'affiche l'erreur suivante
où est le problème
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 Une erreur s'est produite à la ligne: 15 dans le fichier jsp: /SS.jsp TestConnexion cannot be resolved to a type 12: <%-- Déclaration d une variable globale à la classe --%> 13: <%! String fct = null ; %> 14: 15: <% TestConnexion testC = new TestConnexion(); %> 16: 17: <%= testC.testJIRA()%> 18: </body>
merci
Partager