<?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/"
	>

<channel>
	<title>Misterdom's World &#187; Java</title>
	<atom:link href="http://www.guinard.org/~misterdom/category/loogbook/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.guinard.org/~misterdom</link>
	<description>My Computing Logbook</description>
	<lastBuildDate>Fri, 25 Jun 2010 14:12:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Packaging a Property File in a Maven Project</title>
		<link>http://www.guinard.org/~misterdom/2010/06/25/property-file-maven-project/</link>
		<comments>http://www.guinard.org/~misterdom/2010/06/25/property-file-maven-project/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 14:12:52 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=154</guid>
		<description><![CDATA[When working with a Maven project, property (e.g. config.properties) files are not copied to the build as a default. The easiest way to have them appear in the final jar is to put them in ${basedir}/src/main/resources.
As a result your property file will be copied at the root of your packaged jar.
]]></description>
			<content:encoded><![CDATA[<p>When working with a Maven project, property (e.g. config.properties) files are not copied to the build as a default. The easiest way to have them appear in the final jar is to put them in <code>${basedir}/src/main/resources</code>.</p>
<p>As a result your property file will be copied at the root of your packaged jar.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2010/06/25/property-file-maven-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Manually Add a Jar to a Maven Repository</title>
		<link>http://www.guinard.org/~misterdom/2010/06/21/manually-add-a-jar-to-a-maven-repository/</link>
		<comments>http://www.guinard.org/~misterdom/2010/06/21/manually-add-a-jar-to-a-maven-repository/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 16:42:15 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[jar]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=148</guid>
		<description><![CDATA[Use this command to manually add a Jar to a Maven Repository
mvn install:install-file -DgroupId=javax.comm -DartifactId=comm -Dversion=3.0 -Dpackaging=jar -Dfile=/home/misterdom/Documents/3_Software_Projects/WebPlogg/commapi/comm.jar
]]></description>
			<content:encoded><![CDATA[<p>Use this command to manually add a Jar to a Maven Repository<br />
<code>mvn install:install-file -DgroupId=javax.comm -DartifactId=comm -Dversion=3.0 -Dpackaging=jar -Dfile=/home/misterdom/Documents/3_Software_Projects/WebPlogg/commapi/comm.jar</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2010/06/21/manually-add-a-jar-to-a-maven-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing the Default Java Vendor (or Version) in Ubuntu</title>
		<link>http://www.guinard.org/~misterdom/2010/04/20/changing-the-default-java-vendor-or-version-in-ubuntu/</link>
		<comments>http://www.guinard.org/~misterdom/2010/04/20/changing-the-default-java-vendor-or-version-in-ubuntu/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 08:34:13 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=135</guid>
		<description><![CDATA[Run sudo update-java-alternatives -l to see the current configuration and possibilities.
Run sudo update-java-alternatives -s XXXX to set the XXX java version as default.
For Sun Java 6 this would be sudo update-java-alternatives -s java-6-sun
Run java -version to ensure that the correct version is being called. 
Source: https://help.ubuntu.com/community/Java
]]></description>
			<content:encoded><![CDATA[<p><code>Run sudo update-java-alternatives -l to see the current configuration and possibilities.</code></p>
<p><code>Run sudo update-java-alternatives -s XXXX to set the XXX java version as default.<br />
For Sun Java 6 this would be sudo update-java-alternatives -s java-6-sun</code></p>
<p>Run <code>java -version</code> to ensure that the correct version is being called. </p>
<p>Source: <a href="https://help.ubuntu.com/community/Java">https://help.ubuntu.com/community/Java</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2010/04/20/changing-the-default-java-vendor-or-version-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Browse to URI (or URL) in the Default Browser Directly From Java</title>
		<link>http://www.guinard.org/~misterdom/2009/10/03/browse-url-java/</link>
		<comments>http://www.guinard.org/~misterdom/2009/10/03/browse-url-java/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 10:52:57 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=114</guid>
		<description><![CDATA[
if (Desktop.isDesktopSupported()) {
                        Desktop dt = Desktop.getDesktop();
                        if (dt.isSupported(Desktop.Action.BROWSE)) [...]]]></description>
			<content:encoded><![CDATA[<p><code><br />
if (Desktop.isDesktopSupported()) {<br />
                        Desktop dt = Desktop.getDesktop();<br />
                        if (dt.isSupported(Desktop.Action.BROWSE)) {<br />
                            dt.browse(new URI("http://localhost:8182/EnergieVisible"));<br />
                        }<br />
                    }<br />
</code></p>
<p>From Java 1.6.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2009/10/03/browse-url-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Doing PUT DELETE and Other Niceties with GWT</title>
		<link>http://www.guinard.org/~misterdom/2009/10/01/doing-put-with-gwt/</link>
		<comments>http://www.guinard.org/~misterdom/2009/10/01/doing-put-with-gwt/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 15:33:35 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Google Web Toolkit (GWT)]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[gwt]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[POST]]></category>
		<category><![CDATA[PUT]]></category>
		<category><![CDATA[verbs]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=112</guid>
		<description><![CDATA[You probably are REST lovers like I personally am.
Thus you were probably quite frustrated when seeing that a GWT (Google Web Toolkit) client cannot send other requests than POST or GET.
Well here is the solution:
public class RequestBuilderForAnyHTTPMethodTypeExample extends RequestBuilder {
  /**
   * Constructor that allows a developer to override the HTTP method
 [...]]]></description>
			<content:encoded><![CDATA[<p>You probably are REST lovers like I <a href="http://www.webofthings.com/tag/rest/">personally am</a>.</p>
<p>Thus you were probably quite frustrated when seeing that a GWT (Google Web Toolkit) client cannot send other requests than POST or GET.<br />
Well here is the solution:</p>
<p><code>public class RequestBuilderForAnyHTTPMethodTypeExample extends RequestBuilder {</p>
<p>  /**<br />
   * Constructor that allows a developer to override the HTTP method<br />
   * restrictions imposed by the RequestBuilder class.  Note if you override the<br />
   * RequestBuilder's HTTP method restrictions in this manner, your application<br />
   * may not work correctly on Safari browsers.<br />
   *<br />
   * @param httpMethod any non-null, non-empty string is considered valid<br />
   * @param url any non-null, non-empty string is considered valid<br />
   *<br />
   * @throws IllegalArgumentException if httpMethod or url are empty<br />
   * @throws NullPointerException if httpMethod or url are null<br />
   */<br />
  public RequestBuilderForAnyHTTPMethodTypeExample(String httpMethod, String url) {<br />
    super(httpMethod, url);<br />
  }<br />
</code></p>
<p>i.e. simply subclass the <code>RequestBuilder</code></p>
<p>Source: <a href="http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/http/client/package-summary.html"> (see the bottom of the page).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2009/10/01/doing-put-with-gwt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSON and the Quoted Strings</title>
		<link>http://www.guinard.org/~misterdom/2009/09/16/json-and-the-quoted-strings/</link>
		<comments>http://www.guinard.org/~misterdom/2009/09/16/json-and-the-quoted-strings/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 16:50:38 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Dev Logbook]]></category>
		<category><![CDATA[Google Web Toolkit (GWT)]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[gwt]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=103</guid>
		<description><![CDATA[&#8220;Bug&#8221; number two for today is a little more tricky.
I was retrieving a JSON object in the GWT (Google Web Toolkit) and putting its Java representation in a HashMap. The only problem is that I could never find it again by referring to its key which I also extracted from JSON object. Here is why:

currentCons.get("URI").isString().toString()

Is [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;Bug&#8221; number two for today is a little more tricky.</p>
<p>I was retrieving a JSON object in the <a href="../../../../category/loogbook/google-web-toolkit-gwt/">GWT (Google Web Toolkit)</a> and putting its Java representation in a <code>HashMap</code>. The only problem is that I could never find it again by referring to its key which I also extracted from JSON object. Here is why:</p>
<blockquote><p>
<code>currentCons.get("URI").isString().toString()</code>
</p></blockquote>
<p>Is actually not returning the String representation of a JSONString object but the quoted representation of that String: e.g. &#8220;key&#8221; and not key. It was in the API but it took me a while to figure it out&#8230;</p>
<p>The solution is:</p>
<blockquote><p>
<code>currentCons.get("URI").isString().stringValue();</code>
</p></blockquote>
<p>Which gets what I wanted, i.e. the String representation without the quotes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2009/09/16/json-and-the-quoted-strings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Iterators and Deadlocks: How Not to Use Iterators!</title>
		<link>http://www.guinard.org/~misterdom/2009/09/16/iterators-and-deadlocks-how-not-to-use-iterators/</link>
		<comments>http://www.guinard.org/~misterdom/2009/09/16/iterators-and-deadlocks-how-not-to-use-iterators/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 16:34:59 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Dev Logbook]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[collection]]></category>
		<category><![CDATA[iterators]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=99</guid>
		<description><![CDATA[Two nice little bugs today which sums up most of my day  
How not to use iterators:


        while(views.iterator().hasNext()) {
            View currentView = (View) views.iterator.next();
            currentView.update();
 [...]]]></description>
			<content:encoded><![CDATA[<p>Two nice little bugs today which sums up most of my day <img src='http://www.guinard.org/~misterdom/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>How not to use iterators:</p>
<blockquote><p>
<code><br />
        while(views.iterator().hasNext()) {<br />
            View currentView = (View) views.iterator.next();<br />
            currentView.update();<br />
        }<br />
</code>
</p></blockquote>
<p>Bing that basically crashed my Firefox (this is part of a GWT app) when running it as well as my Netbeans / GWT debugger. Notice that Firefox was so good to tell me that apparently the script I was running in a weird manner.</p>
<p>And it was indeed in an endless loop as you can guess: invoking the <code>iterator()</code> method returns a new <code>Iterator</code> object every time (which it is supposed to do, I&#8217;m the dumb one in that story). Thus, I was basically getting the same &#8220;<code>next()</code>&#8221; object every time and <code>hasNext()</code> was thus always true <img src='http://www.guinard.org/~misterdom/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Anyway that fixes it:</p>
<blockquote><p>
<code><br />
        Iterator viewsIt = views.iterator();<br />
        while(viewsIt.hasNext()) {<br />
            View currentView = (View) viewsIt.next();<br />
            currentView.update();<br />
        }<br />
</code>
</p></blockquote>
<p>Ok that was a trivial one, but actually so trivial that I just felt like shaming me a little more and publishing it here <img src='http://www.guinard.org/~misterdom/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2009/09/16/iterators-and-deadlocks-how-not-to-use-iterators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customize the Default Username (Author) in Netbeans 6.7</title>
		<link>http://www.guinard.org/~misterdom/2009/09/02/customize-author-netbeans-6-7/</link>
		<comments>http://www.guinard.org/~misterdom/2009/09/02/customize-author-netbeans-6-7/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 08:06:19 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Netbeans]]></category>
		<category><![CDATA[author]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=95</guid>
		<description><![CDATA[Customize the Default Username (Author) in Netbeans 6.7:
- Open the netbeans.conf file
- Locate the &#8216;netbeans_default_options&#8217; property
- Add the discussed property to the list of options as &#8216;-J-Duser.name=\&#8221;Dominique Guinard\&#8221;&#8216;
Source]]></description>
			<content:encoded><![CDATA[<p>Customize the Default Username (Author) in Netbeans 6.7:<br />
- Open the netbeans.conf file<br />
- Locate the &#8216;netbeans_default_options&#8217; property<br />
- Add the discussed property to the list of options as &#8216;-J-Duser.name=\&#8221;Dominique Guinard\&#8221;&#8216;</p>
<p><a href="http://blogs.sun.com/marek/entry/using_code_templates_in_netbeans">Source</a</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2009/09/02/customize-author-netbeans-6-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Porting a Google Web Toolkit Netbeans Project (GWT4NB) to the Latest GWT and GWT4NB</title>
		<link>http://www.guinard.org/~misterdom/2009/09/01/porting-gwt-nb/</link>
		<comments>http://www.guinard.org/~misterdom/2009/09/01/porting-gwt-nb/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 10:09:47 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Google Web Toolkit (GWT)]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Netbeans]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=93</guid>
		<description><![CDATA[A while ago I was blogging about some experiences with the Google Web Toolkit (GWT) and Netbeans.
I reported on the existence of a great plugin (GWT4NB) that GWT-enables your Netbeans (starting from NB 6.5).
Well today I upgraded to NB 6.7 (from 6.5), to GWT4NB 2.6 (from 2.0.4) and to GWT 1.7 (from 1.5.3) and could [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I was blogging about some experiences with the Google Web Toolkit (GWT) and Netbeans.<br />
I reported on the existence of a great plugin (<a href="http://gwt4nb.dev.java.net/">GWT4NB</a>) that GWT-enables your Netbeans (starting from NB 6.5).<br />
Well today I upgraded to NB 6.7 (from 6.5), to GWT4NB 2.6 (from 2.0.4) and to GWT 1.7 (from 1.5.3) and could not compile my GWT project anymore. Here are the steps I went through to make it run again:</p>
<ol>
<li>Create an new empty Web project. When Netbeans asks you what framework you&#8217;d like to use (last sept of the wizard) select the Google Web Toolkit.</li>
<li>Be sure that the GWT Installation Folder points to the latest version of GWT (1.7 in my case).</li>
<li>Copy the content of both: <code>build-gwt.xml</code> and <code>gwt.properties</code> to these files in your old project.</li>
<li>Make sure you keep the entry <code>gwt.module=...</code> of your old project.</li>
<li>You might need to check the properties of the old project and make sure the &#8220;Frameworks&#8221; entry is referencing the latest version of GWT. </li>
</ol>
<p>This should do, you should now be able to run and compile the old project with the latest GWT and GWT4NB plugin (at least it worked for me!).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2009/09/01/porting-gwt-nb/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Dear Java and HTML, parlez-vous Français?</title>
		<link>http://www.guinard.org/~misterdom/2008/11/26/dear-java-and-html-parlez-vous-francais/</link>
		<comments>http://www.guinard.org/~misterdom/2008/11/26/dear-java-and-html-parlez-vous-francais/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 14:00:20 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=54</guid>
		<description><![CDATA[Today I had to face my mother tongue once again. For one of the very first time in my life as a researcher I had to write a web page that encloses an html form which is gonna be filled with FRENCH sentences.
The thing is the web is designed for English mainly and thus when [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had to face my mother tongue once again. For one of the very first time in my life as a researcher I had to write a web page that encloses an html form which is gonna be filled with FRENCH sentences.</p>
<p>The thing is the web is designed for English mainly and thus when getting the data out of my form in my Java servlet, I had to face the fact that all beautiful accents (e.g. é,à) of the French language were replaced by rather ugly and random chars.</p>
<p>After a number of attempts I eventually figured-out that changing the meta of the HTML page from:<br />
<code>...meta http-equiv="Content-Type" content="text/html; charset=UTF-8"...</code></p>
<p>to</p>
<p><code>.. http-equiv="Content-Type" content="text/html; charset=iso-8859-1"...</code></p>
<p>did the trick! Thanks ISO for not forgetting that English is not the only language that still exists on the web!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2008/11/26/dear-java-and-html-parlez-vous-francais/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
