<?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>Code3 &#187; Java</title>
	<atom:link href="http://www.code3.dk/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.code3.dk</link>
	<description>Techchat</description>
	<lastBuildDate>Thu, 17 Nov 2011 13:10:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Testing JBoss 6</title>
		<link>http://www.code3.dk/testing-jboss-6/</link>
		<comments>http://www.code3.dk/testing-jboss-6/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 12:57:53 +0000</pubDate>
		<dc:creator>AN</dc:creator>
				<category><![CDATA[Techchat]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[Seam]]></category>

		<guid isPermaLink="false">http://www.code3.dk/?p=346</guid>
		<description><![CDATA[So, JBoss 6.0.0 is out. And so far it looks pretty good.
Last year I was working on an JEE5 app [...]]]></description>
			<content:encoded><![CDATA[<p>So, <a href="http://in.relation.to/Bloggers/JBossAS600FinalReleased">JBoss 6.0.0 is out</a>. And so far it looks pretty good.</p>
<p>Last year I was working on an JEE5 app that runs with Seam 2 and Richfaces 3.3 on JBoss 4.2. Just for fun I tried to deploy it on JBoss 6. To make it deploy cleanly I had to fix some minor things. </p>
<ol>
<li>Only the latest Seam 2.2.1 CR3 <a href="http://seamframework.org/Seam2/Downloads">is advertised to run on JBoss 6</a>. So I grabbed that.</li>
<li>commons-httpclient, which I use in my app, was on my classpath on the JBoss 4.2 I used, but was missing on JBoss 6. But I just grabbed the one from the Seam /lib folder.</li>
<li>My app is a .ear file with a .war file inside. And the files have the same name which makes it look something like this when exploded myapp.ear/myapp.war. JBoss 6 doesn&#8217;t seem to like this, complaining that the war has already been deployed during the deployment. Renaming the .war to myappweb.war fixed it.</li>
</ol>
<p><a href="http://dow.ngra.de/2010/12/14/jee-oss-container-startup-times-apples-vs-oranges/">As expected</a>, startup is somewhat slower than JBoss 4.2.3 at around 21 secs to start JBoss 6 with my app deployed and 14 secs on JBoss 4.2.3. </p>
<p>So, to sum up; if I get the chance to do another release of the app and run it on JBoss 6 then, it is definitely possible. And I wouldn&#8217;t hesitate to do so. Taking advantage of EJB 3.1 on JBoss 6 to get rid of the silly EJB interfaces would really clean up the app.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.code3.dk/testing-jboss-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dependent dropdowns in Seam and Richfaces</title>
		<link>http://www.code3.dk/dependent-dropdowns-in-seam-and-richfaces/</link>
		<comments>http://www.code3.dk/dependent-dropdowns-in-seam-and-richfaces/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 10:45:51 +0000</pubDate>
		<dc:creator>AN</dc:creator>
				<category><![CDATA[Techchat]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Richfaces]]></category>
		<category><![CDATA[Seam]]></category>

		<guid isPermaLink="false">http://www.code3.dk/?p=279</guid>
		<description><![CDATA[It is not uncommon to want to make a combobox with choices that depend on another combobox. But it often [...]]]></description>
			<content:encoded><![CDATA[<p>It is not uncommon to want to make a combobox with choices that depend on another combobox. But it often seems very complicated to actually do this. So here is a piece of example code that I use with <a href="http://www.seamframework.org/">Seam</a> and <a href="http://www.jboss.org/jbossrichfaces/">Richfaces</a>. Imagine we have different vendors Vendors each with different Models of something.</p>
<p>The somewhat large blurb of Richfaces markup is to make two ordinary input textfields feel like two ajaxy comboboxes. It sucks a bit, but on the other hand the Java code is nice and clean.</p>
<p>How do you make dependent gui elements?</p>
<pre class="brush: xml">

xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
xmlns:ui=&quot;http://java.sun.com/jsf/facelets&quot;
xmlns:h=&quot;http://java.sun.com/jsf/html&quot;
xmlns:f=&quot;http://java.sun.com/jsf/core&quot;
xmlns:s=&quot;http://jboss.com/products/seam/taglib&quot;
xmlns:rich=&quot;http://richfaces.org/rich&quot;
xmlns:a4j=&quot;http://richfaces.org/a4j&quot;&gt;
&lt;div class=&quot;dialog&quot;&gt;
Vendor&lt;/div&gt;
&lt;div class=&quot;dialog&quot;&gt;
Model

&lt;br class=&quot;clear&quot; /&gt;&lt;/div&gt;
</pre>
<pre class="brush: java">package test;

import java.util.ArrayList;
import java.util.List;

import javax.ejb.Remove;
import javax.ejb.Stateful;

import org.jboss.labs.seam.guice.Guice;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.log.Log;

import com.google.inject.Inject;

import dk.telenor.tacs.api.DBApi;
import dk.telenor.tacs.db.Model;
import dk.telenor.tacs.db.Vendor;

@Stateful
@Scope(ScopeType.SESSION)
@Name(&quot;vendormodelselector&quot;)
@Guice
public class VendorModelSelectorBeanImpl implements VendorModelSelectorBean {

@Inject	private DBApi dbApi;

@Out(required = false, value=&quot;model&quot;)
private Model model = new Model();

@Out(required = false, value=&quot;vendor&quot;)
private Vendor vendor = new Vendor();

public List autocompleteVendor(){
return dbApi.getMatches(new Vendor());
}

public List autocompleteModel(){
if (vendor == null || vendor.getName() == null) {
return new ArrayList();
}
return dbApi.getMatches( new Model(vendor, null) );
}

public void setVendor(final Vendor vendor){
this.vendor = vendor;
}

public void setModel(final Model Model){
this.model = model;
}

public Model getModel(){
return model;
}

public boolean isReady(){
return model.getId() != null;
}

@Remove
public void destroy(){}
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.code3.dk/dependent-dropdowns-in-seam-and-richfaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serialize java objects</title>
		<link>http://www.code3.dk/serialize-java-objects/</link>
		<comments>http://www.code3.dk/serialize-java-objects/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 15:34:48 +0000</pubDate>
		<dc:creator>AN</dc:creator>
				<category><![CDATA[Techchat]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.code3.dk/?p=210</guid>
		<description><![CDATA[

For my current project I want to serialize some plain old java objects and store them in a database. That’s [...]]]></description>
			<content:encoded><![CDATA[<div class="entry">
<div class="snap_preview">
<p>For my current project I want to serialize some plain old java objects and store them in a database. That’s easy. However, for debugability I would like the serialized data to be human readable, and I figure that there should be plenty of libs that supply drop in replacement functionality for ObjectInputStream/ObjectOutputStream.</p>
<p>Well, it was a bit more difficult than I thought. From my first go at the problem I concluded to myself.</p>
<p>I can’t seem to find an XML serialization framework that works the same way as the plain old java serialization.</p>
<p><em>1) <a href="http://java.sun.com/javase/6/docs/api/java/beans/Encoder.html" rel="nofollow">java.beans.Encoder</a> : requires no-arg constructor, but doesn’t seem to handle collections properly (fails, returns null)</em></p>
<p><em>2) <a href="http://xstream.codehaus.org/" rel="nofollow">XStream</a> : has too many dependencies.</em></p>
<p><em>3) <a href="http://simple.sourceforge.net/" rel="nofollow">Simple</a> : requires annotations, and requires knowing the Class that we want to deserialize to (ugly but workable). Best candidate.</em></p>
<p><em>4) <a href="http://commons.apache.org/betwixt/" rel="nofollow">Betwixt</a> : requires knowing the Class that we want to deserialize to, fails to handle collections without silly naming conventions or extra code.</em></p>
<p><em>5) <a href="http://www.castor.org/" rel="nofollow">Castor</a> : requires knowing the Class that we want to deserialize to, not tried yet.</em></p>
<p>Fortunately I was too fast in my judgement of XStream (and maybe the other libs too?). Anyway, all of the dependencies for XStream are optional. And it has a plesantly simple API. Yay, XStream…</p></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.code3.dk/serialize-java-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

