<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Wicket Guice updates</title>
	<atom:link href="http://herebebeasties.com/2007-11-07/wicket-guice-updates/feed/" rel="self" type="application/rss+xml" />
	<link>http://herebebeasties.com/2007-11-07/wicket-guice-updates/</link>
	<description>Alastair Maw's small soap box.</description>
	<lastBuildDate>Thu, 10 Nov 2011 14:24:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Thomas</title>
		<link>http://herebebeasties.com/2007-11-07/wicket-guice-updates/comment-page-1/#comment-4633</link>
		<dc:creator>Thomas</dc:creator>
		<pubDate>Mon, 09 Jun 2008 09:16:56 +0000</pubDate>
		<guid isPermaLink="false">http://herebebeasties.com/2007-11-07/wicket-guice-updates/#comment-4633</guid>
		<description>How does Wicket handle references of e.g. a non-serializable service implementation that is passed to a model as Alastair proposed? I assume this will throw a java.io.NotSerializableException. In my opinion Models should be injectable in Wicket like Components. In particular when working with loadable, detachable models you will likely want to inject a service that is responsible for loading the data. If the model a reusable public class, component-only injection will not help.
Example:
&lt;code&gt;
public class ContactModel extends LoadableDetachableModel {
	
	private Long contactId;
	
	@Inject
	private ContactService service;
	
	public ContactModel(Long contactId) {
	   this.contactId = contactId;
	}

	@Override
	protected Contact load() {
	return service.getContact(contactId);
	}
	
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>How does Wicket handle references of e.g. a non-serializable service implementation that is passed to a model as Alastair proposed? I assume this will throw a java.io.NotSerializableException. In my opinion Models should be injectable in Wicket like Components. In particular when working with loadable, detachable models you will likely want to inject a service that is responsible for loading the data. If the model a reusable public class, component-only injection will not help.<br />
Example:<br />
<code><br />
public class ContactModel extends LoadableDetachableModel {</p>
<p>	private Long contactId;</p>
<p>	@Inject<br />
	private ContactService service;</p>
<p>	public ContactModel(Long contactId) {<br />
	   this.contactId = contactId;<br />
	}</p>
<p>	@Override<br />
	protected Contact load() {<br />
	return service.getContact(contactId);<br />
	}</p>
<p>}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alastair</title>
		<link>http://herebebeasties.com/2007-11-07/wicket-guice-updates/comment-page-1/#comment-4460</link>
		<dc:creator>Alastair</dc:creator>
		<pubDate>Wed, 07 May 2008 13:48:17 +0000</pubDate>
		<guid isPermaLink="false">http://herebebeasties.com/2007-11-07/wicket-guice-updates/#comment-4460</guid>
		<description>Wicket&#039;s Spring and Guice injection don&#039;t work inside models, only inside components. Inject a field of a component, and pass that reference into your model. It&#039;ll do the right thing WRT serialization.</description>
		<content:encoded><![CDATA[<p>Wicket&#8217;s Spring and Guice injection don&#8217;t work inside models, only inside components. Inject a field of a component, and pass that reference into your model. It&#8217;ll do the right thing WRT serialization.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Callum</title>
		<link>http://herebebeasties.com/2007-11-07/wicket-guice-updates/comment-page-1/#comment-4459</link>
		<dc:creator>Callum</dc:creator>
		<pubDate>Wed, 07 May 2008 13:33:41 +0000</pubDate>
		<guid isPermaLink="false">http://herebebeasties.com/2007-11-07/wicket-guice-updates/#comment-4459</guid>
		<description>Hi there,

I am trying to do guice injection inside a LoadableDetachableModel and for some reason the filed I inject remains null. Oddly I use the same injection statement for the same object in a Page elsewhere and it works fine. Am I doing something wrong?

Cheers,

Callum</description>
		<content:encoded><![CDATA[<p>Hi there,</p>
<p>I am trying to do guice injection inside a LoadableDetachableModel and for some reason the filed I inject remains null. Oddly I use the same injection statement for the same object in a Page elsewhere and it works fine. Am I doing something wrong?</p>
<p>Cheers,</p>
<p>Callum</p>
]]></content:encoded>
	</item>
</channel>
</rss>

