retrieve beans value using EL expressions

Im able to retrieve a beans value if its is primitive variabel, String or []String by using EL expression. But what i REALLY want to retrieve is an vector or hashtable, and print out each value of the collection-class. But I cant figure out how to define what kind of value the bean holds (is it called typecast?).

So it would look like this. Bean -> Vector -> Object. First define Vector from Bean. Second define Object from Vector. Third print out optional values from each object.

I'm still not sure what your question is. You have a bean named Pilot -- by the way, you should be using standard Java naming conventions, so the id of the bean should be pilot -- then you create and populate an Evangelion instance and set it as the 'container' property of the bean.

Where's the Vector you speak of? Is the container property an indexed bean property? (If so, should it not be an array?)

Sebastian Green
Ranch Hand

Joined: Jan 30, 2004
Posts: 136

posted Jul 31, 2004 10:20:00

0

My bad, its supose to be a vector in the bean value not an object, so this is what it would look like

OK, so to iterate over the Vector (why not an ArrayList?) you would use (again recommending pilot over Pilot):

Sebastian Green
Ranch Hand

Joined: Jan 30, 2004
Posts: 136

posted Jul 31, 2004 14:09:00

0

Thanks I will try that one out. To be honest, I really dont now the big diffrent between Arraylist & Vector. All I need is an collection class that can handel objects. And i will change it to pilot . Thanks for the help, you have been most helpful!

Sebastian Green
Ranch Hand

Joined: Jan 30, 2004
Posts: 136

posted Aug 01, 2004 05:07:00

0

Here is the deal. Im having still having problems to retrieve the value using EL c:forEach. Im able to get the value with this syntax. ${pilots.container[0].name} but when i try to fetch like this

the output is nothing, in the pagesource it says <c:forEach var="entry" items="[uppg4.Evangelion@1d742a1, uppg4.Evangelion@1579371]" >