This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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: 64632
86
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic