Project

General

Profile

« Previous | Next » 

Revision 3211

Added by berkley about 17 years ago

adding changes to make paged query results possible

View differences:

MetaCatServlet.java
562 562
                // aware of session expiration on every request
563 563
            } else {
564 564
                HttpSession sess = request.getSession(true);
565
                logMetacat.info("session.isnew: " + sess.isNew() + "    params.hassessid: " + params.containsKey("sessionid"));
565 566
                if (sess.isNew() && !params.containsKey("sessionid")) {
566 567
                    // session expired or has not been stored b/w user requests
567 568
                    logMetacat.info(
568 569
                            "The session is new or no sessionid is assigned. The user is public");
569 570
                    username = "public";
570 571
                    sess.setAttribute("username", username);
572
                    sess_id = (String)sess.getId();
573
                              sess.setAttribute("sessionid", sess_id);
574
                    sessionHash.put(sess_id, sess);
571 575
                } else {
572 576
                    logMetacat.info("The session is either old or "
573 577
                            + "has sessionid parameter");
......
582 586
                                sess = (HttpSession) sessionHash.get(sess_id);
583 587
                            }
584 588
                        } else {
585
                            // we already store the session in login, so we
586
                            // don't need here
587
                            /*
588
                             * logMetacat.info("in no sessionid
589
                             * parameter ", 40); sess_id =
590
                             * (String)sess.getId();
591
                             * logMetacat.info("storing the session id "
592
                             * + sess_id + " which has username " +
593
                             * sess.getAttribute("username") + " into session
594
                             * hash in handleGetOrPost method", 35);
595
                             */
589
                          //this makes sure there is a session object for public sessions
590
                          sess_id = sess.getId();
591
                          sessionHash.put(sess_id, sess);
596 592
                        }
597 593
                    } catch (IllegalStateException ise) {
598 594
                        logMetacat.error(
......
608 604
                    groupnames = (String[]) sess.getAttribute("groupnames");
609 605
                    name = (String) sess.getAttribute("name");
610 606
                }
607
                
608
                logMetacat.info("&*&*&*&*&*&*&*&*&*&*&*&*&*&*&&*&*SESSIONID1: " + sess_id);
611 609

  
612 610
                //make user user username should be public
613 611
                if (username == null || (username.trim().equals(""))) {

Also available in: Unified diff