I have a jsp page with multiple links created inside a loop. All the links go to exactly one another jsp page. In the second jsp page I need to find out which link was clicked in the first jsp page. How can I do that ? Is there any way after clicking a link in the first jsp page I can set an attribute instantly, so that in the second page I can get that attribute to determine which link was clicked ?
Here is my code of the loop with the links -- http://pastebin.com/J3JGu5jD
<%
System.out.println(Going inside loop);
for(int i = 0; i < n_row ; i++)
{
course_name = dbManager.get_course_name(teachers_course_id_list[i]);
course_id = teachers_course_id_list[i];
%>
table = '<tr><td> <a href=MarkDistribution1.jsp?course_id_QSparam
='+<%=course_id%>+'>'+ <%=course_id%> + ': ' + <%=course_name%>+'</td>
</a></tr>'
document.write(table);
<%
}
%>
PS: Another question. I have a string variable link. is this the proper way to assign it to the javascript variable --- javascript_variable = <%=link%> ?