| Author |
Custom tags help
|
sebastian pettersson
Greenhorn
Joined: Apr 08, 2005
Posts: 3
|
|
I am trying to create a custom tag that generates the code for an HTML table in this manner: Here the tag draws a table of no more than 3 coloumns and as many rows as it takes to include all items. And in each cell of the table the value of currentBean.aProperty is printed. The tag is defined through a tag file: So the table generating code works, i've come that far. What doesn't work is the line: "${currentBean.aProperty}" in the jsp code. This Exception is thrown:
So apparently the container sees currentBean as a String object instead of a bean. If I change the EL expression to "${currentBean}" no exception is thrown and it evaluates to the fully specified classname of currentBean. Can anyone help to get it working like i want it too with code like the first code snippet? Thanks in advance, Sebastian [ April 10, 2005: Message edited by: sebastian pettersson ]
|
 |
seb petterson
Ranch Hand
Joined: Mar 04, 2005
Posts: 118
|
|
Ok, so now i realize that the value of the variable "items", as it is declared in the jsp, is receieved as a String in the tag. And the forEach loop is probably just iterating over a set of substring elements separated by some token in the Collection's toString() value. Hence the call throwing the exception looks something like this: So the question is how to define a custom tag (through a tag file preferably) that takes a bean (or any non-String value) variable. Any feedback is appreciated, even if you don't know the answer. Thanks.
|
 |
sebastian pettersson
Greenhorn
Joined: Apr 08, 2005
Posts: 3
|
|
Matter resolved:
|
 |
 |
|
|
subject: Custom tags help
|
|
|