<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>blog.stringtree.org</title>
	<atom:link href="http://blog.stringtree.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.stringtree.org</link>
	<description>Stringtree Development News</description>
	<lastBuildDate>Wed, 01 Oct 2008 14:21:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<!-- podcast_generator="podPress/8.8" - maintenance_release="8.8.3" -->
		<copyright>2006-2007 </copyright>
		<managingEditor>blog@stringtree.org (Frank Carver)</managingEditor>
		<webMaster>blog@stringtree.org (Frank Carver)</webMaster>
		<category>posts</category>
		<ttl>1440</ttl>
<br />
<b>Warning</b>:  htmlentities() expects at most 3 parameters, 4 given in <b>/home/string4/public_html/blog/wp-content/plugins/podpress/podpress_feed_functions.php</b> on line <b>31</b><br />
		<itunes:keywords></itunes:keywords>
<br />
<b>Warning</b>:  htmlentities() expects at most 3 parameters, 4 given in <b>/home/string4/public_html/blog/wp-content/plugins/podpress/podpress_feed_functions.php</b> on line <b>31</b><br />
		<itunes:subtitle></itunes:subtitle>
<br />
<b>Warning</b>:  htmlentities() expects at most 3 parameters, 4 given in <b>/home/string4/public_html/blog/wp-content/plugins/podpress/podpress_feed_functions.php</b> on line <b>31</b><br />
		<itunes:summary></itunes:summary>
		<itunes:author>Frank Carver</itunes:author>
		<itunes:category text="Technology">
	<itunes:category text="Software How-To"/>
