Bonjour,
je réalise une gestion de contacts en JSP avec struts et j'ai un petit soucis avec mes beans. Voici ma page:
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
<%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic" %>
<%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean" %>
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html" %>
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Contact Book - Edit a contact</title>
<link rel="stylesheet" type="text/css" href="style/style.css" />
</head>
<body>
<h1>EDIT A CONTACT</h3><br />
<logic:notEmpty name="contact" scope="request">
<form action="updateContact2.do" method="post">
<input type="hidden" name="numero" value="<bean:write name='contact' property='id'/>"/>
 
<div>Last name: </div>
<div style="top:-15px;left:100px;position:relative;">
	<b><bean:write name="contact" property="lastName" /></b>
</div>	
<div style="top:-30px;left:350px;position:relative;">
	<input type="text" name="lastname" maxlength="30" value="<bean:write name='contact' property='firstName'/>"/>
</div>
 
<div>First name: </div>
<div style="top:-15px;left:100px;position:relative;">
	<b><bean:write name="contact" property="firstName"/></b>
</div>	
<div style="top:-30px;left:350px;position:relative;">
	<input type="text" name="lastname" maxlength="30" value="<bean:write name='contact' property='lastName'/>"/>
</div>
 
<div>Phone: </div>
<div style="top:-15px;left:100px;position:relative;">
	<b><bean:write name="contact" property="phone" /></b>
</div>	
<div style="top:-30px;left:350px;position:relative;">
	</div>
<input type="submit" value="Valider" />
</logic:notEmpty>
<br/><br/><br/>
<a href="welcome.do">Back to menu</a>
</body>
</html>
Tout marche sauf lors de la récupération de l'id(
Code : Sélectionner tout - Visualiser dans une fenêtre à part
<input type="hidden" name="numero" value="<bean:write name='contact' property='id'/>"/>
Savez d'ou ça peut venir? Mon bean recupere dans un objet contact qui contient bien la propriété contact donc j'avoue ne pas comprendre


merci d'avance