• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Property 'someproperty' not found on type java.lang.String

 
baxhuli pema
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please if anyone can help me with this error because it is frustrating me.


This is the error that I am getting when the JSP containing this form is called. the "userid" column is in the database and also in the user bean.
Thank you.
 
Matthew Brown
Bartender
Posts: 4565
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, based on that error message it looks like user is not in fact a User object, but is actually a String. Then it tries to access the userid property of the String, which obviously doesn't exist. So I'd suggest looking first at where you declare your user bean.
 
baxhuli pema
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your reply. I thought it too actually but I am not getting any idea because the user bean is accessed by other jsp. I am getting this error only in this case.
 
Paul Clapham
Sheriff
Pie
Posts: 20725
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevertheless it's pretty clear from the error message that what Matthew Brown said was completely correct. So now you need to find out why. Looking for reasons why your code is in fact correct or reasons why Matthew was in fact incorrect is not a good strategy at this point.

As for finding out why: something which ran before that code created a "user" property which is a String. Remember that there are several places where the JSP compiler looks for that property (e.g. session scope, request scope, and so on), and you may be assuming that it's in one of those places whereas it's really in another place with higher priority.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic