Bonjour

J'essaye de faire tourner mon premier javabean sous Tomcat, mais j'ai comme erreur ceci :

exception
javax.servlet.ServletException: Beanun (wrong name: beanun/Beanun)

cause mère
java.lang.NoClassDefFoundError: Beanun (wrong name: beanun/Beanun)


Voici la configuration des répertoires
...Tomcat4.1/webapps/test
-------------------------------/jsp
-------------------------------/servlets
-------------------------------/WEB-INF
------------------------------------------/classes
------------------------------------------/jsp

voici mes pages de codes

Beanun.jsp : plassé dans le repertoire 'test'
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
 
<jsp:useBean id="Beanun" scope="request" class="Beanun"/>
<%@ page contentType="text/html; charset=iso-8859-1" language="java"%>
<html>
<head>
<title>Mon premier bean</title>
</head>
<body BGCOLOR="#FFFFFF">
<p>Ces informations viennent du bean 'Beanun'</p>
 
<ul>
<li> Le nom de ce bean est : <jsp:getProperty name="Beanun" property="nom"/></li>
<li>Le prénom de ce bean est :<jsp:getProperty name="Beanun" property="prenom"/></li>
<li>Il est : <jsp:getProperty name="Beanun" property="aujourdhui"/></li>
</ul>
<table border="0">
		<tr>
			<td BBGCOLOR ="<jsp:getProperty name="premierbean" property="color"/>">
				Les informations provenant d'un bean peuvent être utilisées n'importe où dans la page.
			</td>
		</tr>
</table>
</body>
</html>
Beanun.class plassé dans WEB-INF\classes

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
 
import java.text.*;
import java.util.*;
 
public class Beanun implements java.io.Serializable {
	public String getNom(){
		 return "Dupond";
	}
	public String getPrenom(){
		return "Alain";
	}
 
	public String getColor(){
		return "#AA55FF";
	}
 
	public String getAujourdhui(){
		SimpleDateFormat auj = new SimpleDateFormat("hh:mm 'and'secondes'");
		return auj.format(new Date());
	}
}
Suis-je obligé de passé par un package ?
Ai je placé mes fichiers dans les bons répertoires ?

Merci pour vos réponses

Patrice