File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Error setting the expression with value [Ljava.lang.String;@1d05b0a Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Error setting the expression with value [Ljava.lang.String;@1d05b0a" Watch "Error setting the expression with value [Ljava.lang.String;@1d05b0a" New topic
Author

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

MaheshS Kumbhar
Ranch Hand

Joined: Sep 24, 2009
Posts: 188
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?


I am slow but sure
Eduardo Yañez Parareda
Ranch Hand

Joined: Oct 09, 2008
Posts: 92

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


http://serfj.sourceforge.net - Simplest Ever REST Framework for Java
MaheshS Kumbhar
Ranch Hand

Joined: Sep 24, 2009
Posts: 188
The Person class is


MaheshS Kumbhar
Ranch Hand

Joined: Sep 24, 2009
Posts: 188
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

Joined: Oct 09, 2008
Posts: 92

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.
 
 
subject: Error setting the expression with value [Ljava.lang.String;@1d05b0a
 
Similar Threads
Error while validating the input
java.lang.NullPointerException
Struts2 - execAndWait Interceptor
s:select Error The requested list key 'encoder' could not be resolved as a collection
<s:property value=""> in comparison