advertisement
javaboutique
Search Tips
Articles  |   Tutorials  |   Reviews  |   Tools  |   by Category  |   by Date  |   by Name  |   Submit  |   Source  |   Forums  |  
javaboutique
Browse DevX


Partners & Affiliates











advertisement

CSGuestbook


CSGuestbook Readme
CoolServlets.com
Version 1.0.1
April 24, 1999

CSGuestbook is a Java Servlet that maintains a set of named guestbooks. The servlet currently runs in two different modes: DISPLAY and RECORD. In display mode, the servlet reports back a list of guestbook entries in a most recent-first order. Various servlet parameters can be used to tailor how the entries are returned. In record mode, the servlet stores a guestbook entry into one of the guestbooks.

Installation

This program requires a web server that has servlet support. Such web servers include Java Web Server by Sun, Netscape Enterprise Server, and versions of Apache. If you are not sure whether your web server has servlet support, contact your System Administrator. Various external servlet engines are also available. Of those, the servlet has been specifically tested with JRun and Apache JServ. More information about servlet environments is at http://www.coolservlets.com.

Copying Files

A few files must be copied to the correct locations in order to make the servlet run.

If you are not familiar with your web server servlet environment, it is recommended that you copy the CSInstall.class file into your servlet directory for specific directory instructions (note, delete that servlet from your servlet directory after you are done with it for security reasons). If you are familiar with your servlet environment, you can skip to the next paragraph. Your servlet directory is often named servlets/ underneath your main Web Server directory. For example, on a Windows machine with Java Web Server, the servlet directory is: c:/JavaWebServer1.1.3/servlets/. As an alternative example, using a Debian Linux system with the Apache web server and Apache JServ, the servlet directory is /usr/lib/cgi-bin/servlets/. Once you have copied CSInstall.class into the appropriate folder, you should run the servlet by calling it from a web browser:

    http://yourHost.com/servlet/CSInstall
The script will then give you detailed information about where to copy files.

You are now ready to begin copying files. First, the class files: In the dist folder of this distribution you'll find the files CSGuestbook.class, CSGuestbook.jar and a folder called com (with the subdirectory named coolservlets which holds more .class files). You should copy the CSGuestbook.class file into your servlets directory. You then have a choice of copying the com folder into your servlets directory or copying the CSGuestbook.jar file into a folder that is in the classpath of your servlet environment (for instance, on a Debian Linux system with Apache and Apache JServ, this may be /usr/share/java). Using the .jar can make your servlet run faster. However, in some cases if you do use it, you may need to shut down and restart your web server to make the servlet engine recognize the new file.

Next, you'll need to make a coolservlets/data (the name is case-sensitive) directory on your web server where your servlet engine defaults to reading files. If you don't know where this is, remember that you can use the CSInstall.class servlet to find out. In Netscape Enterprise Server, this folder is called config/. On the Java Web Server, it is the main server directory such as: c:/JavaWebServer1.1.3/ . If you have installed a CoolServlets.com Servlet in the past, you may already have a coolservlets/data folder properly setup. The coolservlets/data directory will be used to store the guest book database files. On Unix systems and other systems where read/write permissions are used, the data directory will need to be readable and writable by the user/group that the web server runs as.

Usage

Look in the demo directory of this distribution for sample uses of the servlet.

The normal use of this servlet is through direct calling of the servlet, either in a form submission, or in a link. However, it is possible to use this servlet with Server-Side Includes (SSI). For a full description of SSI and its use with servlets, consult your servlet engine or web server documentation.

The servlet operates in two modes currently: DISPLAY and RECORD mode. The following list describes the parameters available in each mode.

DISPLAY Mode
  • key - specifies the name of the guestbook to use. It's value may be a string representing name of guestbook. (default="default")
  • html - determines whether guestbook should return full HTML, or just guestbook entries (we envision the use of the SERVLET tag in the latter case). Valid values are either "on", or "off". (default="on")
  • sty - specifies the style type for printing of guestbook entries. Run the demo files to view the various style choices currently available. Valid values are either "s1", "s2", "s3", "s4", "s5". (default="s1")
  • fltr - specifies whether to filter words in the comment section; currently uses built-in list of words. The value of this parameter may be either "on" or "off". (default="off")
  • fltrlist - specifies a comma-delimited list of strings to use as the filter in the comment section. This option is only effective when fltr="on". The comma-delimited list of words overrides the built-in list of words. The filter currently only works well with words, so things like "filter this" won't work well as a filter, but unique single words like "shit" will work. Future versions will be more robust and handle more interesting filtering constraints.
  • cnt - number of entries to return (returns most recent entries). Any positive integer is valid. (default=all entries)
  • title - a string specifying the title to be used on the guestbook page. (default="Guestbook")
  • fontFace - sets the style of the font face for the document. A string representing a font face is considered valid input. (default=normal browser font face)
  • fontSize - sets the style for the font size for the document. A string representing a font size is valid. (default=normal browser font size)
  • background - uses the file name given as servlet parameter for a background image on the guestbook display page. (default=no image)
  • bgcolor - specifies the background color for the guestbook page. Any browser specified color is valid. (default=normal browser coloring)
  • text - specifies the color for normal text. Any browser specified color is valid. (default=normal browser text coloring)
  • link - specifies the color for links. Any browser specified color is valid. (default=normal browser coloring)
  • vlink - specifies the color for visited links. Any browser specified color is valid. (default=normal browser coloring)
  • alink - specifies the color for active links. Any browser specified color is valid. (default=normal browser coloring)
RECORD Mode
  • key - specifies the name of the guestbook to use. It's value may be a string representing name of guestbook. (default="default")
  • name - a form input parameter that holds a name.
  • email - a form input parameter that holds an email address.
  • url - a form input parameter that holds a url address.
  • city - a form input parameter that holds a city name.
  • state - a form input parameter that holds a state.
  • country - a form input parameter that holds a country name.
  • comment - a form input parameter (textarea) that holds the user's comment.
  • response - specifies a thank you response used when an entry has been added to the database (default="Thanks for signing our guestbook!")
  • linkBack - specifies the link to use as a return link. VALUES: any URL such as "http://www.yourhost.com", or http://www.coolservlets.com". (default=none)
  • textBack - A text string that is associated with the linkBack parameter. (default="Click Here")
  • title - a string specifying the title to be used on the guestbook page. (default="Guestbook")
  • fontFace - sets the style of the font face for the document. A string representing a font face is considered valid input. (default=normal browser font face)
  • fontSize - sets the style for the font size for the document. A string representing a font size is valid. (default=normal browser font size)
  • background - uses the file name given as servlet parameter for a background image on the guestbook display page. (default=no image)
  • bgcolor - specifies the background color for the guestbook page. Any browser specified color is valid. (default=normal browser coloring)
  • text - specifies the color for normal text. Any browser specified color is valid. (default=normal browser text coloring)
  • link - specifies the color for links. Any browser specified color is valid. (default=normal browser coloring)
  • vlink - specifies the color for visited links. Any browser specified color is valid. (default=normal browser coloring)
  • alink - specifies the color for active links. Any browser specified color is valid. (default=normal browser coloring)
Please look in the demo directory for more examples.

Problems?

We have made every effort to make this servlet easy to install and as robust as possible. If you are having problems making it work, first go back over the installation instructions and make sure you followed them exactly. If that does not fix the problem, verify that servlets are working correctly on your web server. Additional help can be found on http://www.coolservlets.com where FAQ's or discussion forums may exist for this servlet.

Bugs in the servlet can be reported to bugs@coolservlets.com. You may also send descriptions of any other problems you are having with the servlet to that address, but we cannot guarantee a reply due to our busy schedules.

If you require technical support, please see below for information about how to purchase it.

Source

The full source of the servlet be found in the src folder in this distribution. If you would like compile it, you'll need the Servlet SDK which is available on the Java website: http://java.sun.com .

Technical Support

Individuals or companies that would like technical support for this servlet can buy unlimited email tech support. A support contract can also be purchased which provides unlimited email tech support for all CoolServlets.com servlets. Please see http://www.coolservlets.com/support.html for further details.

Purchasing technical support guarantees a quick resolution to any problems you have with CoolServlets.com servlets. It is also a great way to aid the continued development of further high quality, free, open-source servlets.

License

This servlet is distributed under the GNU Public License. This means that the program is completely free (see below for legalese).

However, there are a few voluntary things that we would really appreciate: provide links back to CoolServlets.com instead of redistributing the code (this will guarantee that people will always be able to get the latest version), and send us bug reports or feature requests. Also, we encourage you to put the CoolServlets.com button somewhere on your site so that other people can find out about our free servlets. Please spread the word about CoolServlets.com!

     Copyright (C) 1999  Pete Willemsen, Matt Tucker and Bill Lynch
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.
 
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

Back to the CSGuestbook servlet page

How to Add Java Applets to Your Site

New on the Java Boutique:

New Review:

Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling API boasts simplicity, ease-of-integration, a well-rounded feature set, and it's free!

New Applet:

Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA sequences into three useful formats.

Elsewhere on internet.com:

WebDeveloper Java
Lots of Java information on webdeveloper.com

WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.

ScriptSearch Java
Hundreds of free Java code files to download.

jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.

 Microsoft RIA Development Center
 IBM Rational Resource Center
 Destination .NET
XML error: not well-formed (invalid token) at line 33
advertisement
Receive Articles via our XML/RSS feed
Receive Articles via our XML/RSS feed

JavaBytes
Internet Cyclone
This powerful, easy-to-use, internet optimizer is for Windows 95, 98, ME, NT, 2000 and XP. It's designed to automatically optimize your Windows settings, boosting your Internet connection up to 200%.

Free VMware Server 2.0 Now Release Candidate
Linux Player Xandros Grabs Storied Rival Linspire
Hey Enterprise: Here Comes the 3G iPhone
MySpace Opens Profile Portability API
Microsoft Jumps Into Virtualization Fray
Eclipse Ganymede Makes It Easier for Devs
Open Source Nokia a Threat to Microsoft, Google?
Salesforce, Google Head for 2nd on Apps
HP Open Sources Unix File System for Linux
Red Hat Opens Its Network to Space

Build a Generic Histogram Generator for SQL Server
Beyond XML and JSON: YAML for Java Developers
Mastering the Windows Mobile Emulators
Avaya AE Services Provide Rapid Telephony Integration with Facebook
Featured Algorithm: Intel Threading Building Blocks: parallel_reduce
Getting Started with Windows Live Admin Center
Eight Key Practices for ASP.NET Deployment
Java ME User Interfaces: Do It with LWUIT!
Talking VPro: Transcript
Bringing Semantic Technology to the Enterprise

Advertising Info  |   Member Services  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM eBook: Planning a Service Oriented Architecture
IBM eBook: Choosing the Right Architecture--What It Means for You and Your Business
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Avaya Article: Using Intelligent Presence to Create Smarter Business Applications
Intel Go Parallel Article: Getting Started with TBB on Windows
Microsoft Article: 7.0, Microsoft's Lucky Version?
Avaya Article: How to Feed Data into the Avaya Event Processor
IBM Article: Developing a Software Policy for Your Organization
Microsoft Article: Managing Virtual Machines with Microsoft System Center
Intel Go Parallel Article: Intel Threading Tools and OpenMP
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
HP Video: StorageWorks EVA4400 and Oracle
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Red Gate Download: SQL Toolbelt and free High-Performance SQL Code eBook
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
Silverlight 2 App and Walkthrough: Leverage Silverlight 2 with SQL Server and XML
IBM Article: Enterprise Search--Do You Know What's Out There?
HP Demo: StorageWorks EVA4400
Microsoft Article: The Progress and Promise of Deep Zoom
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES