JSPs @ palmdrive

How to install

Nothing is simpler than that. Just download the ZIP file and extract the two files (guestBook.jsp, guestBook.css) in your webserver repository. You then just need to specify where the guest book jsp should store the messages. Open guestBook.jsp in your favorite text aditor and modify the line (on top of the JSP file):
    public static final String DIR = "C:\\";
  
To hold the directory in which you want the guest book to store the messages. All the messages are stored in a file called guestBook.txt.
For example, if you want the guest book to store the file in "C:\gb\messages", Just replace the above line with:
    public static final String DIR = "C:\\gb\\messages\\";
  
Tip: Don't forget the "\\" at the end of the directory name. The final filename will be built by a simple concatenation of the DIR String with the String "guestBook.txt". Therefore, if you specify "C:\\gb\\messages" as the DIR String, the final file created will be C:\gm\messagesguestBook.txt.

Basic configuration

Ths configuration for the guestBook.jsp is included in the first lines of the file. Just open the JSP in your favorite text editor and look at the first section. All the attributes you can change are described below.
    public static final String DEFAULT_LANG = "us";
  

This field indicates wether or not the user is going to look at the guest book in english or french the first time he/she reach the page. In the current implementation, only "us" and "fr" languages are included with the JSP.

    public static final String DATE_FORMAT = "EEE, d MMM yyyy";
This field indicates the format the dates should be displayed on. The current implementation uses a SimpleDateFormat class to do the formatting. Here is a description of all the characters you can use in the DATE_FORMAT String:
    Symbol   Meaning                 Presentation        Example
    ------   -------                 ------------        -------
    G        era designator          (Text)              AD
    y        year                    (Number)            1996
    M        month in year           (Text & Number)     July & 07
    d        day in month            (Number)            10
    h        hour in am/pm (1~12)    (Number)            12
    H        hour in day (0~23)      (Number)            0
    m        minute in hour          (Number)            30
    s        second in minute        (Number)            55
    S        millisecond             (Number)            978
    E        day in week             (Text)              Tuesday
    D        day in year             (Number)            189
    F        day of week in month    (Number)            2 (2nd Wed in July)
    w        week in year            (Number)            27
    W        week in month           (Number)            2
    a        am/pm marker            (Text)              PM
    k        hour in day (1~24)      (Number)            24
    K        hour in am/pm (0~11)    (Number)            0
    z        time zone               (Text)              Pacific Standard Time
    '        escape for text         (Delimiter)
    ''       single quote            (Literal)           '
 

Here are some examples of date format strings:
   Format Pattern                         Result
   --------------                         -------
   "yyyy.MM.dd G 'at' hh:mm:ss z"    ->>  1996.07.10 AD at 15:08:56 PDT
   "EEE, MMM d, ''yy"                ->>  Wed, July 10, '96
   "h:mm a"                          ->>  12:08 PM
   "hh 'o''clock' a, zzzz"           ->>  12 o'clock PM, Pacific Daylight Time
   "K:mm a, z"                       ->>  0:00 PM, PST
   "yyyyy.MMMMM.dd GGG hh:mm aaa"    ->>  1996.July.10 AD 12:08 PM

These examples were taken directly from the SimpleDateFormat javadoc.
This config should be moved soon in the language package.

    public static final String ADMIN_EMAIL = null;
If ever there's a problem in the initialization of the Guest Book, an error message will be displayed with this email as the person to contact. If null, no email will be displayed.

    public static final String ADMIN_PWD = "foo";
This defines the password for the administrator. Everyone that knows this password will be able to delete any message from the guest book. In the safe mode (see below), this password will also be used to approve new messages.

    public static final String ADMIN_NOTIFICATION_EMAIL = null;
Each time someone leave a message in the guest book, an email will be sent to this email address, notifying this person of the message being posted. If null, no email message is being sent.

    public static final String SMTP_SERVER = "my.smtp.server.com";
In order to be able to send email notifications, this variable must be set to a valid smtp server name (or IP address). If null, no notification message is being sent.

    public static final String NOTIFICATION_EMAIL_SUBJECT = "New guest book entry";
This string represent the subject of the notification email. Usefull if you handle several guest books and want to be able to distinguish between the two notification emails.

    public static final boolean AUTO_APPROVE_MESSAGES = true;
If set to true, any message that is being submitted by a user will be visible by all the users. If set to false, a user will not see his/her message until the admin did approve it. This is what I call the "Safe Mode".

    public static final int PAGE_SIZE = 10000;
This feature is not yet fully implemented, don't touch this parameter.

Download

Download the Version 1.0 here. Beware! This file is so big (7kb) that it could take up to 3 seconds with a 28.8 modem!