tags:

views:

40

answers:

1

From first.jsp I am sending some parameters to result.jsp as -

<a href="result.jsp?itemId=${itemId}&itemName=${item.itemName}&itemCode=${item.itemCode}')">Show Items</a>

Here ${item.itemName} can have values like "food & stationary". When item name contains an "&", I am not able to get whole value on result page, its printing only "food". Is there any way (in JSTL or any) so that I can encode "&". I know if I would convert "&" to "%26" then this would correct.

+1  A: 

Use JSTL's c:url and c:param for that. Basic example:

<a href="<c:url value="result.jsp">
    <c:param name="itemId" value="${itemId}" />
    <c:param name="itemName" value="${item.itemName}" />
    <c:param name="itemCode" value="${item.itemCode}" />
</c:url>">Show Items</a>
BalusC