AFAIK, Tomcat saves sessions across restarts. One of the gurus may have the specific answer as to how you can disable this, I believe it has something to do with whether your session attributes are serializable or not.


You can just clear out the work directory between restarts. My shutdown scripts have a "rm -rf $CATALINA_HOME/work/*" in them so that it is done automatically. This can cause a slow startup, since Tomcat has to recompile JSP again when they are accessed, but I restart Tomcat so rarely (maybe 2-3 times a year) that it really doesn't affect my instances all that much.

John

Sarika Inamdar wrote:

Hi All,

When we start tomcat and connect to the server, the index.jsp page is
displayed . When I key in a password, it validates the password and goes
to the next jsp page(login.jsp)

I stop tomcat and restart it again. Now when I connect to the server,
the index.jsp directly takes me to the login.jsp page without asking for
password. This should not happen. Everytime the tomcat is stopped 'n
started we should get the password validation.

But when I stop tomcat and clear the contents of
$CATALINA_HOME/work/StandAlone/,
When tomcat is started, it displays the index.jsp which asks for
password validation.

This behaviour was not seen in tomcat 3.2.3.

Please let me know if am missing something.  Am attaching the code
snippet of index.jsp and validateLogin.jsp which is called from
index.jsp

Thanks in Advance for the help,
Sarika


Here is code snippet of index.jsp :


%@ include file="header.jsp" %>
<%@ include file="validateLogin.jsp" %>

<%@ page import="com.cisco.das.core.*" %>

<b>Home</b>
<br>Host: <%= InetAddress.getLocalHost() %>
<br>Current time: <%= new Date() %>

<%
        try {
          String s = DAS.status();
          ByteArrayInputStream bs = new
ByteArrayInputStream(s.getBytes());

          Properties prop = new Properties();
          prop.load(bs);

out.println("<br>Status: Running");

          out.println("<br>CNS name: " + prop.getProperty("name"));
          out.println("<br>CNS group: " + prop.getProperty("group",
""));

          out.println("<br>Start time: " +
                      new
Date(Long.parseLong(prop.getProperty("startTime"))
));
          out.println("<br>Version: " +
prop.getProperty("package.version"));
          out.println("<br>Build date: " +
prop.getProperty("package.date"));

          %>
          <br>
          <br>
          <form method="post" action="stop.jsp">
            <input type="submit" value="Stop process">
          </form>
          <%
        } catch (Exception e) {
         out.println("<input type=\"hidden\" name=\"debug\" value=\"" +
e.toStr
ing() + "\">");

          String configdir = System.getProperty("user.dir") + "/config";
          File pidFile = new File(configdir, "pid");
          if (pidFile.exists()) {
            out.println("<br>Status: Initializing...");
            %>
            <br>
            <form method="post" action="stop.jsp">
              <input type="submit" value="Stop Process">
            </form>
            <%
          }
          else {
            out.println("<br>Status: Stopped");
            %>
            <br>
            <form method="post" action="start.jsp">
              <input type="submit" value="Start process">
            </form>
            <%
          }
        }
%>

<%@ include file="footer.jsp" %>

Snippet of validateLogin.jsp :

<%
    String value = (String)session.getValue("das.login");
    if (value == null) {
%>
Login password:
<form method="post" action="login.jsp?url=<%= request.getServletPath()
%>" name=
"login">
    <input type="password" size="20" name="password">
    <input type="submit" value="submit">
</form>
<%
        return;
    }
%>


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to