[Struts] Problème avec struts-config.xml
Salut a tous, je suis nouveau en ce qui conserne J2EE et je suis en train de suivre un tutorial STRUTS de Serge Tahé et je suis arrivé jusqu' à lá realisation du JavaBean et jusque la tout s'est bien passé, mais la je suis en train de traiter le formulaire par le controleur et c'est lá que ça c'est compliqué, je vais vous poster mon fichier struts-config.xml et mon code formulaire.personne.jsp.
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
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<form-beans>
<form-bean name="frmPersonne" type="istia.st.struts.personne.FormulaireBean"/>
</form-beans>
<action-mappings>
<action path="/main" name="frmPersonne" scope="session" validate="true" input="/vues/erreurs.personne.jsp" parameter="/vues/main.htm" type="org.apache.struts.actions.ForwardAction"/>
<action path="/erreurs" parameter="/vues/erreurs.personne.jsp" type="org.apache.struts.actions.ForwardAction"/>
<action path="/reponse" parameter="/vues/reponse.personne.jsp" type="org.apache.struts.actions.ForwardAction"/>
<action path="/formulaire" name="frmPersonne" parameter="/vues/formulaire.personne.jsp" type="org.apache.struts.actions.ForwardAction"/>
</action-mappings>
<message-resources parameter="ressources.personneressources"/>
</struts-config> |
Dans ce code j'ai aussi essayé avec
Code:
1 2
|
<action path="/main" name="frmPersonne" scope="session" validate="true" input="/erreurs.do" parameter="/vues/main.htm" type="org.apache.struts.actions.ForwardAction"/> |
mais j'obtien toujours la meme erreur que ce soit avec l'un ou l'autre bout de code.
Mon fichier formulaire.personne.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
|
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Personne</title>
<script language="javascript">
function effacer(){
with(document.frmPersonne){
nom.value = "";
age.value = "";
}
}
</script>
</head>
<body>
<center>
<h2>Personne - formulaire</h2>
<hr>
<html:form action="/main">
<table>
<tr>
<td>Nom</td>
<td><html:text property="nom" size="20"/></td>
</tr>
<tr>
<td>Age</td>
<td><html:text property="age" size="3"/></td>
</tr>
<tr>
</table>
<table>
<tr>
<td><html:submit value="Envoyer"/></td>
<td><html:reset value="Rétablir"/></td>
<td><html:button property="btnEffacer" value="Effacer" onclick="effacer()"/></td>
</tr>
</table>
</html:form>
</center>
</body>
</html> |
L'erreur que j'obiten est la suivante:
Citation:
No input attribute for mapping path /formulaire
Je trouve cette erreur bizarre puisque l'attirbue inpute est dans le mapping.
Est-ce-que vous avez une idée de ce que ça pourait etre?
Je vous remercie a tous ceux que voudront bien se pencher sur le probleme.
Meric :)[/quote]