user3214173
user3214173

Reputation: 227

how to pass values from jsp to servlet through <a href> using jstl

I want to send values from a jsp to the servlet via href.. but i dont know how to append the data.. pls use jstl tags only no servlets pls... i checked this pass values from jsp to servlet using <a href> but they utilize 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>

Upvotes: 0

Views: 1821

Answers (1)

Aniket Kulkarni
Aniket Kulkarni

Reputation: 12983

Double quote (") after aid= inside the href attribute breaks the href.

You can just use 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>

Upvotes: 1

Related Questions