erreurs struts

erreurs struts - Java - Programmation

Marsh Posté le 21-12-2005 à 13:05:20    

Bonjour,
je suis entrain de m'initier à struts avec un exemple  mais j'ai cette erreur, je voudrais savoir d ou veint l erreur je pige rein
 
 
 

Citation :

No action instance for path /formulaire could be created
 
--------------------------------------------------------------------------------
 
type Rapport d'état
 
message No action instance for path /formulaire could be created
 
description Le serveur a rencontré une erreur interne (No action instance for path /formulaire could be created) qui l'a empêché de satisfaire la requête.
 


 
struts-config.xml

Citation :

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!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>
<action-mappings>
<action
path="/main"
parameter="/vues/main.html"
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"
type="projet.struts.personne.FormulaireBean"
parameter="/vues/formulaire.personne.jsp"
/>
</action-mappings>
</struts-config>


 
FormulaireBean.java
 

Citation :

package projet.struts.personne;
 
import org.apache.struts.action.ActionForm;
public class FormulaireBean extends ActionForm {
// nom
private String nom = null;
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
// age
private String age = null;
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
}


 
 
formulairepersonne.jsp
 

Citation :

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html>
<meta http-equiv="pragma" content="no-cache">
<head>
<title>Personne - formulaire</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>

Reply

Marsh Posté le 21-12-2005 à 13:05:20   

Reply

Marsh Posté le 29-12-2005 à 11:32:52    

Moi aussi je commence à regarder un peu le fonctionnement de Struts en ce moment...
Apparemment tu n'as pas développé de composant FormulaireAction dans ton package projet.struts.personne, de plus tu dois faire référence à ta classe FormulaireBean dans la section <form-beans> de struts-config ; la section <action-mappings> correspond aux classes qui dérivent de Action.  
Et dans ta JSP ton formuaire pointe vers /main   c'est normal ?

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed