This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes Property 'someproperty' not found on type java.lang.String 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 » Java » JSP
Bookmark "Property Watch "Property New topic

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

baxhuli pema

Joined: Nov 09, 2012
Posts: 11
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

Joined: Apr 06, 2010
Posts: 4339

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

Joined: Nov 09, 2012
Posts: 11
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

Joined: Oct 14, 2005
Posts: 18541

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.
I agree. Here's the link:
subject: Property 'someproperty' not found on type java.lang.String
Similar Threads
user selection not redisplayed after ActionError
no WebApplicationContext found: no ContextLoaderListener registered?
JSTL tag error
Overriding <exception-type> tag in web.xml
I am getting error when starting Tomcat .How can I rectify it?