P
pincopallo_it
I got a servlet and and I d like to use the interface
HttpSessionBindingListener to check when session expires and give a
message to the user
I did not find examples about how to use it...
Anyone can help ?
thats what I do:
1) public class GUIControllerRead extends HttpServlet
public class GUIControllerRead extends HttpServlet implements
HttpSessionBindingListener // I add the interface in this way
2)I added this code
HttpSessionBindingEvent firstry= new HttpSessionBindingEvent;
public void valueUnbound(firstry) {
System.out.println ("Expired session " );
}
public void valueBound(firstry) {
System.out.println ("Active session " );
}
protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
throws ServletException
{
int id_eins;
session = request.getSession();
request.setAttribute("guicontroller",
this.getClass().getName());
Enumeration en = request.getParameterNames();
while (en.hasMoreElements()) {
...
Thanks
Gianni
HttpSessionBindingListener to check when session expires and give a
message to the user
I did not find examples about how to use it...
Anyone can help ?
thats what I do:
1) public class GUIControllerRead extends HttpServlet
public class GUIControllerRead extends HttpServlet implements
HttpSessionBindingListener // I add the interface in this way
2)I added this code
HttpSessionBindingEvent firstry= new HttpSessionBindingEvent;
public void valueUnbound(firstry) {
System.out.println ("Expired session " );
}
public void valueBound(firstry) {
System.out.println ("Active session " );
}
protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
throws ServletException
{
int id_eins;
session = request.getSession();
request.setAttribute("guicontroller",
this.getClass().getName());
Enumeration en = request.getParameterNames();
while (en.hasMoreElements()) {
...
Thanks
Gianni