pb dans l'utilisation d'une mapbacked
Bonjour à tous,
voila mon soucis, je génère une page jsp à l'aide d'un tag (en gras souligné dans le code suivant:
Code:
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
| <%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="http://gfiigs-tags" prefix="gfiigs" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<html:html locale="true">
<head>
<link href="css/jdonix.css" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE="JAVASCRIPT" SRC="js/functions.js"></SCRIPT>
<style type="text/css">
<!--
.Style1 {
font-size: 12px;
font-style: italic;
}
-->
</style>
<title><bean:message key="welcome.title"/></title>
</head>
<body>
<table width="99%" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" valign="top"><hr>
</tr>
<tr>
<td width="14%" valign="top"><img src="images/groupe.jpg" width="145" height="64">
</td>
<td width="86%" align="right" valign="Top" class="titre">
<bean:message key="jdonix.soustitleOp"/>
<img src="images/logo_bleu.gif" width="64" height="64">
</td>
<tr>
<td colspan="2" valign="top">
<hr>
<span class="etat">
<bean:message key="button.auth"/>
</span>
<hr>
</td>
</tr>
<tr>
<td colspan="2">
<%
if (request.getAttribute("error") != null){
String err = (String)request.getAttribute("error"); %>
<div align="center" class="Erreur"><bean:message key="<%=err%>"/></div>
<%}else if (request.getAttribute("success") != null){
String success = (String)request.getAttribute("success"); %>
<div align="center" class="Success"><bean:message key="<%=success%>"/></div>
<%}else if (request.getParameter("error") != null) {
String err = (String)request.getParameter("error"); %>
<div align="center" class="Erreur"><bean:message key="<%=err%>"/></div>
<%}%>
</td>
</tr>
<tr>
<td colspan="2">
<div align="center"">
</div>
</td>
</tr>
</table>
<html:form action="/ModifListeSaisies.do" >
<table border="1" >
<tr>
<td><bean:message key="lib.OF"/></td>
<td><bean:message key="lib.poste"/></td>
<td><bean:message key="lib.ope"/></td>
<td><bean:message key="lib.ArtLance"/></td>
<td><bean:message key="lib.debut"/></td>
<td><bean:message key="lib.QtPrev"/></td>
<td><bean:message key="lib.QtDecl"/></td>
<td><bean:message key="lib.SugRebut"/></td>
<td><bean:message key="lib.TypeTemps"/></td>
<td><bean:message key="lib.TempsTotal"/></td>
<td><bean:message key="lib.PointageFin"/></td>
<td><bean:message key="lib.SoldeOp"/></td>
</tr>
<gfiigs:TagAfficherListeSaisies/>
</table>
<html:submit>Valider modifications</html:submit>
</html:form>
</body>
</html:html> |
Une fois éxécuté, le tag me génère correctement ma jsp:
Code:
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
| </table>
<form name="ListeSaisies" method="post" action="/jdonixV3/ModifListeSaisies.do">
<table border="1" >
<tr>
<td>N°Of</td>
<td>Poste</td>
<td>Opération</td>
<td>Article</td>
<td>Début</td>
<td>Qt Prévue</td>
<td>Qt Déclarée</td>
<td>Suggestion rebut</td>
<td>Type de temps</td>
<td>Temps total</td>
<td>Pointage fin</td>
<td>Solde opération</td>
</tr>
<tr>
<td><input type="hidden" name="MapOF(0)" value="OF-PAR-0000032">OF-PAR-0000032 </td>
<td><input type="hidden" name="MapPoste(0)" value="CONDIT">CONDIT </td>
<td><input type="hidden" name="MapOpe(0)" value="10">
Conditionnement Camion</td>
<td><input type="hidden" name="MapArt(0)" value="CD200">
  </td>
<td><input type="hidden" name="MapDebut(0)" value="2007-03-29 15:54:00.0">2007-03-29 15:54:00.0 </td>
<td><input type="hidden" name="MapQtPrev(0)" value="200.000">200.000 </td>
<td><input type="text" name="MapQtDecl(0)" value="0" size=5></td>
<td><input type="text" name="MapQtRebut(0)" value="0" size=5></td>
<td><select id="MapTypeTemps(0)" name="MapTypeTemps(0)" styleClass="zonetexte"><OPTION VALUE='1' selected>Normal</OPTION>
<OPTION VALUE='2' >Masqué</OPTION>
</select>
</td>
<td><input type="text" name="MapTpsTotal(0)" value="0" size=5></td>
<td><input type="checkbox" name="MapPtgeFin(0)" value=" false"></td>
<td><input type="checkbox" name="MapSoldeOp(0)" value=" false"></td>
</tr>
<tr>
<td><input type="hidden" name="MapOF(1)" value="OF-PAR-0000032">OF-PAR-0000032 </td>
<td><input type="hidden" name="MapPoste(1)" value="ASSEM">ASSEM </td>
<td><input type="hidden" name="MapOpe(1)" value="5">
Assemblage composants</td>
<td><input type="hidden" name="MapArt(1)" value="CD200">
  </td>
<td><input type="hidden" name="MapDebut(1)" value="2007-03-29 15:57:00.0">2007-03-29 15:57:00.0 </td>
<td><input type="hidden" name="MapQtPrev(1)" value="200.000">200.000 </td>
<td><input type="text" name="MapQtDecl(1)" value="0" size=5></td>
<td><input type="text" name="MapQtRebut(1)" value="0" size=5></td>
<td><select id="MapTypeTemps(1)" name="MapTypeTemps(1)" styleClass="zonetexte"><OPTION VALUE='1' >Normal</OPTION>
<OPTION VALUE='2' selected>Masqué</OPTION>
</select>
</td>
<td><input type="text" name="MapTpsTotal(1)" value="0" size=5></td>
<td><input type="checkbox" name="MapPtgeFin(1)" value=" false"></td>
<td><input type="checkbox" name="MapSoldeOp(1)" value=" false"></td>
</tr>
<tr>
<td><input type="hidden" name="MapOF(2)" value="OF-PAR-0000033">OF-PAR-0000033 </td>
<td><input type="hidden" name="MapPoste(2)" value="ASSEM">ASSEM </td>
<td><input type="hidden" name="MapOpe(2)" value="5">
Assemblage composants</td>
<td><input type="hidden" name="MapArt(2)" value="CD200">
  </td>
<td><input type="hidden" name="MapDebut(2)" value="2007-03-29 19:01:00.0">2007-03-29 19:01:00.0 </td>
<td><input type="hidden" name="MapQtPrev(2)" value="200.000">200.000 </td>
<td><input type="text" name="MapQtDecl(2)" value="0" size=5></td>
<td><input type="text" name="MapQtRebut(2)" value="0" size=5></td>
<td><select id="MapTypeTemps(2)" name="MapTypeTemps(2)" styleClass="zonetexte"><OPTION VALUE='1' >Normal</OPTION>
<OPTION VALUE='2' selected>Masqué</OPTION>
</select>
</td>
<td><input type="text" name="MapTpsTotal(2)" value="0" size=5></td>
<td><input type="checkbox" name="MapPtgeFin(2)" value=" false"></td>
<td><input type="checkbox" name="MapSoldeOp(2)" value=" false"></td>
</tr>
<tr>
<td><input type="hidden" name="MapOF(3)" value="OF-PAR-0000033">OF-PAR-0000033 </td>
<td><input type="hidden" name="MapPoste(3)" value="CONDIT">CONDIT </td>
<td><input type="hidden" name="MapOpe(3)" value="10">
Conditionnement Camion</td>
<td><input type="hidden" name="MapArt(3)" value="CD200">
  </td>
<td><input type="hidden" name="MapDebut(3)" value="2007-03-29 19:14:00.0">2007-03-29 19:14:00.0 </td>
<td><input type="hidden" name="MapQtPrev(3)" value="200.000">200.000 </td>
<td><input type="text" name="MapQtDecl(3)" value="0" size=5></td>
<td><input type="text" name="MapQtRebut(3)" value="0" size=5></td>
<td><select id="MapTypeTemps(3)" name="MapTypeTemps(3)" styleClass="zonetexte"><OPTION VALUE='1' >Normal</OPTION>
<OPTION VALUE='2' selected>Masqué</OPTION>
</select>
</td>
<td><input type="text" name="MapTpsTotal(3)" value="0" size=5></td>
<td><input type="checkbox" name="MapPtgeFin(3)" value=" false"></td>
<td><input type="checkbox" name="MapSoldeOp(3)" value=" false"></td>
</tr>
<tr>
<td><input type="hidden" name="MapOF(4)" value="OF-PAR-0000034">OF-PAR-0000034 </td>
<td><input type="hidden" name="MapPoste(4)" value="ASSEM">ASSEM </td>
<td><input type="hidden" name="MapOpe(4)" value="5">
Assemblage composants</td>
<td><input type="hidden" name="MapArt(4)" value="CD200">
  </td>
<td><input type="hidden" name="MapDebut(4)" value="2007-03-30 10:57:00.0">2007-03-30 10:57:00.0 </td>
<td><input type="hidden" name="MapQtPrev(4)" value="200.000">200.000 </td>
<td><input type="text" name="MapQtDecl(4)" value="0" size=5></td>
<td><input type="text" name="MapQtRebut(4)" value="0" size=5></td>
<td><select id="MapTypeTemps(4)" name="MapTypeTemps(4)" styleClass="zonetexte"><OPTION VALUE='3' selected>MultiOF</OPTION>
</select>
</td>
<td><input type="text" name="MapTpsTotal(4)" value="0" size=5></td>
<td><input type="checkbox" name="MapPtgeFin(4)" value=" false"></td>
<td><input type="checkbox" name="MapSoldeOp(4)" value=" false"></td>
</tr>
<tr>
<td><input type="hidden" name="MapOF(5)" value="OF-PAR-0000034">OF-PAR-0000034 </td>
<td><input type="hidden" name="MapPoste(5)" value="CONDIT">CONDIT </td>
<td><input type="hidden" name="MapOpe(5)" value="10">
Conditionnement Camion</td>
<td><input type="hidden" name="MapArt(5)" value="CD200">
  </td>
<td><input type="hidden" name="MapDebut(5)" value="2007-03-30 10:58:00.0">2007-03-30 10:58:00.0 </td>
<td><input type="hidden" name="MapQtPrev(5)" value="200.000">200.000 </td>
<td><input type="text" name="MapQtDecl(5)" value="0" size=5></td>
<td><input type="text" name="MapQtRebut(5)" value="0" size=5></td>
<td><select id="MapTypeTemps(5)" name="MapTypeTemps(5)" styleClass="zonetexte"><OPTION VALUE='3' selected>MultiOF</OPTION>
</select>
</td>
<td><input type="text" name="MapTpsTotal(5)" value="0" size=5></td>
<td><input type="checkbox" name="MapPtgeFin(5)" value=" false"></td>
<td><input type="checkbox" name="MapSoldeOp(5)" value=" false"></td>
</tr>
<tr>
<td><input type="hidden" name="MapOF(6)" value="OF-PAR-0000034">OF-PAR-0000034 </td>
<td><input type="hidden" name="MapPoste(6)" value="ASSEM">ASSEM </td>
<td><input type="hidden" name="MapOpe(6)" value="5">
Assemblage composants</td>
<td><input type="hidden" name="MapArt(6)" value="CD200">
  </td>
<td><input type="hidden" name="MapDebut(6)" value="2007-03-30 10:59:00.0">2007-03-30 10:59:00.0 </td>
<td><input type="hidden" name="MapQtPrev(6)" value="200.000">200.000 </td>
<td><input type="text" name="MapQtDecl(6)" value="0" size=5></td>
<td><input type="text" name="MapQtRebut(6)" value="0" size=5></td>
<td><select id="MapTypeTemps(6)" name="MapTypeTemps(6)" styleClass="zonetexte"><OPTION VALUE='4' selected>MultiOF</OPTION>
</select>
</td>
<td><input type="text" name="MapTpsTotal(6)" value="0" size=5></td>
<td><input type="checkbox" name="MapPtgeFin(6)" value=" false"></td>
<td><input type="checkbox" name="MapSoldeOp(6)" value=" false"></td>
</tr>
<tr>
<td><input type="hidden" name="MapOF(7)" value="OF-PAR-0000034">OF-PAR-0000034 </td>
<td><input type="hidden" name="MapPoste(7)" value="ASSEM">ASSEM </td>
<td><input type="hidden" name="MapOpe(7)" value="5">
Assemblage composants</td>
<td><input type="hidden" name="MapArt(7)" value="CD200">
  </td>
<td><input type="hidden" name="MapDebut(7)" value="2007-03-30 11:16:00.0">2007-03-30 11:16:00.0 </td>
<td><input type="hidden" name="MapQtPrev(7)" value="200.000">200.000 </td>
<td><input type="text" name="MapQtDecl(7)" value="0" size=5></td>
<td><input type="text" name="MapQtRebut(7)" value="0" size=5></td>
<td><select id="MapTypeTemps(7)" name="MapTypeTemps(7)" styleClass="zonetexte"><OPTION VALUE='4' selected>MultiOF</OPTION>
</select>
</td>
<td><input type="text" name="MapTpsTotal(7)" value="0" size=5></td>
<td><input type="checkbox" name="MapPtgeFin(7)" value=" false"></td>
<td><input type="checkbox" name="MapSoldeOp(7)" value=" false"></td>
</tr>
</table>
<input type="submit" value="Valider modifications">
</form> |
Voici mon struts-config.xml:
Code:
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 55 56 57 58 59 60 61 62
| <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
<struts-config>
<form-beans>
<form-bean name="IdentFormBean" type="com.igs.beans.IdentFormBean">
</form-bean>
<form-bean name="ListeSaisies" type="com.igs.beans.ListeSaisies">
</form-bean>
<!-- <form-bean name="OFForm" type="com.igs.beans.OFForm" />-->
</form-beans>
<global-exceptions/>
<global-forwards>
<forward name="Home" path="/Home.do" />
</global-forwards>
<action-mappings>
<action
path="/afficheSaisies"
type="com.igs.struts.actions.ActionListeSaisies"
name="IdentFormBean"
scope="request"
unknown="false"
validate="true"
input="/RechercheOF.jsp">
<forward name="success" path="/jsp/ListeSaisies.jsp"/>
</action>
<action
path="/ModifListeSaisies"
type="com.igs.struts.actions.ModifListeSaisies"
name="ListeSaisies"
scope="request"
unknown="false"
validate="false"
input="/ListeSaisies.jsp">
<forward name="success" path="/jsp/RechercheOF.jsp"/>
</action>
<action
path="/UpdateRecherche"
type="com.igs.struts.actions.UpdateRecherche"
name="IdentFormBean"
scope="request"
unknown="false"
validate="false"
input="/RechercheOF.jsp">
<forward name="success" path="/jsp/RechercheOF.jsp"/>
</action>
<action path="/Home"
type="com.igs.struts.actions.HomeAction" name="IdentFormBean"
scope="request" validate="false">
<forward name="success" path="/jsp/RechercheOF.jsp" />
</action>
</action-mappings>
<controller/>
<message-resources null="true" parameter="MessagesResources"/>
</struts-config> |
Mon soucis est que lorqsue je passe par l'action /ModifListeSaisies, je ne parviens pas à acceder aux valeurs de mon formbean, dans ma classe action:
Code:
1 2 3
|
ListeSaisies ListeSaisiesBean = (ListeSaisies)request.getAttribute("ListeSaisies");
System.out.println(ListeSaisiesBean.getMapDebut("0")); |
me renvoie null alors que si je regarde dans ma jsp, la valeur devrait etre: 2007-03-29 15:54:00.0
Voici ma classe ListeSaisies (ActioForm)
Code:
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
| public class ListeSaisies extends ActionForm {
//attributs
private String secteur="";
private String matricule="";
private int nbLignes=0;
public Map mapOF = new HashMap();//<td><bean:message key="lib.OF"/></td>
public Map mapPoste = new HashMap();//<td><bean:message key="lib.poste"/></td>
public Map mapOpe = new HashMap();//<td><bean:message key="lib.ope"/></td>
public Map mapDesOpe = new HashMap();//<td><bean:message key="lib.ope"/></td>
public Map mapArt = new HashMap();//<td><bean:message key="lib.ArtLance"/></td>
public Map mapArtDes = new HashMap();//juste pour info
public Map mapDebut = new HashMap();//<td><bean:message key="lib.debut"/></td>
public Map mapQtPrev = new HashMap();//<td><bean:message key="lib.QtPrev"/></td>
public Map mapQtDecl = new HashMap();//<td><bean:message key="lib.QtDecl"/></td>
public Map mapQtRebut = new HashMap();//<td><bean:message key="lib.SugRebut"/></td>
public Map mapTypeTemps= new HashMap();//*normal masqué ou multiOF <td><bean:message key="lib.TypeTemps"/></td>
public Map mapTpsTotal = new HashMap();//<td><bean:message key="lib.TempsTotal"/></td>
public Map mapPtgeFin = new HashMap();//<td><bean:message key="lib.PointageFin"/></td> => case à cocher
public Map mapSoldeOp = new HashMap();//<td><bean:message key="lib.SoldeOp"/></td>=> case à cocher
//methodes
/**
* crée les différentes map
*/
public void dump() throws Exception {
//
dumpMap(mapOF,"OF");
dumpMap(mapPoste,"poste");
dumpMap(mapOpe,"ope");
dumpMap(mapArt,"ArtLance");
dumpMap(mapDebut,"debut");
dumpMap(mapQtPrev,"QtPrev");
dumpMap(mapTypeTemps,"TypeTemps");
dumpMap(mapTpsTotal,"TempsTotal");
}
private void dumpMap(Map map, String banner) {
System.out.println(banner);
Iterator itKeys = map.keySet().iterator();
while ( itKeys.hasNext() ) {
String key = (String)itKeys.next();
Object o = map.get(key);
//System.out.println("1");
System.out.print(" key(" + key + ") value(" + o + ")") ;
}
System.out.println("");
}
public String getMatricule() {
return matricule;
}
public void setMatricule(String matricule) {
this.matricule = matricule;
}
public String getSecteur(String key) {
return secteur;
}
public void setSecteur(String secteur) {
this.secteur = secteur;
}
public Object getMapArt(String key) {
return mapArt.get(key);
}
public void setMapArt(Map mapArt) {
this.mapArt = mapArt;
}
public Object getMapDebut(String key) {
return mapDebut.get(key);
}
public void setMapDebut(Map mapDebut) {
this.mapDebut = mapDebut;
}
public Object getMapOF(String key) {
return mapOF.get(key);
}
public void setMapOF(Map mapOF) {
this.mapOF = mapOF;
}
public void setMapOF(Vector v1) {
this.mapOF = mapOF;
}
public Object getMapOpe(String key) {
return mapOpe.get(key);
}
public void setMapOpe(Map mapOpe) {
this.mapOpe = mapOpe;
}
public Object getMapPoste(String key) {
return mapPoste.get(key);
}
public void setMapPoste(Map mapPoste) {
this.mapPoste = mapPoste;
}
public Object getMapQtPrev(String key) {
return mapQtPrev.get(key);
}
public void setMapQtPrev(Map mapQtPrev) {
this.mapQtPrev = mapQtPrev;
}
public Object getMapTpsTotal(String key) {
return mapTpsTotal.get(key);
}
public void setMapTpsTotal(Map mapTpsTotal) {
this.mapTpsTotal = mapTpsTotal;
}
public Object getMapTypeTemps(String key) {
return mapTypeTemps.get(key);
}
public void setMapTypeTemps(Map mapTypeTemps) {
this.mapTypeTemps = mapTypeTemps;
}
public int getNbLignes() {
return nbLignes;
}
public void setNbLignes(int nbLignes) {
this.nbLignes = nbLignes;
}
public Object getMapArtDes(String key) {
return mapArtDes.get(key);
}
public void setMapArtDes(Map mapArtDes) {
this.mapArtDes = mapArtDes;
}
public Object getMapPtgeFin(String key) {
return mapPtgeFin.get(key);
}
public void setMapPtgeFin(Map mapPtgeFin) {
this.mapPtgeFin = mapPtgeFin;
}
public Object getMapQtDecl(String key) {
return mapQtDecl.get(key);
}
public void setMapQtDecl(Map mapQtDecl) {
this.mapQtDecl = mapQtDecl;
}
public Object getMapQtRebut(String key) {
return mapQtRebut.get(key);
}
public void setMapQtRebut(Map mapQtRebut) {
this.mapQtRebut = mapQtRebut;
}
public Object getMapSoldeOp(String key) {
return mapSoldeOp.get(key);
}
public void setMapSoldeOp(Map mapSoldeOp) {
this.mapSoldeOp = mapSoldeOp;
}
public String getSecteur() {
return secteur;
}
public Object getMapDesOpe(String key) {
return mapDesOpe.get(key);
}
public void setMapDesOpe(Map mapDesOpe) {
this.mapDesOpe = mapDesOpe;
}
} |
Est-ce que quelqu'un aurait une idée, je commence à caler, jsuis sur que c'est évident mais mes yeux ne voient plus grand chose.
Merci pour votre aide.