tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sarika Inamdar " <sinam...@cisco.com>
Subject Behaviour of JSP with tomcat 4.1.24
Date Wed, 06 Aug 2003 05:15:31 GMT
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;
    }
%>


Mime
View raw message