Skip to main content

I tried after session.invalidate(); check if success run a code part(jsp/ht

1 reply [Last post]
lse123
Offline
Joined: 2008-10-12

I tried after
session.invalidate();
check if success run a code part(jsp/html) otherwise run the "else" part but failed repeatly...can you help?

<br />
<%<br />
String oldIDS = session.getId() ;<br />
session.setAttribute("check","jjj");<br />
session.invalidate(); </p>
<p>//session.setAttribute("check2","jjj2");session.isNew()==true<br />
//session.getValue("check")!=null </p>
<p>//String newIDS = session.getId() ; //session.getAttribute("check") == null<br />
//oldIDS.equals(newIDS) </p>
<p>if (session.getAttribute("check").equals("jjj")) {<br />
         Your cart items get REMOVED SUCCESS! </p>
<p>I get errors like:<br />
org.apache.jasper.JasperException: An exception occurred processing JSP page /OrderPlantItem-empty.jsp at line 45 </p>
<p>42:<br />
43: //String newIDS = session.getId() ; //session.getAttribute("check") == null   oldIDS.equals(newIDS)<br />
44:<br />
45: if (session.getAttribute("check").equals("jjj")) {  // null request.getParameter("submit") != "" AddChoosePlant %><br />
46:          Your cart items get REMOVED SUCCESS!<br />
47:<br />
48:              </p>
<p>Stacktrace:<br />
   org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)<br />
   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:410)<br />
   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)<br />
   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)<br />
   javax.servlet.http.HttpServlet.service(HttpServlet.java:717)<br />
   org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390) 

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
chameera
Offline
Joined: 2009-06-28

well mate session.invalidate(); , Invalidates the session and unbinds any objects bound to it. and at Line 45: if (session.getAttribute("check").equals("jjj")) {
your accessing which is not there.

what's the purpose you wish to achieve by session.invalidate(); ???