%--
* Copyright (c) 2000 David Flanagan. All rights reserved.
* This code is from the book Java Examples in a Nutshell, 2nd Edition.
* It is provided AS-IS, WITHOUT ANY WARRANTY either expressed or implied.
* You may study, use, and modify it for any non-commercial purpose.
* You may distribute it non-commercially as long as you retain this notice.
* For a commercial use license, or to purchase the book (recommended),
* visit http://www.davidflanagan.com/javaexamples2.
--%>
<%@page language='java' contentType='text/html'%> <%-- On every JSP page --%>
<%-- Specify a tag library to use in this file --%>
<%@taglib uri='http://www.davidflanagan.com/tlds/decor_0_1.tld'
prefix='decor'%>
<%-- Include the JSP code from forcelogin.jsp when this page is compiled --%>
<%-- The included file checks if the user is logged in, and if not, --%>
<%-- forwards to the login.jsp page to get a username and password. This --%>
<%-- ensures that the 'username' attribute is defined in the session. --%>
<%@include file='forcelogin.jsp'%>
<%-- Declare a new variable named 'user'. It is an instance of UserBean --%>
<%-- and it is associated with the session object. If this is a new --%>
<%-- session, then instantiate the bean and set its 'userName' property --%>
<%-- to the value of the username from the session. --%>
<%-- End of 2nd cell and the table --%>
<%-- The first cell is another box. It displays some text and the value--%>
<%-- of the 'favoriteColor' property of the 'user' bean --%>
<%-- This is the second cell of the table. It contains a form for --%>
<%-- selecting a favorite color. Note the technique used to output the --%>
<%--
<%-- The first table cell is a simple form that allows the user to logout --%>
<%-- See Logout.java
for details --%>
<%-- The second item in the box is another box that displays counts --%>
<%-- We use jsp:include twice more to invoke the Counter servlet. --%>
<%-- Note that for the 2nd inclusion, we rely on the fact that the web.xml --%>
<%-- file maps any URL ending in ".count" to the Counter servlet --%>