----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

Hello,
I'm trying to session track for password verification.  I'm trying to
save information between servlets with session tracking, but my values
are not read between the servlets.  I'm trying something like what is
shown below:

+Servlet Data ---------------------------------------------
//Main file that has the program, we first check to see if the user has
logged on.
   HttpSession session = req.getSession(true);
   Object done = session.getValue("logon.isDone");
  if (done == null) {
    session.putValue("login.target",
  HttpUtils.getRequestURL(req).toString()) ;
  //login target is saved and we redirect for password verification
  res.sendRedirect(req.getScheme() + "://" + req.getServerName() + ":"
                                       + req.getServerPort() +
                                       "/servletLogin.html");
  return;
}
//rest of code here
+----------------------------------------------------

+Servlet Login Handler--------------------------------------
//login handler
//code after verifying password is ok
   HttpSession session = req.getSession(true);
  session.putValue("login.isDone", name);
  try {
            String target = (String) session.getValue("login.target");
            if (target != null)
               res.sendRedirect(target);
            return;
          }
          catch (Exception ignored) {}
          res.sendRedirect(req.getScheme() + "://" +
                           req.getServerName() + ":" +
                           req.getServerPort() +
                           "/index.html");
}
+----------------------------------------------------

I loose my login.target data and my login.isDone values between
Redirect()'s.  I have made versions that spit out the variables the
screen, and unless the  servlet that sets the variable is running at
time, the value is null.  I have searched on the web a bunch, and I
can't fiqure out whats wrong.  I'm using Red hat 6.0, Jserv1.1, and I'm
not sure what Apache version (how do I tell).  The Apache came with Red
Hat 6.0. Any help or pointers to help would be
great.

Thanks,
Krister


--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to