You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2001/03/10 02:27:45 UTC

[Bug 267] New - session.invalidate() method and response.sendRedirect BugRat Report#482

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=267

*** shadow/267	Fri Mar  9 17:27:45 2001
--- shadow/267.tmp.11100	Fri Mar  9 17:27:45 2001
***************
*** 0 ****
--- 1,77 ----
+ +============================================================================+
+ | session.invalidate() method and response.sendRedirect BugRat Report#482    |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 267                         Product: Tomcat 3                |
+ |       Status: UNCONFIRMED                 Version: 3.1.1 Final             |
+ |   Resolution:                            Platform: All                     |
+ |     Severity: Normal                   OS/Version: All                     |
+ |     Priority: High                      Component: Servlet                 |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: Larry.Isaacs@sas.com                                         |
+ |  Reported By: Eric.Combes@cetelem.fr                                       |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ Here is the problem I have encunter using tomcat3.1.
+ 
+ When I end the transaction with the session.invalidate() method, I call
+ the response.sendRedirect in order to send a message to the user. If I
+ try to come back into the session with the browser, I have got the same
+ message, so the same jsp file, than the one I got while ending the
+ transaction. I use the same method, response.sendRedirect, with another
+ jsp file.
+ 
+ If I use the same .class files under tomcat3.0, evething works well,
+ that is, I have got the good jsp page.
+ 
+ Here is my servlet. Notice the two differents jsp pages end.jsp and
+ out.jsp.
+ 
+ public void doPost(HttpServletRequest request, HttpServletResponse
+ response)  throws IOException
+ {
+         doGet(request, response);
+ }
+ 
+ public void doGet(HttpServletRequest request, HttpServletResponse
+ response)  throws IOException
+ {
+         HttpSession session=null;
+         TrecObject TxTrec=null;
+         try {
+                 session=request.getSession(false);
+                 if ( session == null )
+                         response.sendRedirect("/examples/jsp/trec/out.jsp");
+                                 
+                 // get the TrecObject from the session
+                 TxTrec = (TrecObject) session.getAttribute("TrecObject");
+                 if (TxTrec == null ) {
+                         response.sendRedirect("/examples/jsp/trec/out.jsp");
+                 }
+ 
+                 // previous page
+                 if ( request.getParameterValues("prev") != null ) {
+                         TxTrec.TrecTransaction.pageprecedente();
+                 
+ response.sendRedirect(response.encodeRedirectURL("/examples/jsp/trec/TREC.jsp"));
+                 // next page
+                 } else if ( request.getParameterValues("next") != null ) {
+                         TxTrec.TrecTransaction.pagesuivante();
+                 
+ response.sendRedirect(response.encodeRedirectURL("/examples/jsp/trec/TREC.jsp"));
+                 // End of the transaction
+                 } else if ( request.getParameterValues("end") != null ) {
+                         TxDisconnect(TxTrec);
+                         session.invalidate();
+                         response.sendRedirect("/examples/jsp/trec/end.jsp");
+                 }
+ 
+ 
+ Also, the method request.getSession(false), should, according the the
+ api documentation, return null if it is called after a call to the
+ session.invalidate() has been made. I have experienced a creation of a
+ new session like if I had used true instead of false for the parameters.
+ Is somethig wrong with that?
+ 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-dev-help@jakarta.apache.org