Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Very Quick Question:EL seems to be case insensitive?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a java value class that i manage persistance with using Hibernate.



What I find strange is when I put this object into a session and use the following JSTL to retrieve it <c:out value="${sessionScope.user.Username}"/> doesnt work but <c:out value="${sessionScope.user.username}"/> does.

I find this really strange as the value starts with a uppercase "U"?

Anyone out there able to explain it, I'm happy I've gotten it working but it "feels" wrong that a different case should work.

Thankls
 
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A few things:

1) Naming variables with uppercase characters does not follow established Java conventions, which makes your code surprisingly hard to read.

2) What you name the instance variables that hold the bean's values is completely irrelevant. It's the getters that matter.

3) The EL follows conventional JavaBean rules for forming property names from the getters. So a property defined by getUsername() is named username.

4) Yes, case counts.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic