reset password
Author Message
cbort
Posts: 95
Posted 14:13 May 21, 2011 |

Why would the statement:

<c:url value="Questions" var="url"><c:param name="type" value="${tag}" /></c:url>

not output any thing?


I am working on homework 4... I set up the controller to gather information from the database and create the same question list that existed from the previous assignment... Now however, for some reason there is no URL being output by the above line... It is not the "${tag}" because it still outputs the name of all of the tags it just sets there href to an empty string...

 

<td><c:forEach items="${question.tags}" var="tag">
                    <a href='<c:url value="Questions" var="url"><c:param name="type" value="${tag}"/></c:url>'>
                    <c:out value="${tag}" escapeXml="true"/></a> </c:forEach></td>

cysun
Posts: 2935
Posted 16:21 May 21, 2011 |

I think if you specify the var attribute, the generated URL will be assigned to the variable instead being displayed directly. This would be useful if you want to use the URL in multiple places. If you just want to display the URL, try removing the var attribute.