Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error: Cannot find any information on property

 
Rahul Sudip Bose
Ranch Hand
Posts: 637
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error :
org.apache.jasper.JasperException: Cannot find any information on property 'TheName' in a bean of type 'cool.Person'

I want my jsp to be able to get and set "TheName" string of my bean. Please tell me how to do this. The code i tried is shown below :

Bean


JSP


The DD seems to be ok, so i will not put it now.
 
Imran Vohra
Ranch Hand
Posts: 77
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Please change
private String TheName = "default";

to

private String theName = "default";
Because, java bean property should start with lower case.
 
Rahul Sudip Bose
Ranch Hand
Posts: 637
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the clue Imran. Progress had stopped because of a small alphabet . But i found some new things and i want to be 100% sure about this capital-small issue.

Your answer needs correction (see the code below)
The property of jsp must begin with small alphabet - the bean can have 1st alphabet capital.
Now looking at this - there is one more possibility - what if i have fields in bean : theName and TheName and corresponding getter and setters. Which one will be used by jsp - theName ? Why did they make this restriction on 1st alphabet ???

This works :
jsp - theName

class-


 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's the way Java beans work. Please read up on beans.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic