This page is part of a searchable archive of the Code Style site log. Technical implementation notes that shed light on when, why and how the site has evolved since 2000.
Follow the latest entries to the site log.
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.
Actions: Ask a question about this post, seek clarification or offer a correction.
Completed the update of the font survey user agent analysis with some more recent browser versions, plus some very old ones.
Actions: Ask a question about this post, seek clarification or offer a correction.
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.
Actions: Ask a question about this post, seek clarification or offer a correction.
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.
Actions: Ask a question about this post, seek clarification or offer a correction.
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.
Actions: Ask a question about this post, seek clarification or offer a correction.
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.
Actions: Ask a question about this post, seek clarification or offer a correction.
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.
Actions: Ask a question about this post, seek clarification or offer a correction.
Updated the What is a singleton? question with a code example and added new answers to this and other FAQ sections:
Actions: Ask a question about this post, seek clarification or offer a correction.
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.
Actions: Ask a question about this post, seek clarification or offer a correction.
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.
Actions: Ask a question about this post, seek clarification or offer a correction.
Find technical implementation notes on all aspects of the Code Style site.
For a summary overview, see the annotated site log contents.