salut.j'ai executé un code java et il a très bien fonctionné.mais dès que je l'ai intégré dans une page jsp,il m'affiche une erreur.
et voici l'erreur
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 <%-- Ceci est un commentaire JSP --%> <%@page contentType="text/html"%> <%@page errorPage="erreur.jsp"%> <%-- Importation d'un paquetage (package) --%> <%@page import="java.util.*"%> <%@page import="javax.swing.*"%> <%@page import="edu.stanford.smi.protege.model.*"%> <html> <head><title>Page JSP</title></head> <body> <%-- Déclaration d'une variable globale à la classe --%> <%! String projectFileName = "C:\\Program Files\\Protege_3.2\\examples\\profil1\\profil1.pprj"; %> <%! String instanceName = "profil1_Instance_10015"; %> <%-- Définition de code Java --%> <% Collection errors = new ArrayList(); Project project = new Project(projectFileName, errors); if (errors.isEmpty()) { // show an instance in a top level frame project.show(instanceName); // create a panel that contains and instance form and display it in my top level frame Instance instance = project.getKnowledgeBase().getInstance(instanceName); JComponent panel = (JComponent) project.createRuntimeClsWidget(instance); JFrame frame = new JFrame("My Application Frame"); frame.getContentPane().add(panel); frame.pack(); frame.show(); } %> <h1>Exemple de page JSP</h1> <%-- Impression de variables --%> </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 Une erreur s'est produite à la ligne: 18 dans le fichier jsp: /page1.jsp Project cannot be resolved to a type 15: <%-- Définition de code Java --%> 16: <% 17: Collection errors = new ArrayList(); 18: Project project = new Project(projectFileName, errors); 19: 20: if (errors.isEmpty()) { 21: // show an instance in a top level frame Une erreur s'est produite à la ligne: 18 dans le fichier jsp: /page1.jsp Project cannot be resolved to a type 15: <%-- Définition de code Java --%> 16: <% 17: Collection errors = new ArrayList(); 18: Project project = new Project(projectFileName, errors); 19: 20: if (errors.isEmpty()) { 21: // show an instance in a top level frame
pourriez vous m'indiquer ou est l'erreur.Merci.
Partager