bonjour à tout le monde
Je suis debutant avec struts 1.3 et voici une erreur que me produit mon code
org.apache.jasper.JasperException: No getter method for property: "matricola" of bean: "creationForm"
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root cause
javax.servlet.ServletException: No getter method for property: "matricola" of bean: "creationForm"
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.pages.Registrazione_jsp._jspService(Registrazione_jsp.java:214)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root cause
javax.servlet.jsp.JspException: No getter method for property: "matricola" of bean: "creationForm"
org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:915)
org.apache.struts.taglib.html.BaseFieldTag.prepareValue(BaseFieldTag.java:126)
org.apache.struts.taglib.html.BaseFieldTag.renderInputElement(BaseFieldTag.java:102)
org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:80)
org.apache.struts.taglib.nested.html.NestedTextTag.doStartTag(NestedTextTag.java:63)
org.apache.jsp.pages.Registrazione_jsp._jspx_meth_nested_005ftext_005f0(Registrazione_jsp.java:364)
org.apache.jsp.pages.Registrazione_jsp._jspx_meth_html_005fform_005f0(Registrazione_jsp.java:275)
org.apache.jsp.pages.Registrazione_jsp._jspService(Registrazione_jsp.java:102)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
ET VOICI MA CLASSE REGISTRAZIONE.JSP:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="html" uri="http://struts.apache.org/tags-html" %> <%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean" %> <%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic" %> <%@ taglib prefix="nested" uri="http://struts.apache.org/tags-nested" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html:html> <head> <title><bean:message key="titolo.creazione.nuovoutente" bundle="creazione"/></title> </head> <body> <b><i><html:errors/></i></b><br/> <html:form action="/InserireNuoviUtenti.do"> <bean:message key="creazione.nuovoutente.matricola" bundle="creazione"/>
Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
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 <?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_3.dtd"> <struts-config> <!-- ========== Formulaire ============================== --> <form-beans> <form-bean name="creationForm" type="org.apache.struts.validator.DynaValidatorActionForm"> <form-property name=" Matricola" type="java.lang.String" /> <form-property name="Cognome" type="java.lang.String" /> <form-property name=" Nome" type="java.lang.String" /> <form-property name="Username" type="java.lang.String" /> <form-property name=" Password" type="java.lang.String" /> <form-property name="Confermapassword" type="java.lang.String" /> </form-bean> </form-beans> <action-mappings> <action path = "/InserireNuoviUtenti" name = "creationForm" type = "teststrust.ControlloInserimento" scope = "request" validate = "true" attribute = "creationForm" input = "/InserireNuoviUtenti.do"> <forward name="succes" path="/pages/Registrazione.jsp" /> <forward name="erreur" path="/pages/erreur.jsp" /> </action> </action-mappings> <!-- ========== Ressources de definitions de messages =========================== --> <message-resources parameter="teststrust.Resources" key="creazione"/> <!-- ========== Validation des formulaires =========================== --> <plug-in className="org.apache.struts.validator.ValidatorPlugIn"> <set-property property="pathnames" value="/org/apache/struts/validator/validator-rules.xml,/WEB-INF/validation-creazione.xml" /> </plug-in> </struts-config>
Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
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 <nested:text property="matricola"/><br> <bean:message key="creazione.nuovoutente.cognome" bundle="creazione"/> <nested:text property="cognome"/><br> <bean:message key="creazione.nuovoutente.nome" bundle="creazione"/> <nested:text property="nome"/><br> <bean:message key="creazione.nuovoutente.password" bundle="creazione"/> <nested:text property="password"/><br> <bean:message key="creazione.nuovoutente.username" bundle="creazione"/> <nested:text property="username"/><br> <bean:message key="creazione.nuovoutente.confermapassword" bundle="creazione"/> <nested:text property="confermapassword"/><br> <html:submit>Envoyer</html:submit> </html:form> <table border="1"> <thead> <tr> <th><bean:message key="colonne.matricola"/></th> <th><bean:message key="colonne.cognome"/></th> <th><bean:message key="colonne.nome"/></th> <th><bean:message key="colonne.password"/></th> <th><bean:message key="colonne.username"/></th> <th><bean:message key="colonne.confermapassword"/></th> </tr> </thead> <tbody> <logic:iterate id="utenteNuovo" name="LISTA_UTENTI" type="teststrust.BeanUtente"> <tr> <td><bean:write name="utenteNuovo" property="matricola"/></td> <td><bean:write name="utenteNuovo" property="cognome"/></td> <td><bean:write name="utenteNuovo" property="nome"/></td> <td><bean:write name="utenteNuovo" property="password"/></td> <td><bean:write name="utenteNuovo" property="confermapassword"/></td> <td><bean:write name="utenteNuovo" property="username"/></td> </tr> </logic:iterate> </tbody> </table> </body> </html:html
Partager