如何通过<a href=""> using jstl</a>将值从jsp传递到servlet

时间:2014-01-22 07:39:48

标签: java jsp servlets jstl

我想通过href将值从jsp发送到servlet ..但是我不知道如何附加数据..请使用jstl标签只有没有servlet请... 我检查过这个pass values from jsp to servlet using <a href>,但他们使用了scriplets ..

 <tr div class="even">
<td style="font-size:14px;"> 
    <a href="/myproject/s/permanentUserAuctionHistory?aid=" <c:out value="${auctionDo.auctionId}"/>>
    <c:out value="${auctionDo.auctionId}"/> </a></td>

1 个答案:

答案 0 :(得分:1)

aid=属性中的href后双引号(“)会导致href

您可以使用JSTL

<a href="/myproject/s/permanentUserAuctionHistory?aid=${auctionDo.auctionId}">
    <c:out value="${auctionDo.auctionId}"/> 
</a> 

OR

<a href="/myproject/s/permanentUserAuctionHistory?aid=${auctionDo.auctionId}">
    ${auctionDo.auctionId} 
</a>