EL expressions and string concatenation 2007-11-04 - By Adam Hardy
Back This is slightly off-topic but I hope not too much, and there is a reference to struts here because I used to do this with struts1 taglibs!
I want to concatenate 2 vars into a string in EL but since one is a Long, EL can't do it, and throws a NumberFormatException because it wants them both to be Longs so it can do arithmetic addition instead.
<a href="${pc:url('/category/edit.html?category.id=' + category.id)}" title="" class="icon"> <img src="${pc:url('/images/doc1.png')}" alt=""/> </a>
pc:url is my taglib function that accepts a string parameter.
I see 3 possible solutions: - put in a JSTL <url> - create a new taglib function that takes parameters for URL parameters - create a new taglib function that concatenates all types into strings
or is there a neat work-around I haven't thought of?
Lastly, is there anyone else taking this minimalist approach who would like to open-source this stuff with me?
Thanks Adam
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To unsubscribe, e-mail: user-unsubscribe@(protected) For additional commands, e-mail: user-help@(protected)
|
|