</itunes:category>
		<itunes:owner>
			<itunes:name>Frank Carver</itunes:name>
			<itunes:email>blog@stringtree.org</itunes:email>
		</itunes:owner>
		<itunes:block>No</itunes:block>
		<itunes:explicit>no</itunes:explicit>
		<itunes:image href="http://stringtree.org/images/lawnchair-300.jpg" />
		<image>
			<url>http://stringtree.org/images/lawnchair-144.jpg</url>
			<title>blog.stringtree.org</title>
			<link>http://blog.stringtree.org</link>
			<width>144</width>
			<height>144</height>
		</image>
		<item>
		<title>Merging of Blogs</title>
		<link>http://blog.stringtree.org/2008/10/01/merging-of-blogs/</link>
		<comments>http://blog.stringtree.org/2008/10/01/merging-of-blogs/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 14:06:21 +0000</pubDate>
		<dc:creator>Stringtree</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Site News]]></category>
		<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://blog.stringtree.org/?p=29</guid>
		<description><![CDATA[A few months ago I started a new blog as somewhere to record general links and discussion of wider software development and other issues. As time has progressed, that blog has become very busy and a virtual centre for my blogging activity, leaving little time to manage this one. I have tried to run both [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago I started <a href="http://blog.punchbarrel.com/">a new blog</a> as somewhere to record general links and discussion of wider software development and other issues. As time has progressed, that blog has become very busy and a virtual centre for my blogging activity, leaving little time to manage this one. I have tried to run both this Stringtree development blog and the new one in parallel. This has proved problematic when posts are potentially appropriate to both. </p>
<p>For the last month or so I have tried the approach of automatically cross-posting Stringtree articles on both blogs, but this has resulted in some confusion and a potential splitting of comments. I no longer feel that this is a valid way to progress. </p>
<p>My plan, therefore is to &#8220;deprecate&#8221; this blog, and post all future Stringtree updates only on <a href="http://blog.punchbarrel.com/">blog.punchbarrel.com</a>. I would naturally hope that some of the other posts might also be of interest, but if you only wish to see Stringtree-related posts, you may view <a href="http://blog.punchbarrel.com/category/stringtree/">just that category</a>.</p>
<p>At some point over the next few months I will ensure than all the existing posts from this blog are transferred to the new one, and disable comments etc. here. If you have subscribed to this blog using a feed reader or feed-converter, please update your subscription to http://blog.punchbarrel.com/feed/</p>
<p>I think the effort will be worth it. There are some exciting things planned for Stringtree software over the next year!</p>
<p>Thanks,<br />
Frank.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stringtree.org/2008/10/01/merging-of-blogs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java 6 breaks JDBC</title>
		<link>http://blog.stringtree.org/2008/09/23/java-6-breaks-jdbc/</link>
		<comments>http://blog.stringtree.org/2008/09/23/java-6-breaks-jdbc/#comments</comments>
		<pubDate>Tue, 23 Sep 2008 10:36:40 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[compatibility]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[Java 1.4]]></category>
		<category><![CDATA[Java 5]]></category>
		<category><![CDATA[Java 6]]></category>
		<category><![CDATA[JDBC]]></category>
		<category><![CDATA[Wrapper]]></category>

		<guid isPermaLink="false">http://blog.stringtree.org/?p=27</guid>
		<description><![CDATA[I&#8217;m cross. Very cross. Cross with Sun for releasing a new version of Java which shatters both backward- and forward- compatibility. Cross enough that I cannot see any sensible way of moving my software to Java 6 in the near future.
It all started with an innocuous question in a comment on my Punchbarrel blog. I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m cross. <strong>Very</strong> cross. Cross with Sun for releasing a new version of Java which <em>shatters</em> both backward- <em>and</em> forward- compatibility. Cross enough that I cannot see any sensible way of moving my software to Java 6 in the near future.</p>
<p>It all started with an innocuous question in a <a href="http://blog.punchbarrel.com/2008/09/21/is-it-time-for-java-5/#comment-196">comment on my Punchbarrel blog</a>. I had posted asking for opinions on a move to Java 5, potentially abandoning Java 1.4, for the core Stringtree codebase. The question in the comment was about skipping Java 5 and moving directly to Java 6. This would normally be too big a leap, but I replied that I would endeavour to continue my policy of ensuring my code works with as wide a range of Java versions as possible.</p>
<p>Then I actually tried to do it, and that&#8217;s what made me cross. The more I attempted to produce code which would compile and run on Java 1.4, Java 5 and Java 6, the more impossible it began to seem.</p>
<p>I was already aware of the first hurdle. Sun have <a href="http://weblogs.java.net/blog/lancea/archive/2006/02/jdbc_40_wrapper.html">added new methods to a lot of key JDBC interfaces</a> by tagging them with the new <a href="http://java.sun.com/javase/6/docs/api/java/sql/Wrapper.html">javax.sql.Wrapper</a> interface. This is actually relatively easy to fix in a compatible way. Just add two new methods to each class which implements one of the affected JDBC interfaces:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p27code2'); return false;">View Code</a> JAVA</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p272"><td class="code" id="p27code2"><pre class="java" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> isWrapperFor<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">Class</span> clz<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Object</span> unwrap<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">Class</span> clz<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">SQLException</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">SQLException</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Not a Wrapper for &quot;</span> <span style="color: #339933;">+</span> clz<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The actual method signatures in the Java 6 Wrapper interface are phrased in terms of Generics, but the above stripped version compiles fine using Java 1.4, Java 5 and Java 6 compiler and libraries.</p>
<p>However, even after adding these arguably pointless methods to all my concrete implementations of affected JDBC interfaces, I still had a bunch of compilation errors when using Java 6 libraries. And this is where Sun have really screwed up.</p>
<p>Several other key JDBC interfaces have also been extended. But this time it has not been done by anything as simple as tagging with a new interface. These interfaces have all gained extra method themselves. This should not be a deal-breaker. It should be feasible to just add implementations of these methods to the existing Java 1.4-compatible code. After all, any class is free to define any methods it likes, not just those from an interface.</p>
<p><strong>Nope.</strong></p>
<p>It is simply impossible to add these new methods to a class and have that class still compile in a Java 1.4 or Java 5 environment. </p>
<p>The reason is that these methods are themselves defined in terms of classes and interfaces which do not exist in earlier Java versions. For example, the <a href="http://java.sun.com/javase/6/docs/api/java/sql/Connection.html">java.sql.Connection interface</a> gains methods referring to new interfaces <a href="http://java.sun.com/javase/6/docs/api/java/sql/NClob.html">NClob</a> and <a href="http://java.sun.com/javase/6/docs/api/java/sql/SQLXML.html">SQLXML</a></p>
<p>There is no answer to this. Sun have broken backward and forward compatibility of JDBC in Java 6. It is no longer possible to write an implementation of several key JDBC interfaces in a way which compiles under all the most popular Java versions.</p>
<p>Once again, Sun completely misunderstands the real world. Not everyone is free to upgrade every deployment to the very latest Java version immediately it is released. Even within those who do manage to update all their machines in one go, not everyone can immediately drop real work to spend time messing with old code <strong>which should still work</strong> to bring it into line with a new fashion.</p>
<p>As I wrote at the start of this rant. I&#8217;m cross.  </p>
<p>Grrr.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stringtree.org/2008/09/23/java-6-breaks-jdbc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is it time for Java 5?</title>
		<link>http://blog.stringtree.org/2008/09/20/is-it-time-for-java-5/</link>
		<comments>http://blog.stringtree.org/2008/09/20/is-it-time-for-java-5/#comments</comments>
		<pubDate>Sat, 20 Sep 2008 19:59:00 +0000</pubDate>
		<dc:creator>Stringtree</dc:creator>
				<category><![CDATA[Friki]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[HTTPClient]]></category>
		<category><![CDATA[Inkling]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Mojasef]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Templater]]></category>
		<category><![CDATA[autoboxing]]></category>
		<category><![CDATA[enum]]></category>
		<category><![CDATA[generics]]></category>
		<category><![CDATA[iterable]]></category>
		<category><![CDATA[Java 1.4]]></category>
		<category><![CDATA[Java 5]]></category>
		<category><![CDATA[varargs]]></category>

		<guid isPermaLink="false">http://blog.stringtree.org/?p=25</guid>
		<description><![CDATA[A major goal of the Stringtree software project has always been to be as compatible as possible with all the software people are using for their Java development. Naturally that also includes whatever Java version is being used.
For a long time I interpreted this goal as implying that all Stringtree code should run on all [...]]]></description>
			<content:encoded><![CDATA[<p>A major goal of the Stringtree software project has always been to be as compatible as possible with all the software people are using for their Java development. Naturally that also includes whatever Java version is being used.</p>
<p>For a long time I interpreted this goal as implying that all Stringtree code should run on all Java versions from Java 1.2 onwards. Java 1.4, however, introduced some compelling new features including built-in regular-expression handling. For a few years I still tried to ensure that most code was still 1.2-compatible (for example by using Ant to swap in a third-party regular-expression library while building a jar file), while also providing a Java 1.4 version. Eventually, use of Java versions prior to 1.4 declined enough that I felt comfortable removing the complicated pre-1.4 version.</p>
<p>For the last few years I have been very careful to keep all my Stringtree code compatible with all versions of Java from 1.4 upwards. Now, however, the pressure is building again to move over to Java 5. In my day-to-day coding I develop with Java 5 and make increasing use of Java 5 features such as the enhanced for loop, the Iterable interface, enums, generics, autoboxing, varargs and so on. It would be very nice to be able to update the Stringtree codebase to use these features too.</p>
<p>Occasionally a Java 5-specific detail has crept in to a Stringtree library, and I have soon received comments or emails pointing this out. I haven&#8217;t noticed this for a while, which might indicate either that I have been especially careful, or that I there are no longer any/many people developing with Stringtree code who are still limited to Java 1.4.</p>
<p>If you are reading this and you still require Java 1.4 support, please let me know. Likewise, if you have thrown off the shackles of 1.4 within the last year or so or are desperately hoping for a Java 5 Stringtree that would be good to know too.</p>
<p>Is it time for Java 5 yet?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stringtree.org/2008/09/20/is-it-time-for-java-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slight Improvement to Stringtree XML Parser</title>
		<link>http://blog.stringtree.org/2008/01/31/slight-improvement-to-stringtree-xml-parser/</link>
		<comments>http://blog.stringtree.org/2008/01/31/slight-improvement-to-stringtree-xml-parser/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 13:29:08 +0000</pubDate>
		<dc:creator>Stringtree</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://blog.stringtree.org/?p=22</guid>
		<description><![CDATA[Someone just pointed out that the light-weight XML parser included in Stringtree did not handle explicit CDATA blocks. The version in SVN now has provisional support for this.
If you need a simple and fast parser for textual data, then this should be all you need. For XML documents containing opaque binary data in a CDATA [...]]]></description>
			<content:encoded><![CDATA[<p>Someone just pointed out that the light-weight <a href="http://stringtree.svn.sourceforge.net/svnroot/stringtree/trunk/src/delivery/java/org/stringtree/xml/XMLReader.java">XML parser</a> included in Stringtree did not handle explicit CDATA blocks. The version in SVN now has provisional support for this.</p>
<p>If you need a simple and fast parser for textual data, then this should be all you need. For XML documents containing opaque binary data in a CDATA block, this may not be ideal. Currently CDATA blocks are loaded as String objects, and this can lead to incorrect data for bytes which do not represent valid characters in the current character set.</p>
<p>I am currently planning for the next version of the Stringtree XMLReader to offer the option of extracting a CDATA block as an unprocessed byte array.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stringtree.org/2008/01/31/slight-improvement-to-stringtree-xml-parser/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Stringtree Maven Repository</title>
		<link>http://blog.stringtree.org/2008/01/07/stringtree-maven-repository/</link>
		<comments>http://blog.stringtree.org/2008/01/07/stringtree-maven-repository/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 11:48:12 +0000</pubDate>
		<dc:creator>Stringtree</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://blog.stringtree.org/?p=21</guid>
		<description><![CDATA[I have experimented with Maven a few times, but never been particularly impressed. 
Recently, however, one of my users has been bugging me to make the Stringtree and Mojasef classes and sources available in a Maven-style repository, for easier integration with Maven (or Maven-like) build tools and workflows. So I have done it. The current [...]]]></description>
			<content:encoded><![CDATA[<p>I have experimented with <a href="http://maven.apache.org/">Maven</a> a few times, but never been particularly impressed. </p>
<p>Recently, however, <a href="http://www.realsolve.co.uk/site/home.php">one of my users</a> has been bugging me to make the Stringtree and Mojasef classes and sources available in a Maven-style repository, for easier integration with Maven (or Maven-like) build tools and workflows. So I have done it. The current versions of key Stringtree and Mojasef files are now available from the <a href="http://stringtree.org/repository/">Stringtree repository</a> at the following URLs:</p>
<ul>
<li><a href="http://stringtree.org/repository/org/stringtree/stringtree/2.0.10/stringtree-2.0.10-sources.jar">http://stringtree.org/repository/org/stringtree/stringtree/2.0.10/stringtree-2.0.10-sources.jar</a></li>
<li><a href="http://stringtree.org/repository/org/stringtree/stringtree/2.0.10/stringtree-2.0.10.jar">http://stringtree.org/repository/org/stringtree/stringtree/2.0.10/stringtree-2.0.10.jar</a></li>
<li><a href="http://stringtree.org/repository/org/stringtree/stringtree/2.0.10/stringtree-httpclient-2.0.10.jar">http://stringtree.org/repository/org/stringtree/stringtree/2.0.10/stringtree-httpclient-2.0.10.jar</a></li>
<li><a href="http://stringtree.org/repository/org/stringtree/stringtree/2.0.10/stringtree-json-2.0.10.jar">http://stringtree.org/repository/org/stringtree/stringtree/2.0.10/stringtree-json-2.0.10.jar</a></li>
<li><a href="http://stringtree.org/repository/org/stringtree/mojasef/2.0.b1/mojasef-2.0.b1-sources.jar">http://stringtree.org/repository/org/stringtree/mojasef/2.0.b1/mojasef-2.0.b1-sources.jar</a></li>
<li><a href="http://stringtree.org/repository/org/stringtree/mojasef/2.0.b1/mojasef-2.0.b1-withdependencies-sources.jar">http://stringtree.org/repository/org/stringtree/mojasef/2.0.b1/mojasef-2.0.b1-withdependencies-sources.jar</a></li>
<li><a href="http://stringtree.org/repository/org/stringtree/mojasef/2.0.b1/mojasef-2.0.b1-withdependencies.jar">http://stringtree.org/repository/org/stringtree/mojasef/2.0.b1/mojasef-2.0.b1-withdependencies.jar</a></li>
<li><a href="http://stringtree.org/repository/org/stringtree/mojasef/2.0.b1/mojasef-2.0.b1.jar">http://stringtree.org/repository/org/stringtree/mojasef/2.0.b1/mojasef-2.0.b1.jar</a></li>
</ul>
<p>The Stringtree and Mojasef build scripts now include a &#8220;publish&#8221; target which uploads such artefacts to appropriate places in the repository, so future versions should continue to be available.</p>
<p>This is the first time I have done this, so I would welcome comments from any readers who actually use Maven (or buildr, or anything else which supports this repository format). In particular, I am interested in opinions on whether it is OK to simply replace artefacts with the same names and locations for minor tweaks and bug-fixes, or whether even the smallest change should result in the generation and upload of a new version with a new name and location.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stringtree.org/2008/01/07/stringtree-maven-repository/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Simple HTTP Client &#8211; Part 1 (Overview)</title>
		<link>http://blog.stringtree.org/2008/01/07/a-simple-http-client-part-1-overview/</link>
		<comments>http://blog.stringtree.org/2008/01/07/a-simple-http-client-part-1-overview/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 11:00:26 +0000</pubDate>
		<dc:creator>Stringtree</dc:creator>
				<category><![CDATA[HTTPClient]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[http]]></category>

		<guid isPermaLink="false">http://blog.stringtree.org/?p=20</guid>
		<description><![CDATA[This post is the first of a series describing the use and implementation of the Stringtree HTTP Client.
Recently I have been working with systems which talk to each other using REST/HTTP. Providing services and resources is pretty simple using Mojasef, but accessing such resources and consuming such services (in client code and in tests) has [...]]]></description>
			<content:encoded><![CDATA[<p><i>This post is the first of a series describing the use and implementation of the Stringtree HTTP Client.</i></p>
<p>Recently I have been working with systems which talk to each other using REST/HTTP. Providing services and resources is pretty simple using <a href='http://mojasef.stringtree.org/'>Mojasef</a>, but accessing such resources and consuming such services (in client code and in tests) has always seemed a bit more clumsy than it should be. I tried Apache HTTPClient and HttpUnit, but both seemed cumbersome for simple tasks, and bring in several hundred KB or more of dependencies, which can really bloat a small client application. I&#8217;m sure there are others, but I got bored with looking, and instead wrote my own simple HTTP Client which does the things I need without dragging in tons of extra stuff.</p>
<p>The Stringtree HTTP Client consists of just four classes, with no dependencies other than the standard Java APIs:</p>
<ul>
<li><a href="https://stringtree.svn.sourceforge.net/svnroot/stringtree/trunk/src/delivery/java/org/stringtree/http/HTTPClient.java">org.stringtree.http.HTTPClient</a></li>
<li><a href="https://stringtree.svn.sourceforge.net/svnroot/stringtree/trunk/src/delivery/java/org/stringtree/http/Form.java">org.stringtree.http.Form</a></li>
<li><a href="https://stringtree.svn.sourceforge.net/svnroot/stringtree/trunk/src/delivery/java/org/stringtree/http/Document.java">org.stringtree.http.Document</a></li>
<li><a href="https://stringtree.svn.sourceforge.net/svnroot/stringtree/trunk/src/delivery/java/org/stringtree/http/NameValue.java">org.stringtree.http.NameValue</a></li>
</ul>
<p>The point of these classes is to allow simple construction and calling of all valid HTTP requests, including the ability to set and read headers and cookies, simulate the submission of an HTML form, and support both textual and binary content data.</p>
<p>As a very simple example, consider the following code which issues a GET request to a specified URL:</p>
<p><code><br />
HTTPClient client = new HTTPClient();<br />
Document response = client.get("http://localhost:8080/?a=b");<br />
System.out.println("response content type=" + response.getHeader("Content-Type"));<br />
System.out.println("response content=" + response.getContentAsString());<br />
</code></p>
<p>The above code example shows basic usage of the Stringtree HTTP Client. In more general terms, usage is as follows:</p>
<ol>
<li>Create an object of the HTTPClient class.</li>
<li>Set any long-lived settings, such as cookies or a user-agent.</li>
<li>Call one of the request methods with appropriate parameters.</li>
<li>Read returned headers and content as required from the returned <tt>Document</tt> object.</li>
<li>Repeat from (3) for each new request.</li>
</ol>
<p>A slightly more complex example using a POST request to submit an HTML form might look like:</p>
<p><code><br />
HTTPClient client = new HTTPClient("Mozilla/5.0 (example)");<br />
client.setCookie("username", "Frank");<br />
Form form = new Form();<br />
form.put("name", "Widget");<br />
form.put("category", "thing");<br />
Document response = client.post("http://localhost:8080/update", form);<br />
boolean ok = "200".equals(response.getHeader(HTTPClient.HTTP_RESPONSE_CODE));<br />
</code></p>
<p>All the request methods return an <tt>org.stringtree.http.Document</tt> object. This object represents the structure of an HTTP request or response: a collection of name/value headers (which may contain duplicate names), and a block of &#8220;content&#8221; which may be considered as text or as a sequence of bytes. The HTTPClient code does make one simplifying concession; as seen in the above POST example the HTTP response code is added as a pseudo-header with the name &#8220;http.response.code&#8221;.</p>
<p>This should be enough to get started playing with the Stringtree HTTP Client. In the next post I will discuss the possibilities for creating and configuring an HTTPClient object in full detail.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stringtree.org/2008/01/07/a-simple-http-client-part-1-overview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mojasef goes into beta at last</title>
		<link>http://blog.stringtree.org/2007/07/20/mojasef-goes-into-beta-at-last/</link>
		<comments>http://blog.stringtree.org/2007/07/20/mojasef-goes-into-beta-at-last/#comments</comments>
		<pubDate>Fri, 20 Jul 2007 14:01:53 +0000</pubDate>
		<dc:creator>Stringtree</dc:creator>
				<category><![CDATA[Mojasef]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://blog.stringtree.org/?p=19</guid>
		<description><![CDATA[Finally, I have got to a point where I reckon Mojasef is nearing a proper numbered stable release. To celebrate this I have updated the version number in the Mojasef source code to 2.0.b1 and made a downloadable release (source and jar)  available at Sourceforge.
I strongly encourage anyone interested in shaping the direction, contents [...]]]></description>
			<content:encoded><![CDATA[<p>Finally, I have got to a point where I reckon Mojasef is nearing a proper numbered stable release. To celebrate this I have updated the version number in the Mojasef source code to 2.0.b1 and made a downloadable release (source and jar)  <a href='http://sourceforge.net/project/showfiles.php?group_id=127152&#038;package_id=139193&#038;release_id=524517'>available at Sourceforge.</a></p>
<p>I strongly encourage anyone interested in shaping the direction, contents and/or timing of the official 2.0.1 release of Mojasef to grab this release, have a play with it, and let me know your comments and suggestions.</p>
<p>I know that it is light on documentation, especially as even the examples on the web site are not quite accurate any more, but that is now <b>very</b> high on my list of priorities.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stringtree.org/2007/07/20/mojasef-goes-into-beta-at-last/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stringtree JSON 2.0.9</title>
		<link>http://blog.stringtree.org/2007/07/20/stringtree-json-209/</link>
		<comments>http://blog.stringtree.org/2007/07/20/stringtree-json-209/#comments</comments>
		<pubDate>Fri, 20 Jul 2007 11:42:08 +0000</pubDate>
		<dc:creator>Stringtree</dc:creator>
				<category><![CDATA[JSON]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://blog.stringtree.org/?p=18</guid>
		<description><![CDATA[Along with the latest release of Stringtree I have released a new Stringtree JSON.
The major change is the provision of an extra version of JSONReader.read which takes a CharacterIterator to allow reading of JSON from within a larger body of text.
I&#8217;ve also had another try at ensuring that it is Java 1.4 compatible. Please let [...]]]></description>
			<content:encoded><![CDATA[<p>Along with the latest release of Stringtree I have released a new Stringtree JSON.</p>
<p>The major change is the provision of an extra version of JSONReader.read which takes a CharacterIterator to allow reading of JSON from within a larger body of text.</p>
<p>I&#8217;ve also had another try at ensuring that it is Java 1.4 compatible. Please let me know of any problems you encounter, particularly Java1.4 incompatibility issues.</p>
<p><a href='http://sourceforge.net/project/showfiles.php?group_id=80689&#038;package_id=226281&#038;release_id=524468'>Download from Sourceforge as usual</a>, and the source is in with Stringtree 2.0.9.</p>
<p>Have fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stringtree.org/2007/07/20/stringtree-json-209/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Stringtree 2.0.9</title>
		<link>http://blog.stringtree.org/2007/07/20/stringtree-209/</link>
		<comments>http://blog.stringtree.org/2007/07/20/stringtree-209/#comments</comments>
		<pubDate>Fri, 20 Jul 2007 11:12:08 +0000</pubDate>
		<dc:creator>Stringtree</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://blog.stringtree.org/?p=17</guid>
		<description><![CDATA[It&#8217;s been a month or so, so it&#8217;s time for another release of Stringtree. Changes in this release include:

fixed some broken EasyTemplater constructors
added switchable prefixing of attributes in XMLReader
added switchable forcing all values to lists in XMLReader
added storing cdata from mixed elements as &#8220;text()&#8221; in XMLReader
added extra &#8220;read&#8221; methods to JSONReader to allow calling with [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a month or so, so it&#8217;s time for another release of Stringtree. Changes in this release include:</p>
<ul>
<li>fixed some broken EasyTemplater constructors</li>
<li>added switchable prefixing of attributes in XMLReader</li>
<li>added switchable forcing all values to lists in XMLReader</li>
<li>added storing cdata from mixed elements as &#8220;text()&#8221; in XMLReader</li>
<li>added extra &#8220;read&#8221; methods to JSONReader to allow calling with a CharacterIterator</li>
<li>XMLReader now skips a DOCTYPE without complaining.</li>
<li>tests.Hierarchy renamed to tests.tree</li>
<li>small tidyup of object creation to allow reference to context items instead of full class+parameter specifications</li>
<li>support a naive view of namespaces in XML parser, include colonprefix in the name</li>
<li>some slight improvements to class creation stuff in util to better deal with multiple calls to &#8220;init&#8221;.</li>
<li>added a GUID generator for use in REST-style applications</li>
</ul>
<p><a href='http://sourceforge.net/project/showfiles.php?group_id=80689&#038;package_id=82458&#038;release_id=524466'>Download available from Sourceforge as usual</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stringtree.org/2007/07/20/stringtree-209/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Demo Friki currently out of action</title>
		<link>http://blog.stringtree.org/2007/07/18/demo-friki-currently-out-of-action/</link>
		<comments>http://blog.stringtree.org/2007/07/18/demo-friki-currently-out-of-action/#comments</comments>
		<pubDate>Wed, 18 Jul 2007 19:56:05 +0000</pubDate>
		<dc:creator>Stringtree</dc:creator>
				<category><![CDATA[Friki]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Site News]]></category>

		<guid isPermaLink="false">http://blog.stringtree.org/2007/07/18/demo-friki-currently-out-of-action/</guid>
		<description><![CDATA[I have just been informed by my hosting provider that they have had to disable the Java support on the server running the example Friki. Apparently this is due to too many applications from different users clogging up the stderr logs. I won&#8217;t be able to re-enable Friki until I have ensured that it does [...]]]></description>
			<content:encoded><![CDATA[<p>I have just been informed by my hosting provider that they have had to disable the Java support on the server running the example Friki. Apparently this is due to too many applications from different users clogging up the stderr logs. I won&#8217;t be able to re-enable Friki until I have ensured that it does not log anything to stderr.</p>
<p>In practice I have not touched the Friki code in ages, and the demo installation was filling up with Wiki spam, so I might take this opportunity to bring Friki into line with current Stringtree practice.</p>
<p>Sorry if you were looking for a demo, but I&#8217;ll announce here when it is back again.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.stringtree.org/2007/07/18/demo-friki-currently-out-of-action/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

