2

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.

Hedge
  • 16,142
  • 42
  • 141
  • 246

1 Answers1

5

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?

Community
  • 1
  • 1
madth3
  • 7,275
  • 12
  • 50
  • 74