reset password
Author Message
Vanquish39
Posts: 134
Posted 23:48 Apr 24, 2011 |

How do you kill jsp session?  After the grade shows for lab1, I can't restart.  Everytime I restart server, it just shows the grade.  There are no variables set, so I'm not doing <c:remove ...>

 

Thanks

cysun
Posts: 2935
Posted 07:30 Apr 25, 2011 |

To properly kill a session you need to call session.invalidate(). You can do that in a servlet like in the Logout.java example, or if you have to use a JSP, you can put the code in JSP scriptlet.

In the case of Lab 1, you don't have to kill the session though. On the page that shows the grade, add a link "Start Over". When this link is clicked, it sends a parameter to set currentTestEntryIndex to 0 so a user can "start over".