4

How should I write line:

<a href="User?id=<c:out value="${user.id}" />" >Profile</a>

correctly? It shoult give me something like Profile

My context:

<c:forEach items="${requestScope.users}" var="user">
    <tr>
    <td><c:out value="${user.login}" /></td>
<td><c:out value="${user.name}" /></td>
    <td><c:out value="${user.lastname}" /></td>
    <td><a href="User?id=<c:out value="${user.id}" />" >Profile</a></td>
    </tr>
</c:forEach>
user1097772
  • 3,499
  • 15
  • 59
  • 95
  • There is no problem with the first line of code you wrote here, It's fine. If the id property of your **user** bean is not initialized with a visitor input, you can even drop the `` tag and directly use the EL expression. – Med Jan 11 '13 at 09:32

2 Answers2

5

Try ' inside " or vice versa

<a href="User?id=<c:out value='${user.id}' />" >Profile</a>
Ajinkya
  • 22,324
  • 33
  • 110
  • 161
0

See image Here

This code should do <td><a href="showDetails.jsp?id=${row.id}">Details</a></td>

devS3c
  • 1
  • 2
    Please don't post a picture of the code, see https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-errors-when-asking-a-question/285557#285557 – j_4321 Aug 26 '21 at 14:11