• 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:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Error setting the expression with value [Ljava.lang.String;@1d05b0a

 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have one register.jsp file as follow




The Action class is



and one register_success.jsp page thats displayed after successful registration.
The register_success.jsp page is



Everything happens successfully with except register_success.jsp page throws exception at tag <s:property value="beanPerson.lastName"/> saying
Error setting expression 'beanPerson.lastName' with value '[Ljava.lang.String;@1d05b0a'
Class ognl.OgnlRuntime can not access a member of class Register.Model.Person with modifiers "private"

The rest fields firstName, emailId and age are displayed successfully on register_success.jsp page
I am not able to figure out whats wrong with lastName field.
Could you please help?
 
Ranch Hand
Posts: 93
IntelliJ IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please, post the code for Person class.

The error says:

Class ognl.OgnlRuntime can not access a member of class Register.Model.Person with modifiers "private"



So I think Person class needs some getter/setter...
 
MaheshS Kumbhar
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Person class is


 
MaheshS Kumbhar
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Eduardo

>>>> So I think Person class needs some getter/setter...
Your statement solved my problem

Yes there is a problem in a setter method for lastName field. By mistake it was named as setlastName instead of setLastName

Thank you.
 
Eduardo Yañez Parareda
Ranch Hand
Posts: 93
IntelliJ IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The problem is that your setter method for lastName has a typo...



It have to be setLastName not setlastName... Because of that the framework tries to access a private method, because it doesn't find a setter.
 
Liar, liar, pants on fire! refreshing plug:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic