I am stumped at this:
I am querying my Database using HQL. This part of the process is working just fine, as when I debug, I can clearly see that the variable contains set of elements with the needed data. however, in my JSP page, when I iterate over the list, I get the funky Ljava.lang output:
Now, I understand that I need to have it output as a string, but how to do this with strut's iterator?
This is how I am iterating over the list, in my jsp page:
Here is what "myList" variable contains, once it executes the query:
myList
--elementData
----[0]
------[0]
-------- 1
------[1]
-------- This is the description
----[1]
------[0]
-------- 2
------[1]
-------- Second description
I cannot change the value from "[0]" or "[1]" to something else, as this is how they are stored in the list
Using a bare "[n]" OGNL expression evaluates to the stack minus the top n entries, which will almost never be what you want.
Set the var of the iterator and use that:I'm skeptical that that's what the HQL would return, though; an HQL query normally returns a collection of domain objects, from which you should be able to access properties by their proper names.