Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

org.springframework.beans.NotReadablePropertyExcep tion: Invalid property

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my controller


my jsp

<form:form method="POST" action="add.htm" commandName="commandName">
<%@ include file="/WEB-INF/jsp/headerDetails.jsp"%>
<table width="645" border="0">
<tr>
<th class="styleHeader" colspan="2" scope="col"><spring:message
code="profile" /></th>
<th width="10" scope="col"> </th>
<th class="styleHeader" width="349" scope="col"><spring:message
code="permissions" /></th>
</tr>
<tr>
<td><label><spring:message code="name" />*</label></td>
<td><form:input path="profile.name" size="32" maxlength="30" /> <br>
<form:errors path="name" cssClass="styleErrorMessage" /></td>
<td> </td>
<td><label> <input type="checkbox" name="checkbox"
id="checkbox" /> Control of 1</label></td>
</tr>
...

I get the next error:
org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/jsp/profile.jsp at line 25

22: </tr>
23: <tr>
24: <td><label><spring:message code="name" />*</label></td>
25: <td><form:input path="profile.name" size="32" maxlength="30" /> <br>
26: <form:errors path="name" cssClass="styleErrorMessage" /></td>
27: <td> </td>
28: <td><label> <input type="checkbox" name="checkbox"


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handle JspException(JspServletWrapper.java:505)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:416)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
org.springframework.web.servlet.view.InternalResou rceView.renderMergedOutputModel(InternalResourceVi ew.java:236)
org.springframework.web.servlet.view.AbstractView. render(AbstractView.java:257)
org.springframework.web.servlet.DispatcherServlet. render(DispatcherServlet.java:1183)
org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:902)
org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:807)
org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:571)
org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:501)
javax.servlet.http.HttpServlet.service(HttpServlet .java:617)
javax.servlet.http.HttpServlet.service(HttpServlet .java:717)


root cause
org.springframework.beans.NotReadablePropertyExcep tion: Invalid property 'profile' of bean class [java.util.HashMap]: Bean property 'profile' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
org.springframework.beans.BeanWrapperImpl.getPrope rtyValue(BeanWrapperImpl.java:540)
org.springframework.beans.BeanWrapperImpl.getNeste dBeanWrapper(BeanWrapperImpl.java:447)
org.springframework.beans.BeanWrapperImpl.getBeanW rapperForPropertyPath(BeanWrapperImpl.java:424)
org.springframework.beans.BeanWrapperImpl.getPrope rtyValue(BeanWrapperImpl.java:530)
org.springframework.web.servlet.support.BindStatus .<init>(BindStatus.java:147)
org.springframework.web.servlet.tags.form.Abstract DataBoundFormElementTag.getBindStatus(AbstractData BoundFormElementTag.java:172)
org.springframework.web.servlet.tags.form.Abstract DataBoundFormElementTag.getPropertyPath(AbstractDa taBoundFormElementTag.java:192)
org.springframework.web.servlet.tags.form.Abstract DataBoundFormElementTag.getName(AbstractDataBoundF ormElementTag.java:158)
org.springframework.web.servlet.tags.form.Abstract DataBoundFormElementTag.autogenerateId(AbstractDat aBoundFormElementTag.java:145)
org.springframework.web.servlet.tags.form.Abstract DataBoundFormElementTag.resolveId(AbstractDataBoun dFormElementTag.java:136)
org.springframework.web.servlet.tags.form.Abstract DataBoundFormElementTag.writeDefaultAttributes(Abs tractDataBoundFormElementTag.java:120)
org.springframework.web.servlet.tags.form.Abstract HtmlElementTag.writeDefaultAttributes(AbstractHtml ElementTag.java:379)
org.springframework.web.servlet.tags.form.InputTag .writeTagContent(InputTag.java:139)
org.springframework.web.servlet.tags.form.Abstract FormTag.doStartTagInternal(AbstractFormTag.java:90 )
org.springframework.web.servlet.tags.RequestContex tAwareTag.doStartTag(RequestContextAwareTag.java:7 7)
org.apache.jsp.WEB_002dINF.jsp.profile_jsp._jspx_m eth_form_005finput_005f0(profile_jsp.java:547)
org.apache.jsp.WEB_002dINF.jsp.profile_jsp._jspSer vice(profile_jsp.java:173)
org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
org.springframework.web.servlet.view.InternalResou rceView.renderMergedOutputModel(InternalResourceVi ew.java:236)
org.springframework.web.servlet.view.AbstractView. render(AbstractView.java:257)
org.springframework.web.servlet.DispatcherServlet. render(DispatcherServlet.java:1183)
org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:902)
org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:807)
org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:571)
org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:501)
javax.servlet.http.HttpServlet.service(HttpServlet .java:617)
javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Show your commandClass, does it have a property "profile"?
 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Read error message and try to understand what it does mean. It's very obvious.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic