Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL problem/error  RSS feed

 
Christopher Frankland
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to get a collection of VOs to display in my html page. I keep getting the following error:

Nested Exception is javax.servlet.jsp.JspException: An error occurred while evaluating custom action attribute "value" with value "${patient.rStore}": Unable to find a value for "rStore" in object of class "com.dr.vo.PatientVO" using operator "." (null)

Code:

JSP:


VO:


DAO:


ACTION:


I am using a DAO, VO and Action class to create the collection. Any help would be much appreciated as I have spent the past 2 days on this.

Thanks!
[ January 17, 2008: Message edited by: Bear Bibeault ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The capitalization is causing your problem.

This sometimes happens when your bean properties have names that start with a single lower case letter followed with an upper case letter.

If it's difficult to change the accessor name at this point, you might want to consider writing a wrapper method such as getRemoteStore() which simply calls and returns the value of getRStore().
 
Christopher Frankland
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Ben. Is it the field name within the VO that is the issue? I can modify rStore to something else if necessary.
 
Christopher Frankland
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, it worked. For as long as I have been doing this, I have never come across this problem! Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66188
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, the JavaBean naming stuff has a few kinks such as this. You just learn what to avoid.

Besides, remoteStore reads much better than rStore, no?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The bean naming convention isn't perfect.
It's possible to create ambiguities.

For instance:
getssn() and getSsn() would both be valid method names as far as the compiler is concerned but, when when the JSP engine tries to use reflection to figure out which one you're calling with ${person.ssn} it may not always be clear which one it will use.

I've run into trouble with similar accessor names and try to keep that in mind when naming properties now.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!