In this section

Site navigation below

The Code Style site has evolved by gradual refinement and accumulation of features and content. This review is part of a fully backdated site log and archive that sheds light on when, why and how particular features were implemented.

This log is sometimes updated several times per week, sometimes with a long overdue backlog of items. Many log entries refer to the Code Style Java package that delivers the servlet services and utilities used to manage this site.

Subscribe to the news feed for this log: RSS news feed

Reverse chronology

Proxied access log valve for Tomcat, 25th June 2005

Created a Tomcat ProxiedAccessLogValve based on the standard Apache AccessLogValve to record the original client IP address, rather than the proxies' address. Implemented by refactoring calls to the HttpServletRequest getRemoteAddr method through the getClientIp method below:

private final String getClientIp(final ServletRequest request) {

  try {

    HttpServletRequest httpRequest = (HttpServletRequest) request;

    String forwardedIp = httpRequest.getHeader("X-Forwarded-For");

    if (forwardedIp != null) {

      return forwardedIp;
    }
    else {

      return request.getRemoteAddr();
    }
  }
  catch (ClassCastException cce) {

    return request.getRemoteAddr();
  }
}
      

Testing the access log valve required a deployment of the Code Style EchoRequest servlet with a new BasicXhtmlTemplate.

More font survey client versions, 24th June 2005

Completed the update of the font survey user agent analysis with some more recent browser versions, plus some very old ones.

Switch news feeds to Metacentric, 23th June 2005

Switched all Code Style news and metadata feed links over to the new Metacentric service and deployed redirection servlets in place of the local versions of the transformers. The redirection servlets copy over all servlet parameters, add the vital siteID parameter, and issue HTTP 301, moved permanently, and Location headers.

Identified a case in the XHTMLtoRSS XSL that was introducing unnecessary new lines into item titles in Fragments mode. The xsl:apply-templates selection required a normalize-space function call to process the element content.

Metacentric news feed service launched, 22th June 2005

Launched the Metacentric news feed and metadata service. This service generates RSS news feeds that can be added to standard HTML Web pages quickly and easily. The service uses the RSS transformer servlets, XSLs and cache system developed through the Code Style Java project. Special thanks to the team of Code Style readers and many others who provided invaluable feedback during the lengthy development process.

Standard news feed processing, 20th June 2005

Completed version 2.0 release testing for the XHTMLtoRSS XSL transformer, making various corrections in progress. Modified the $maximum-limits variable formulation so that a limit of less than 15 items can be set in RSS 0.9 compatibility mode. Added explicit TOC class selector for table of contents mode item content. Restored compatibility mode truncation of item descriptions in TOC, Links and Fragments mode. Changed the selection scheme for fragment anchor table caption elements; xsl:apply-templates is called on the ancestor table. Removed unnecessary normalize-space function calls on applet, img and area alt attributes, object standby attributes and table summary attributes.

Extended the new container element processing scheme to the XHTMLtoJS and XHTMLtoDemo XSL templates for Javascript and HTML demonstration output respectively. Identified a special case with HTML ul and ol elements and li elements, which take flow type content. Added these elements, plus the deprecated dir and menu elements to the grandchild selection branch of the template, with tr elements.

Added the SearchAndReplace XSL template to various XHTMLtoDemo template sections to escape literal quotes to entities.

XHTML to RSS transformer item limit, 20th June 2005

Added an $item-limit parameter to the XHTMLtoRSS XSL and introduced a new $maximum-items variable formulation. Removed the link between RSS 0.9 compatibility mode and $maximum-items for all item output, so that the number may be limited for RSS 1.0 output too. Brought most container element processing into a single recursive template to handle nested block level and flow type content. Removed separate dl, object, applet, form, map noscript, table templates and added pre to the group of elements for which the next sibling is processed.

CSS user agent update, 12th June 2005

Updated the SQL browser analysis script for the Code Style font survey to record new browser versions. The browser table had not been updated for several months, so some older versions were recorded for the first time.

New FAQ answers, 5th June 2005

Updated the What is a singleton? question with a code example and added new answers to this and other FAQ sections:

Font survey

HTML & XHTML

Java I/O

Java language

Site design

Site manager

dcterms:modified correction, 3rd June 2005

Feed Validator checks showed that the ParseRSS XSL transformation servlet was generating empty dcterms:modified elements from source documents that use DCTERMS.modified meta elements. The problem did not exist with documents that used the old style DC.Date.modified labels.

Added a W3CDTF last-modified parameter to the private JAXP test servlet to debug the XHTMLtoRSS template. Quickly discovered the problem was in the DCElementsRSS template, where there was incorrect nesting of element output with processing logic. An element was being generated in a fallback case where the logic meant that no content was added to it.

XML object loader, 2rd June 2005

Changed the catch clause in the AbstractXmlObject loadObject method to a generic Exception type to handle MalformedURLException cases wrapped in a SAXException, not thrown directly. These exceptions arise in test cases with null XML source references. Now all cases are re-thrown as IOException.

Previously on Code Style

These backdated pages record detailed changes to the Code Style Web site since July 2000, when development first got underway. Some pages may refer to documents or features that have since changed or are no longer part of the site, but the archive is checked to ensure there are no dead links.

Add this page to your chosen social bookmarking service

Style warning - please read

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