File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes setting a session variable in a 'href' Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "setting a session variable in a Watch "setting a session variable in a New topic

setting a session variable in a 'href'

farhath farook
Ranch Hand

Joined: Aug 01, 2007
Posts: 37
i have a set of data that is displayed in a table in the JSP.
and when the hyper link on reach row is clicked i was to sent the object related to that row as value in the session( because i need that object in next to navigations.)
the following code enables to pass parameters only
<c:forEach var ="report" items = "${pendingReports}">
<td> ${report.reportname}</td>
<td> ${report.requestedDoctor}</td>
<td> ${report.requestedDate}</td>
<td> <a href= <c:url value ="Lab/UploadReport.jsp?report=${report}" /> >Upload</a></td>
can any one suggest the way how can i sent the session object on the fly according to the user selection..

thanks in advance
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63837

You need to communicate with the server to execute the code to set the scoped variable. You can submit a form, load a new request, or use Ajax.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: setting a session variable in a 'href'
jQuery in Action, 3rd edition