<%@ include file="JSP_00-Header.htm" %>

JSP_00 - first experiments with Java Server Pages

The following document contains first experiments with Java Server Pages, processed by a Gefion LiteWebServer. For a better understanding, the reader should also consider the source code of this document and the Java classes it uses.

  • File Inclusion
    the header and footer areas of this document have been included from separate files;
  • JSP Expression
    today is the <%= java.text.DateFormat.getDateInstance().format(new java.util.Date()) %>
    (the field shown above has been created by evaluation of a JSP expression)
  • JSP Declaration
    <%! int VisitCounter = 0; %> this is your <%= ++VisitCounter %>. visit of this page...
    (the visit counter has been implemented by means of a JSP declaration and a JSP expression. It will be incremented whenever this page is loaded - unless the underlying HTML document is changed or the server is restarted)
  • JSP "page" Directive
    <%@ page info="JSP_00 - first experiments with Java Server Pages" %> "<%= getServletInfo() %>"
    (this "info" message has been set by means of a JSP "page" directive)
  • JSP Bean Usage
    the following items illustrate the use of a bean from within a JSP document
    • Access to Bean Parameters
      Message = ""
      (the parameter "Message" has been set using a setProperty action and then read back using getProperty)
    • Invocation of Bean Methods
      Message = "<%= JSP_00.getMessage() %>"
      (this time the message has been obtained by directly calling the "getMessage" method of the JSP_00_Bean)
  • JSP PlugIn Action
    the following applet has been inserted by means of a JSP PlugIn "Action" <%--
    (Your browser doesn't seem to support the Java plug-in)
    --%>
<%@ include file="JSP_00-Trailer.htm" %>