Antonio Petrelli on 05/11/07 08:14, wrote:
2007/11/4, Adam Hardy <[EMAIL PROTECTED]>:
Antonio Petrelli on 04/11/07 16:17, wrote:
2007/11/4, Adam Hardy <[EMAIL PROTECTED]>:
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.
You could set a string variable this way:
<c:set var="myStringVariable"><c:out value="${category.id}"/></c:set>
That's not quite the minimalist approach I was thinking of, but it is one
approach.



Anyway I wonder what does it prevent you from using <c:url> and <c:param>...

To keep the JSP short and clear. Instead of these tags:

<c:url value="edit.html" var="url1">
  <c:param name="category.id">${category.id}</c:param>
</c:url>
<a href="${url1}">xxxxx......</a>

do it with JSTL-EL:

<a href="${pc:url(pc:concat('edit.html?category.id=', category.id))}">


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to