EL expressions and string concatenation 2007-11-05 - By Karr, David
Back Would this work?
href="${pc:url('/category/edit.html?category.id=')}${category.id}"
> -- --Original Message-- -- > From: Adam Hardy [mailto:ahardy.struts@(protected)] > Sent: Sunday, November 04, 2007 8:07 AM > To: Struts Users Mailing List > Subject: EL expressions and string concatenation > > 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) > >
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To unsubscribe, e-mail: user-unsubscribe@(protected) For additional commands, e-mail: user-help@(protected)
|
|