• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with EL functions accessing a class property

 
Albareto McKenzie
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi mooses!

Well, as this is my first messege I want to say hello to all of you.

Let's go to my problem/question.

I have been looking for this through the website and the internet and I haven't got a solution or a reference so let's see if any of you can help me.

I have created an EL function that returns a Color (my class with three attributes, colorCode, colorName and a Map<colorName, colorCode>), what I want is to access the colorCode of the Color, I will put you the code here:

The tld:



The code in the jsp I want to run:



The java class Color.java:



This is not working cause when I run the jsp this happends:



If I don't put the ".colorCode" it works of course (it shows the toString of Color), the value colors[0] is valid and it is in my list.
I am running this in a Apache Tomcat/6.0.18

So my question is, is it possible to access a property of a class directly through an EL function?
Any idea?

Thanks in advance ;)
 
Albareto McKenzie
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh!! Removing the static of the methods getColorCode() and getColorName() it works fine, I am so stupid...

Well, let's this dissapear in the catacumbs of the forum.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!