Site navigation below

In this section

Place your text ad here.

Web hosting directory, find affordable web hosting

Dedicated Server Hosting and Reseller Web Hosting

Data recovery software tools & file recovery utilities to recover lost data

WestNIC provides reliable web hosting services

Brand Protection

SGD Networks offers Web Hosting, Web Hosting Hyderabad

Award Winning PST Repair and Mail Recovery Software

Mortgage Calculator

Java servlets are used to deliver some of the key features of the Code Style Web site. This article briefly introduces each, with hyperlinks to working examples throughout the site.

Font sampler

The FontSampler servlet that sits behind the Code Style font sampler section is an example of a lightweight Java servlet fulfilling a typical CGI function. This class accepts a limited number of query parameters that are used to present standing text with CSS rules for named fonts, or to display an image of the named font.

Anchor Points

The AnchorPoints class is a simple redirection servlet used throughout the Code Style site to log the most frequently used outbound links. The ultimate destination URL is passed to the servlet as a query parameter, and uses an HTTP 302 Found response to forward requests. See the Anchor Points: Java & servlets for working examples.

View source

The ViewSource servlet returns a selected Javascript or CSS source file with the content type text/plain to avoid problems with some browsers that would otherwise attempt to execute the script or hand-off these file types to helper applications. The addition of a number=true request parameter adds line numbering to the output.

This content type conversion allows the source links in the Javascript FAQ to be viewed in the main browser window, for instance.

View sequence

ViewSequence is a servlet that shows a numbered sequence of image files with custom page titles and navigational links. All pages are generated dynamically from parameters passed in the initial request and include links to advance to the original article. See Apache JServ on Windows 95 for examples of this servlet.

Echo request

The EchoRequest servlet generates HTML tables that list the HTTP headers and parameters sent by Web browsers. This servlet can be used for debugging HTML form submissions and browser issues, it reflects whatever request data is sent.

Article feedback

Your comments on this article will be appreciated, please use the form below to submit your views. If you would like a reply or article update notification, include your email address.

Information: Your email address will not be mis-used. If you include your address you may be sent a personal reply, you will not be added to any mailing list unless you request update notification. Read the site privacy statement for details.

Add this page to your chosen social bookmarking service

Style warning - please read

Home · CSS · Java · Javascript · HTML · Help · Log