<!-- Enhydra Java Application Server Copyright 1997-1999 Lutris Technologies, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes Enhydra software developed by Lutris Technologies, Inc. and its contributors. 4. Neither the name of Lutris Technologies nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY LUTRIS TECHNOLOGIES AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LUTRIS TECHNOLOGIES OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> <JDDI JAVAIMPORT> import com.lutris.http.*; import com.lutris.appserver.server.session.*; import demoApp.presentation.utilities.*; </JDDI> <JDDI INCLUDE="../jinc/Setup.jinc"></JDDI> <JDDI JAVADEF> public void HomePage(JoltPage page) throws Exception { /*** * Login in if not already logged in. Session is auto-allocated. ***/ SessionUtils.authenticate(page); PageUtils.handlePreviousForm(page.session, page.data); String username = page.session.getUser().getName(); page.data.set("username", username); } </JDDI> <JDDI JAVACALL=HomePage></JDDI> <HTML> <HEAD> <TITLE>JDDI HTML Example: Home Page</TITLE> </HEAD> <JDDI INCLUDE="../jinc/Header.jinc"></JDDI> <BODY> <CENTER> <B><FONT FACE="Arial,Helvetica" SIZE=+3> Home Page </FONT></B> </CENTER> </BODY> <JDDI INCLUDE="../jinc/Buttons.jinc"></JDDI> <BODY> <BR> <JDDI HTML IFEQ FIELD=cgiArgs.help VALUE="on"> <CENTER> <TABLE COLS=1 WIDTH="40%" > <TR> <TD> <FONT FACE="Arial,Helvetica" COLOR=red> Your username is displayed below using JDDI fields. This JDDI field is set for your session once you log in. </FONT> <CENTER><IMG SRC="../media/arrow.gif" BORDER=0 ANCHOR=BOTTOM></CENTER> </TD> </TR> </TABLE> </CENTER> </JDDI> <CENTER> <FONT FACE="Arial,Helvetica" SIZE=+2> <B>Welcome (@username@) !</B><P> </FONT> </CENTER> <CENTER> <TABLE COLS=1 WIDTH="60%"> <TR> <TD> <FONT FACE="Arial,Helvetica" SIZE=+1> You are now authenticated, and have a valid session. Below is a list of the available demonstration Applications. </FONT> </TD> </TR> </TABLE> </CENTER> <BR> <TABLE COLS=2 WIDTH="100%"> <TR> <TD ALIGN=CENTER WIDTH="30%"> <FONT FACE="Arial,Helvetica" SIZE=+2> <A HREF="JDDIFields.po">JDDI Fields</A> </FONT> </TD> <TD> (JDDIField use and various other useful concepts) </TD> </TR> <TR> <TD ALIGN=CENTER WIDTH="30%"> <FONT FACE="Arial,Helvetica" SIZE=+2> <A HREF="RestrictedPage.po">Restricted Page</A> </FONT> </TD> <TD> (Session authentication by checking for a valid sesssion cookie) </TD> </TR> <TR> <TD ALIGN=CENTER WIDTH="30%"> <FONT FACE="Arial,Helvetica" SIZE=+2> <A HREF="SessionDataExample.po">Session Data</A> </FONT> </TD> <TD> (Session persistent data) </TD> </TR> <TR> <TD ALIGN=CENTER WIDTH="30%"> <FONT FACE="Arial,Helvetica" SIZE=+2> <A HREF="UserDBQuery.po">Database Query</A> </FONT> </TD> <TD> (Database query via the UserManager business object) </TD> </TR> <TR> <TD ALIGN=CENTER WIDTH="30%"> <FONT FACE="Arial,Helvetica" SIZE=+2> <A HREF="FormUpload.po">Form Upload</A> </FONT> </TD> <TD> (Sample uploads of files and text input fields) </TD> </TR> <TR> <TD ALIGN=CENTER WIDTH="30%"> <FONT FACE="Arial,Helvetica" SIZE=+2> <A HREF="CookieExample.po">Setting Cookies</A> </FONT> </TD> <TD> (Setting cookies, and the "request" and "response" objects) </TD> </TR> <TR> <TD ALIGN=CENTER WIDTH="30%"> <FONT FACE="Arial,Helvetica" SIZE=+2> <A HREF="../login/Login.po">Login</A> </FONT> </TD> <TD> (Takes you back to the Login page) </TD> </TR> <TR> <TD ALIGN=CENTER WIDTH="30%"> <FONT FACE="Arial,Helvetica" SIZE=+2> <A HREF="../login/Logout.po">Logout</A> </FONT> </TD> <TD> (Shows what happens when you logout) </TD> </TR> </TABLE> <BR> <JDDI INCLUDE="../jinc/VerboseDebug.jinc"></JDDI> </BODY> </HTML>