u mean HttpSession userSession = session.putValue("staffId", staffId); ?
i've done this already.
"Sachin S. Khanna" wrote:
> A better option would be to add a token string to the users session when he
> logs on to your site. And remove the token string from the session when the
> user wishes to log off. Another thing, you would have to check for the token
> string in every jsp page to see whether the user is logged on, if not then
> you must direct the user to the log on page.
> ----- Original Message -----
> From: Chin Sung Kit <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, October 23, 2000 12:39 PM
> Subject: help,invalidate session
>
> > hi,
> >
> > i have a problem invalidating the user's session.
> >
> > i have a <a href> link, if the user clicks on this link, it is supposed
> > to sign out the user - HttpSession.invalidate();
> >
> > my jsp code:
> > <%
> > String signout = request.getParameter("signout");
> > if (signout != null)
> > userSession.invalidate();
> > %>
> >
> > i'm using tomcat3.1
> >
> > thanks for any help/suggestion.
> >
> > ced
> >
> > below is the error:
> > Internal Servlet Error:
> >
> > javax.servlet.ServletException:
> > at
> >
> org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
> l.java:386)
> >
> > at
> >
> jsp._0002fjsp_0002fsignin_0002ejspsignin_jsp_23._jspService(_0002fjsp_0002fs
> ignin_0002ejspsignin_jsp_23.java:149)
> >
> > at
> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java, Compiled
> > Code)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java,
> > Compiled Code)
> > at
> >
> org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja
> va,
> > Compiled Code)
> > at
> > org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java,
> > Compiled Code)
> > at org.apache.jasper.runtime.JspServlet.service(JspServlet.java,
> > Compiled Code)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java,
> > Compiled Code)
> > at
> > org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
> > Compiled Code)
> > at
> > org.apache.tomcat.core.ContextManager.service(ContextManager.java,
> > Compiled Code)
> > at
> >
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
> onnectionHandler.java,
> > Compiled Code)
> > at
> > org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java,
> > Compiled Code)
> > at java.lang.Thread.run(Unknown Source)
> >
> > Root cause:
> >
> > java.lang.NullPointerException:
> > at
> >
> jsp._0002fjsp_0002fsignin_0002ejspsignin_jsp_23._jspService(_0002fjsp_0002fs
> ignin_0002ejspsignin_jsp_23.java:136)
> >
> > at
> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java, Compiled
> > Code)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java,
> > Compiled Code)
> > at
> >
> org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja
> va,
> > Compiled Code)
> > at
> > org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java,
> > Compiled Code)
> > at org.apache.jasper.runtime.JspServlet.service(JspServlet.java,
> > Compiled Code)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java,
> > Compiled Code)
> > at
> > org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
> > Compiled Code)
> > at
> > org.apache.tomcat.core.ContextManager.service(ContextManager.java,
> > Compiled Code)
> > at
> >
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
> onnectionHandler.java,
> > Compiled Code)
> > at
> > org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java,
> > Compiled Code)
> > at java.lang.Thread.run(Unknown Source)
> >
> >
> ===========================================================================
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets