[opencms-dev] Log on form - need help

alicewin at collegeclub.com alicewin at collegeclub.com
Fri Sep 5 04:46:01 CEST 2003


 Hello,

 I want to have a log on form on the website.
 It will be on all pages until user logs in.
 Another form (log out ) will replace the log-on form.

 Because I want to display the same content (before and after logging), I don't know how to realize it in Opencms.

 I wrote a jsp template to control the form (for log on and log out). 
But after creating a new page with that template, always the log-on form displays. I really don't know why the jsp template doesn't recognize the parameters.
It maybe because my experience on jsp is less.

 Please help me.
 If anyone has experience on JSP and HTML please guide me how to control the log form.

 I greatly appreciate your helps.

Here is a peace of jsp template code:
<!-- Logging form-->

 <FORM action="index.html" method=get name="log">
<%
        // For the first load
	if (request.getParameter("action") == null) 
	{
%>
    <TABLE cellSpacing=0 cellPadding=2 width="140">
      <CAPTION></CAPTION>
        <TR>
          <TD bgColor=#CCCCCC><B><FONT size=-1>Login</FONT></B></TD></TR>
        <TR>
          <TD align=left>
                     <FONT color=#ffffff>Login Name: </FONT>
                     </FONT></FONT></TD></TR>
        <TR>
          <TD align=left>
                     <INPUT size=13 name=username value="" style="WIDTH: 120px; HEIGHT: 22px"> </TD></TR>
        <TR>
          <TD align=left>
                     <FONT color=#ffffff>Password:</FONT></TD></TR>
        <TR>
          <TD align=left>
                     <INPUT type=password size=13 name=password value="" style="WIDTH: 100px; HEIGHT: 22px"> </TD></TR>
        <TR>
          <TD align=center>
           <FONT face=arial,helvetica><FONT size=-1>
                     <INPUT type=submit value=Logon name=action><BR></FONT></FONT></TD></TR>

      </TABLE>

<%	}
	else if (!(request.getParameter("action") == null)) { //

            String action=request.getParameter("action");
%>

<%
	if (action.compareTo("Logon")==0) {

          String username=request.getParameter("username");
          String password=request.getParameter("password");
%>
   <INPUT type=hidden value=<%=username%> name=login>
    <TABLE cellSpacing=0 cellPadding=2 width="140">
      <CAPTION></CAPTION>
        <TR>
          <TD bgColor=#CCCCCC><B><FONT size=-1></FONT></B></TD></TR>
        <TR>
          <TD align=left>
                     <FONT color=#ffffff> </FONT>
                     </FONT></FONT></TD></TR>
        <TR>
          <TD align=left>
                     WELCOME <%=username%> </TD></TR>
        <TR>
          <TD align=center>
           <FONT face=arial,helvetica><FONT size=-1>
                     <INPUT type=submit value=Logout name=action><BR></FONT></FONT></TD></TR>

      </TABLE>

<%
        }
 	else if (action.compareTo("Logout")==0) {
%>
    <TABLE cellSpacing=0 cellPadding=2 width="140" >
      <CAPTION></CAPTION>
        <TR>
          <TD bgColor=#CCCCCC><B><FONT size=-1>Login</FONT></B></TD></TR>
        <TR>
          <TD align=left>
                     <FONT color=#ffffff>Login Name: </FONT>
                     </FONT></FONT></TD></TR>
        <TR>
          <TD align=left>
                     <INPUT size=13 name=username value="" style="WIDTH: 120px; HEIGHT: 22px"> </TD></TR>
        <TR>
          <TD align=left>
                     <FONT color=#ffffff>Password:</FONT></TD></TR>
        <TR>
          <TD align=left>
                     <INPUT type=password size=13 name=password value="" style="WIDTH: 100px; HEIGHT: 22px"> </TD></TR>
        <TR>
          <TD align=center>
           <FONT face=arial,helvetica><FONT size=-1>
                     <INPUT type=submit value=Logon name=action><BR></FONT></FONT></TD></TR>

      </TABLE>


<%
 	}

     }
%>
</FORM>
 



-------------------------------------------------------------------------- 
CollegeClub.com is ready for Back to School! Enter the Caption Contest, get advice or see the 'Old School' Flipbook.  
http://navisite.collegeclub.com/backtoschool2003


More information about the opencms-dev mailing list