• Post Reply Bookmark Topic Watch Topic
  • New Topic

Very Quick Question:EL seems to be case insensitive?

 
eamonn dunne
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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 <cut value="${sessionScope.user.Username}"/> doesnt work but <cut 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
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!