Cannot convert abcdefg of type class java.lang.String to class [Ljava.lang.String;
12,436
It seems you are trying to do the equivalent of
columnText = columnText + '.pdf'
but that is not the usage of fn:join
. join
recieves an array and joins its elements using the second argument as a separator.
Try with
<c:set var="columnText" value="${columnText}.pdf"/>
By the way, if you wanted to put strings together you should have looked for help in concatenating strings, to find posts like this: Concatenate strings in JSP EL?
Author by
Hedge
Updated on June 04, 2022Comments
-
Hedge almost 2 years
I'm trying to put together a String in a tag-library like this:
<c:set var="columnText" value="${fn:join(columnText,'.pdf')}" /> <a href="${fn:join('http://host:8082/pdf/',columnText)}" >bla</a>
However this exception occurs:
javax.el.ELException: Cannot convert abcedfg of type class java.lang.String to class [Ljava.lang.String;
'abcdefg' is the content of columnText at first.