Une erreur s'est produite à la ligne: 10 dans le fichier jsp: /jsp/testjsp/premier.jsp
MyBean cannot be resolved to a type
code du jsp
code du bean deployée sous tomcat version .6.0
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 page import="java.util.ArrayList"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> <jsp:useBean id="myBean" class="MyBean" scope="session" /> </head> <body> <h2>Les erreurs suivantes se sont produites</h2> <ul> </ul> </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 public class MyBean { // Initialize with random values int prop1 = (int)(Integer.MAX_VALUE*Math.random()); String prop2 = ""+Math.random(); public int getProp1() { return prop1; } public void setProp1(int prop1) { this.prop1 = prop1; } public String getProp2() { return prop2; } public void setProp2(String prop2) { this.prop2 = prop2; } }
Partager