Débutant qui galère avec un formulaire
Bonjour à tous,
Je suis débutant sur les techno struts.
Je souhaite faire une première page d'appli pour authentifier un user.
=> Demande de login et password.
Pour le début je ne fait pas de validate... je veux juste récupérer les infos dans mon Bean.
La page d'accueil est index.jsp avec comme formulaire :
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
|
<html:form action="/accueil" name="frmAuthentification" type="fr.ndo.struts.forms.AuthentificationBean">
<table width="100%" height="100%" border=0>
<tr height="1%">
<td align="center">
<table>
<tr>
<td>
<table>
<tr>
<td align="center">Informations de connexion</td>
</tr>
<tr>
<td>
<table>
<col width=50%>
<col width=50%>
<tr>
<td>Identifiant :</td>
<td>
<html:text property="login" value="Saisir le login"/>
</td>
</tr>
<tr>
<td>Mot de passe :</td>
<td>
<html:password property="password" value=""/>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center">
<html:checkbox property="changePasswd" value="0"/>Changer de mot de passe
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center">
<table cellspacing=10>
<col width=50% align="right">
<col width=50% align="left">
<tr>
<td>
<html:submit value="Valider"/>
</td>
<td>
<html:reset value="Annuler"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</html:form> |
Je souhaite daonc l'associer au bean "frmAuthentification"
Dans AuthentificationBean.java, je définis la classe de ce bean :
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
|
package fr.ndo.struts.forms;
import org.apache.struts.action.ActionForm;
public class AuthentificationBean extends ActionForm {
//Login
private String login = null;
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
//Password
private String password = null;
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
//ChangePasswd
private boolean changePasswd = false;
public boolean getChangePasswd() {
return changePasswd;
}
public void setChangePasswd(boolean changePasswd) {
this.changePasswd = changePasswd;
}
} |
Dans 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
|
<form-beans>
<form-bean
name="frmAuthentification"
type="fr.ndo.struts.forms.AuthentificationBean"
/>
</form-beans>
...
<action-mappings>
<!-- INDEX / LOGIN -->
<action
path="/index"
parameter="/index.jsp"
type="org.apache.struts.actions.ForwardAction">
</action>
<!-- ACCUEIL -->
<action
path="/accueil"
parameter="/jsp/accueil.jsp"
type="org.apache.struts.actions.ForwardAction">
</action>
</action-mappings> |
Mais quand je lance le server (Tomcat) et passe mon URL http://localhost:8080/ndo/index.do, j'ai le message erreur suivant :
org.apache.jasper.JasperException: /index.jsp(51,2) Impossible de trouver une méthode de mise à jour pour l'attribut: name
Je précise que je n'ai pas d'erreur de compilation et je pense avoir tout déclaré.
Est ce qqn a une petite idée qui pourrait me débloqué svp?
D'avance merci
BK