jasper exception

B

bentaman

hi i'm new in struts and i get this error with my code .if someone
can help me i will be really happy
thanks

"org.apache.jasper.JasperException: Exception in JSP:
/vues/formulaire.jsp:24

21: <table>
22: <tr>
23: <td>Nom</td>
24: <td> <html:text property="nomz" size="20" /> </td>
25: </tr>
26: <tr>
27: <td>Age</td>"

Here is my code

*****************************************************************************************************************************
struts-config.xml

<?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>

<form-beans>
<form-bean name="frmPersonne"
type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="nom" type="java.lang.String" initial=""/>
<form-property name="age" type="java.lang.String" initial=""/>
</form-bean>
</form-beans>

<action-mappings>

<action
path="/main"
name="frmPersonne"
scope="session"
validate="true"
input="/erreurs.do"
type="istia.st.struts.personne.FormulaireAction"<forward name="reponse" path="/reponse.do"/>
</action>

<action
path="/erreurs"
parameter="/vues/erreurs.jsp"
type="org.apache.struts.actions.ForwardAction"
/>

<action
path="/reponse"
parameter="/vues/reponse.jsp"
type="org.apache.struts.actions.ForwardAction"
/>


<action
path="/formulaire"
parameter="/vues/formulaire.jsp"
type="org.apache.struts.actions.ForwardAction"
/>
</action-mappings>


<message-resources parameter="ressources.personneressources"/>

</struts-config>
*********************************************************************************************

formulaire.jsp

<%@ 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" name="frmPersonne"
type="istia.st.struts.personne.PersonneDynaForm">
<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>
</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>
*****************************************************************************************************
PersonneDynaForm.java

package istia.st.struts.personne;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.DynaActionForm;

@SuppressWarnings("serial")
public class PersonneDynaForm extends DynaActionForm {
// validation
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
// gestion des erreurs
ActionErrors erreurs = new ActionErrors();
// le nom doit être non vide
String nom = (String) this.get("nom");
if (nom == null || nom.trim().equals("")) {
erreurs.add("nomvide", new ActionError(
"personne.formulaire.nom.vide"));
}
// l'âge doit être non vide
String age = (String) this.get("age");
if (age == null || age.trim().equals("")) {
erreurs.add("agevide", new ActionError(
"personne.formulaire.age.vide"));
} else {
// l'âge doit être un entier positif
if (!age.matches("^\\s*\\d+\\s*$")) {
erreurs.add("ageincorrect", new ActionError(
"personne.formulaire.age.incorrect", age));
// on rend la liste des erreurs
}

} // if
// on rend la liste d'erreurs
return erreurs;
}
}// classe

************************************************************************

Thank you
 
B

bentaman

just to say that the eroor is

org.apache.jasper.JasperException: Exception in JSP:
/vues/formulaire.jsp:24

21: <table>
22: <tr>
23: <td>Nom</td>
24: <td> <html:text property="nom" size="20" /> </td>
25: </tr>
26: <tr>
27: <td>Age</td>


<html:text property="nom" not <html:text property="nomz"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top