This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Exception when Passing Object to JSP from Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Exception when Passing Object to JSP from Servlet" Watch "Exception when Passing Object to JSP from Servlet" New topic
Author

Exception when Passing Object to JSP from Servlet

Joe Brigs
Ranch Hand

Joined: Jun 06, 2011
Posts: 60

Abends in JSP with “Unable to find a value for "reason" in object of class "java.lang.String" using operator "." “ ( I believe I'm getting this because my “histDB” object is null ? Does any one see my problem in the code ? Thanks

Code in Servlet:



Java Class:


Javabean:

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

You're asking us about some JSP code, but you haven't posted that code. Which makes it a bit difficult...

Anyway the error is saying "You asked me to evaluate the getReason() method on a String". You wouldn't get this error if you tried to evaluate it on a null reference, the JSP processor would just ignore that. So look at your code and find out why you attached ".reason" to a variable which is a String and not a ViewHistDB object.
 
Don't get me started about those stupid light bulbs.
 
subject: Exception when Passing Object to JSP from Servlet
 
Similar Threads
Setting a session attribute in a servlet
how to explain the change on a object as a parameter
Passing of an object : example
how to pass the values and how to get the Arraylist table from java script function
Question about Mock Exam 2