Reputation: 81
In my servlet, I want to sort a query from my database by its date stamp. I want users to be able to click on the date stamp in a jsp page,
<td><a href="/edit"><c:out value= "${log.properties.date}" /></td>
which directs them to the /retrieve
servlet. Is there a way that I can have the servlet store the "${log.properties.date}"
date stamp? Thanks.
Upvotes: 0
Views: 406
Reputation: 279910
Change your anchor to
<a href="/edit?timestamp=<c:out value="${log.properties.date}" />"> ... </a>
Now the timestamp will be available as a String request parameter. From your servlet:
String strTimestamp = request.getParameter("timestamp");
Parse it accordingly.
Upvotes: 2