Bonjour,

J'ai développé un application de gestion des horaires et on me demande d'ajouter un nouveau mode de recherche : recherche par date. J'ai utilisé la balise struts <sx:datetimepicker. Sur la page jsp
compteurMoisPersonne.jsp, j'ai mis une alerte en javascript qui m'indique la valeur de ma date

Code : Sélectionner tout - Visualiser dans une fenêtre à part
Fri Aug 14 2015 00:00:00 GMT+0200
.

Or dans ma classe action, mon attribut date est vide. Auriez vous des suggestions

Voici un bout de code de ma classe action
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
import java.util.Date;
 
private Date dateDebutModif;
private Date dateFinModif;
 
public Date getDateDebutModif() {
	return dateDebutModif;
}
 
public void setDateDebutModif(Date dateDebutModif) {
	this.dateDebutModif = dateDebutModif;
}
 
public Date getDateFinModif() {
	return dateFinModif;
}
 
public void setDateFinModif(Date dateFinModif) {
	this.dateFinModif = dateFinModif;
}
Voici le code de mon formulaire:

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
46
47
48
49
50
51
52
53
54
 
<tr>
 
<s:form name="searchPersonne" action="compteurManagement_searchPersonneByMoisAndAnnee">
	<tr style="font-weight: bold">
 
		<td>
			Nom de la personne :
		</td>
		<td>
		<s:select headerKey="-1" headerValue="Personne ?" id="personneSelected" name="personneSelected" list="listPersonneDto" listKey="idPersonne" listValue="nomGlobal"/>
		</td>
 
		<td>
			Mois :
		</td>
 
		<td>
			<s:select headerKey="0" headerValue="Mois ?" id="moisSelected" name="moisSelected" list="listMounts" listKey="idMois" listValue="libelleMois"/>								
 
		</td>
		<td>
			Année :
		</td>
		<td>
			<s:select headerKey="-1" headerValue="Annee ?" id="yearSelected" name="yearSelected" list="years" />									
		</td>
 
		<td>
			Mode
		</td>
 
		<td style="text-align: center;">
			Semaine du<sx:datetimepicker name="dateDebutModif" id="dateDebutModif" value="" displayFormat="dd-MM-yyyy"/> 
			au <sx:datetimepicker name="dateFinModif" id="dateFinModif" value="" displayFormat="dd-MM-yyyy" />
 
		</td>
		<td>
		<SELECT name="globalSearch" id="globalSearch">
				<OPTION VALUE="1"> detaille </OPTION>
				<OPTION VALUE="2"> global </OPTION>
 
		</SELECT>
		</td>
 
	</tr>
 
	<tr style="font-weight: bold">
		<td> 
			<input type="button" value="rechercher" onClick="return loadCompteurByPersonner(this.form);"> 
		</td>	
	</tr>
</s:form>
</tr>
sachant qu'en haut de ce fichier il y a

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
 
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix ="s" uri="/struts-tags" %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
Merci beaucoup de votre aide