<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-257345774830404325</id><updated>2012-01-20T11:25:28.110-08:00</updated><category term='spring in-depth book'/><category term='hibernate'/><category term='i18n'/><category term='jaxb'/><category term='spring framework'/><category term='spring by example'/><category term='spring web services'/><category term='aop'/><category term='spring security'/><category term='spring mvc'/><category term='maven'/><category term='gwt'/><category term='spring integration'/><category term='aspectj'/><category term='ltw'/><category term='valang'/><category term='validation'/><category term='springone'/><category term='spring web flow'/><category term='comet'/><category term='grails'/><category term='osgi'/><category term='spring roo'/><category term='jpa'/><category term='tiles'/><category term='spring blazeds integration'/><category term='velocity'/><category term='jmx'/><category term='bayeux'/><category term='spring dm server'/><title type='text'>Spring, Java, and other Fun Stuff</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>37</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-5385194967525756268</id><published>2012-01-20T11:08:00.000-08:00</published><updated>2012-01-20T11:25:28.125-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring framework'/><category scheme='http://www.blogger.com/atom/ns#' term='jaxb'/><title type='text'>Spring JAXB with CDATA Elements</title><content type='html'>&lt;span style="font-family: arial;"&gt;&lt;br /&gt;I wanted to configure the &lt;i&gt;Jaxb2Marshaller&lt;/i&gt; to support CDATA elements.  This example works with Spring 3.1 and Java 6, using the Java 6 restricted XML parser classes to configure the CDATA elements.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&lt;br /&gt;    &amp;lt;bean id="marshaller" class="org.springbyexample.marshaller.CdataJaxb2Marshaller"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="cdataElements"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;list&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;value&amp;gt;^value&amp;lt;/value&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/list&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt;&lt;br /&gt;        ...&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.io.OutputStream;&lt;br /&gt;&lt;br /&gt;import javax.xml.bind.JAXBException;&lt;br /&gt;import javax.xml.bind.Marshaller;&lt;br /&gt;import javax.xml.transform.Result;&lt;br /&gt;import javax.xml.transform.stream.StreamResult;&lt;br /&gt;&lt;br /&gt;import org.apache.commons.lang.ArrayUtils;&lt;br /&gt;import org.springframework.oxm.MarshallingFailureException;&lt;br /&gt;import org.springframework.oxm.XmlMappingException;&lt;br /&gt;import org.springframework.oxm.jaxb.Jaxb2Marshaller;&lt;br /&gt;import org.springframework.oxm.mime.MimeContainer;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class CdataJaxb2Marshaller extends Jaxb2Marshaller {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private String[] cdataElements;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public String[] getCdataElements() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return cdataElements;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public void setCdataElements(String[] cdataElements) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.cdataElements = cdataElements;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@Override&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public void marshal(Object graph, Result result, MimeContainer mimeContainer) throws XmlMappingException {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (ArrayUtils.isNotEmpty(cdataElements)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;try {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Marshaller marshaller = createMarshaller();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;com.sun.org.apache.xml.internal.serialize.XMLSerializer serializer = &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;createXMLSerializer(cdataElements, ((StreamResult)result).getOutputStream());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;marshaller.marshal(graph, serializer.asContentHandler());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} catch (IOException e) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw new MarshallingFailureException(e.getMessage(), e);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} catch (JAXBException ex) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw convertJaxbException(ex);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;super.marshal(graph, result);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@SuppressWarnings("restriction")&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private com.sun.org.apache.xml.internal.serialize.XMLSerializer createXMLSerializer(String[] cDataElements, OutputStream cOut) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// This code is from a sample online: http://jaxb.java.net/faq/JaxbCDATASample.java&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// configure an OutputFormat to handle CDATA&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;com.sun.org.apache.xml.internal.serialize.OutputFormat of = new com.sun.org.apache.xml.internal.serialize.OutputFormat();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// specify which of your elements you want to be handled as CDATA.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// The use of the '^' between the namespaceURI and the localname&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// seems to be an implementation detail of the xerces code.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// When processing xml that doesn't use namespaces, simply omit the&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// namespace prefix as shown in the third CDataElement below.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;of.setCDataElements(cDataElements); //&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// set any other options you'd like&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;of.setPreserveSpace(true);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;of.setIndenting(true);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;of.setPreserveSpace(false);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// create the serializer&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;com.sun.org.apache.xml.internal.serialize.XMLSerializer serializer = new com.sun.org.apache.xml.internal.serialize.XMLSerializer(of);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;serializer.setOutputByteStream(cOut);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return serializer;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-5385194967525756268?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/5385194967525756268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=5385194967525756268' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/5385194967525756268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/5385194967525756268'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2012/01/spring-jaxb-with-cdata-elements.html' title='Spring JAXB with CDATA Elements'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-4744394523438525709</id><published>2009-12-25T05:58:00.000-08:00</published><updated>2009-12-25T06:39:08.925-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring by example'/><category scheme='http://www.blogger.com/atom/ns#' term='maven'/><title type='text'>Spring 3.0 &amp; Maven</title><content type='html'>&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;I wanted to go over the process of upgrading the build from Spring 2.5 to Spring 3.0 (&lt;a href="http://www.springsource.org/node/2266"&gt;3.0 release announcement&lt;/a&gt;) using Maven for the build process.  For almost all applications from basic dependency injection to webapps, and even enterprise applications with &lt;a href="http://static.springsource.org/spring-ws/sites/1.5/"&gt;Spring Web Services&lt;/a&gt; and &lt;a href="http://www.springsource.org/spring-integration"&gt;Spring Integration&lt;/a&gt; all upgraded without any issues.&lt;br /&gt;&lt;br /&gt;I did change all the builds to use the &lt;a href="http://www.springsource.com/repository/app/"&gt;SpringSource Enterprise Bundle Repository&lt;/a&gt;.  It has all the Spring projects and also repackaged versions of many other open source ones.  SpringSource did this to make all the artifacts OSGi enabled and also corrected any errors in dependencies where possible.  It isn't necessary to use this repository and all Spring projects are also deployed to the main Maven repository tool.&lt;br /&gt;&lt;br /&gt;I primarily switched so the projects could be more easily imported into an OSGi environment if someone needed to the &lt;a href="http://www.springsource.com/repository/app/"&gt;SpringSource Enterprise Bundle Repository&lt;/a&gt; (EBR) and to avoid any dependency resolution issues since some artifacts will need to be resolved from the EBR.&lt;br /&gt;&lt;br /&gt;Keith Donald, from SpringSource, did a blog discussing using Maven with Spring 3.0.  It's called &lt;a href="http://blog.springsource.com/2009/12/02/obtaining-spring-3-artifacts-with-maven/"&gt;Obtaining Spring 3 Artifacts with Maven&lt;/a&gt; and is definitely worth reading to understand things in more detail.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-4744394523438525709?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/4744394523438525709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=4744394523438525709' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/4744394523438525709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/4744394523438525709'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2009/12/spring-30-maven.html' title='Spring 3.0 &amp; Maven'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-6951819279774135854</id><published>2009-12-24T19:42:00.000-08:00</published><updated>2009-12-24T20:02:31.186-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring by example'/><category scheme='http://www.blogger.com/atom/ns#' term='spring roo'/><category scheme='http://www.blogger.com/atom/ns#' term='grails'/><title type='text'>Spring &amp; Spring by Example</title><content type='html'>&lt;span style="font-family:arial;"&gt;&lt;br /&gt;I've been working a lot on getting &lt;a href="http://www.springbyexample.org/"&gt;Spring by Example&lt;/a&gt; updated for &lt;a href="http://static.springsource.org/spring/docs/3.0.x/reference/html/"&gt;Spring 3.0&lt;/a&gt;.  A &lt;a href="http://www.springbyexample.org/examples/simple-grails-webapp.html"&gt;Simple Grails Webapp&lt;/a&gt; was also added to this release.&lt;br /&gt;&lt;br /&gt;Almost everything is upgraded except for the AspectJ LTW example, GWT ones, and OSGi.  The AspectJ one, I've had an odd problem that I've updated everything to use the Spring Repository, but when I change it to from Spring 2.5.6 to 3.0, the weaving stops working.  No errors and no success resolving the issues, but I will keep working on it.  I had trouble with the GWT webapps too, but I think it's mainly build related.  I'll probably start over with a new project using GWT 2.0 and build the examples back up.  For the &lt;a href="http://www.springsource.org/dmserver"&gt;Spring dm Server&lt;/a&gt; (OSGi) ones, I just haven't had time.  I don't think there will be a problem upgrading them.&lt;br /&gt;&lt;br /&gt;Everything is versioned on the site, so all past site releases and examples are available (&lt;a href="http://www.springbyexample.org/static/1.03/html/"&gt;Spring by Example 2.5.x&lt;/a&gt;, which is version 1.0.3).  Just follow the subversion instructions at the end of the examples to checkout the correct version of the project the example describes.  If you're ever not sure what version of something the example uses, check the 'Project Information' section at the end of the example and/or the Maven POM.&lt;br /&gt;&lt;br /&gt;I have a &lt;a href="http://www.springsource.org/roo"&gt;Spring Roo&lt;/a&gt; example in progress that is the basis for a simple person and address example.  Ideally I'd like to even use &lt;a href="http://www.springsource.org/roo"&gt;Roo&lt;/a&gt; to replace many of the webapp examples and/or have as much of them generated as possible.  I'd also like to spend time redoing the web services add-ons for &lt;a href="http://www.springsource.org/roo"&gt;Roo&lt;/a&gt; and get them into a releasable state, but I just haven't had the time.  I'm hoping it will fit in with a future project soon, so maybe it will get done.&lt;br /&gt;&lt;br /&gt;I also plan on getting SpEL, REST, and some other examples together for the website.  I've also done a lot of Flex work over the last year, so I'd really like to do some more advanced Flex examples and especially a basic messaging example and security example.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-6951819279774135854?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/6951819279774135854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=6951819279774135854' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/6951819279774135854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/6951819279774135854'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2009/12/spring-spring-by-example.html' title='Spring &amp; Spring by Example'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-5989666794782674936</id><published>2009-12-14T12:31:00.000-08:00</published><updated>2009-12-14T12:59:40.712-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring by example'/><category scheme='http://www.blogger.com/atom/ns#' term='spring roo'/><category scheme='http://www.blogger.com/atom/ns#' term='springone'/><title type='text'>Spring Roo, SpringOne 2009, Spring by Example</title><content type='html'>&lt;span style="font-family: arial;"&gt;I haven't been active on my blog or &lt;a href="http://www.springbyexample.org/"&gt;Spring by Example&lt;/a&gt; for a long time.  I was just really busy.  In that time I've been working with Flex, Spring BlazeDS Integration, Spring MVC, Spring Web Flow, Spring Roo, and other things. &lt;br /&gt;&lt;br /&gt;Spring Roo was very useful.  I made my own add-ons that generated web services based on a JPA bean and even the matching ActionScript class.  I'm going to try working on a better version based on the new Spring Roo add-on format when I have time.  What I did so far is checked into &lt;a href="http://svn.springbyexample.org/modules/sbe-roo/trunk/"&gt;subversion&lt;/a&gt;.  It was developed against Spring Roo 1.0.0.RC1 before there was standardized add-on format.  I was very rushed when I did this, so it's functional but very basic and needs to be redone.&lt;br /&gt;&lt;br /&gt;SpringOne 2009 in New Orleans was good.  A lot of interesting presentations and nice getting to see different people again.  The cloud presentation in the keynote was very interesting.  Some of the improvements in Spring MVC that are in Spring 3.0 are quite nice.  There is JSR-303 (Bean Validation) support, &lt;a href="http://blog.springsource.com/2009/11/17/spring-3-type-conversion-and-validation/"&gt;Type Conversion and Validation&lt;/a&gt; (blog by Keith Donald), REST support, and an MVC namespace for reduced configuration.  Some of the SpEL (Spring EL) integration with other projects like Spring Integration and Spring Security look really useful.  SpringOne is a really good conference and I'm glad I went.&lt;br /&gt;&lt;br /&gt;I've been working for over a week on upgrading &lt;a href="http://www.springbyexample.org/"&gt;Spring by Example&lt;/a&gt;'s projects to Spring 3.0.0.RC3.  Most have upgraded without any issues, although I'm having trouble upgrading the GWT ones.  I'm going to probably leave them and the dm Server (OSGi) examples as they are for now and finalize the other examples, double check everything is working, and update the documentation so I'll be ready for a release for the Spring 3.0 final release.  The webapps (other than GWT &amp;amp; dm Server ones) have not only been upgraded to Spring 3.0, but have also been upgraded to JPA and following Spring MVC best practices as much as possible if they weren't already.  All of them were changed to use the Spring MVC namespace which reduced their configuration slighlty.  Also the applications with security had their login/logout pages changed to be served through Tiles and support i18n.  When I have time I'd like to change the webapps to use jspx and use RESTful URLs. &lt;br /&gt;&lt;br /&gt;I'm hoping to get a release of &lt;a href="http://www.springbyexample.org/"&gt;Spring by Example&lt;/a&gt; out in the next few days.  Then continue working on everything else and possibly have another release before the end of the year.  I'd also like to get a SpEL and Spring MVC REST examples added to the site.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-5989666794782674936?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/5989666794782674936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=5989666794782674936' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/5989666794782674936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/5989666794782674936'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2009/12/spring-roo-springone-2009-spring-by.html' title='Spring Roo, SpringOne 2009, Spring by Example'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-7397519927125847573</id><published>2009-05-31T21:44:00.000-07:00</published><updated>2009-05-31T22:07:20.957-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring by example'/><category scheme='http://www.blogger.com/atom/ns#' term='spring blazeds integration'/><category scheme='http://www.blogger.com/atom/ns#' term='spring integration'/><title type='text'>Spring, Flex, and other things</title><content type='html'>&lt;span style="font-family: arial;"&gt;&lt;br /&gt;I finally just did another release for Spring by Example.  One example is &lt;a href="http://www.springbyexample.org/examples/simple-flex-webapp.html"&gt;Simple Flex Webapp&lt;/a&gt; and the other is &lt;a href="http://www.springbyexample.org/examples/simple-spring-integration.html"&gt;Simple Spring Integration&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I just did the Flex example recently and the &lt;a href="http://www.springframework.org/spring-integration"&gt;Spring Integration&lt;/a&gt; one was done a little while ago, but I never wrote about it for the site.  There's also a more advanced example using queues and splitting, but I'm not sure if the flow really makes sense although it needs to be the way it is to split and aggregate things.&lt;br /&gt;&lt;br /&gt;I've been working with Flex for a few months now and I still think it's really nice.  It's the best thought out UI framework I've ever worked with.  Besides it looking very nice with minimal effort, it's very easy to do many things, ActionScript is a very comfortable environment for someone that knows Java, JavaScript, and is used to doing web development.  Also, I'm impressed with how many things Adobe has open sourced.  The &lt;a href="http://opensource.adobe.com/wiki/display/blazeds/BlazeDS/"&gt;Adobe BlazeDS&lt;/a&gt; provides a really good bridge between Java and Flex for remoting and messaging.  Also the &lt;a href="http://www.springsource.org/spring-flex"&gt;Spring BlazeDS Integration&lt;/a&gt; project from SpringSource really simplifies configuration and ease of use as you would expect.  I think they've done a really great job again.  &lt;a href="http://www.springframework.org/spring-integration"&gt;Spring Integration&lt;/a&gt; also has integration with &lt;a href="http://www.springsource.org/spring-flex"&gt;Spring BlazeDS Integration&lt;/a&gt; so from a message flow you could send a message to a Flex UI and the flow could wait for a response to come back. &lt;br /&gt;&lt;br /&gt;The &lt;a href="http://opensource.adobe.com/wiki/display/cairngorm/"&gt;Adobe Cairngorm&lt;/a&gt; project for providing client side MVC in Flex is nice too.  It helps provide separation of business logic from UI components and encourages using Flex's data binding to transfer information from the controller to the view using a bound model.  Adobe suggests having the model a singleton, but it would be nice if a dependency injection framework was used instead.  Spring ActionScript gives basic functionality, but just the bare minimum compared to Spring's Java implementation.  Although I think it could become a lot nicer without too much effort.&lt;br /&gt;&lt;br /&gt;I'm going to try to post more Flex examples including more advanced Flex usage as well as ones using messaging.  A bridge can be created between JMS queue and a Flex queue or messages can be sent directly to the Flex queue.  Also, I'd like to start spending more time using the &lt;a href="http://www.springsource.com/products/dmserver"&gt;SpringSource dm Server&lt;/a&gt;.  The new web features that are being added to version 2.0 really interest me.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/examples/simple-flex-webapp.html"&gt;Simple Flex Webapp&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/examples/simple-spring-integration.html"&gt;Simple Spring Integration&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-7397519927125847573?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/7397519927125847573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=7397519927125847573' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/7397519927125847573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/7397519927125847573'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2009/05/spring-flex-and-other-things.html' title='Spring, Flex, and other things'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-6542908605863280484</id><published>2009-04-19T17:19:00.000-07:00</published><updated>2009-04-19T17:47:30.043-07:00</updated><title type='text'>Maven JAXB Generation Part II</title><content type='html'>&lt;span style="font-family:arial;"&gt;I've already done a posting on using Maven to generate JAXB with the Fluent API and this adds making the JAXB beans serializable and setters for lists.  Add the file jaxb-bindings.xjb to the 'src/main/resources' with the config below and JAXB beans will implement serializable.  &lt;br /&gt;&lt;br /&gt;Also by default, collections only have getters.  The &lt;a href="https://jaxb2-commons.dev.java.net/collection-setter-injector/"&gt;JAXB 2.1 Collection setter Injector Plugin&lt;/a&gt; will also generate a setter for any collection.  I found this useful while serializing JAXB beans between Java and ActionScript with &lt;a href="http://opensource.adobe.com/wiki/display/blazeds/BlazeDS/"&gt;BlazeDS&lt;/a&gt; (while using &lt;a href="http://www.springsource.org/spring-flex"&gt;Spring BlazeDS Integration&lt;/a&gt;.  BlazeDS only serializes something if it has a getter and a setter.  Unfortunately I couldn't find this in a Maven repo, but you can install it locally or into your Nexus server.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier;"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;plugin&amp;gt;&lt;br /&gt;    &amp;lt;groupId&amp;gt;org.jvnet.jaxb2.maven2&amp;lt;/groupId&amp;gt;&lt;br /&gt;    &amp;lt;artifactId&amp;gt;maven-jaxb2-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;    &amp;lt;executions&amp;gt;&lt;br /&gt;        &amp;lt;execution&amp;gt;&lt;br /&gt;            &amp;lt;goals&amp;gt;&lt;br /&gt;                &amp;lt;goal&amp;gt;generate&amp;lt;/goal&amp;gt;&lt;br /&gt;            &amp;lt;/goals&amp;gt;&lt;br /&gt;        &amp;lt;/execution&amp;gt;&lt;br /&gt;    &amp;lt;/executions&amp;gt;&lt;br /&gt;    &amp;lt;configuration&amp;gt;&lt;br /&gt;        &amp;lt;extension&amp;gt;true&amp;lt;/extension&amp;gt;&lt;br /&gt;        &amp;lt;args&amp;gt;&lt;br /&gt;            &amp;lt;arg&amp;gt;-Xfluent-api&amp;lt;/arg&amp;gt;&lt;br /&gt;            &amp;lt;arg&amp;gt;-Xcollection-setter-injector&amp;lt;/arg&amp;gt;&lt;br /&gt;        &amp;lt;/args&amp;gt;&lt;br /&gt;        &amp;lt;schemaDirectory&amp;gt;src/main/resources&amp;lt;/schemaDirectory&amp;gt;&lt;br /&gt;        &amp;lt;plugins&amp;gt;&lt;br /&gt;            &amp;lt;plugin&amp;gt;&lt;br /&gt;                &amp;lt;groupId&amp;gt;net.java.dev.jaxb2-commons&amp;lt;/groupId&amp;gt;&lt;br /&gt;                &amp;lt;artifactId&amp;gt;jaxb-fluent-api&amp;lt;/artifactId&amp;gt;&lt;br /&gt;                &amp;lt;version&amp;gt;2.1.8&amp;lt;/version&amp;gt;&lt;br /&gt;            &amp;lt;/plugin&amp;gt;&lt;br /&gt;        &amp;lt;/plugins&amp;gt;&lt;br /&gt;    &amp;lt;/configuration&amp;gt;&lt;br /&gt;    &amp;lt;dependencies&amp;gt;&lt;br /&gt;        &amp;lt;!-- Had to manually install in repo, not in main java.net repo. --&amp;gt;&lt;br /&gt;        &amp;lt;dependency&amp;gt;&lt;br /&gt;            &amp;lt;groupId&amp;gt;org.jvnet.jaxb2-commons&amp;lt;/groupId&amp;gt;&lt;br /&gt;            &amp;lt;artifactId&amp;gt;collection-setter-injector&amp;lt;/artifactId&amp;gt;&lt;br /&gt;            &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;        &amp;lt;/dependency&amp;gt;&lt;br /&gt;    &amp;lt;/dependencies&amp;gt;&lt;br /&gt;&amp;lt;/plugin&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;src/main/resources/jaxb-bindings.xjb&lt;/u&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;jxb:bindings xmlns:jxb="http://java.sun.com/xml/ns/jaxb"&lt;br /&gt;              xmlns:xs="http://www.w3.org/2001/XMLSchema"&lt;br /&gt;              version="1.0"&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;jxb:bindings&amp;gt;&lt;br /&gt;      &amp;lt;jxb:globalBindings&amp;gt;&lt;br /&gt;          &amp;lt;jxb:serializable/&amp;gt;&lt;br /&gt;      &amp;lt;/jxb:globalBindings&amp;gt;&lt;br /&gt;  &amp;lt;/jxb:bindings&amp;gt;&lt;br /&gt; &lt;br /&gt;&amp;lt;/jxb:bindings&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-6542908605863280484?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/6542908605863280484/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=6542908605863280484' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/6542908605863280484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/6542908605863280484'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2009/04/maven-jaxb-generation-part-ii.html' title='Maven JAXB Generation Part II'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-1521333881254479788</id><published>2009-02-16T20:20:00.000-08:00</published><updated>2009-02-16T20:33:50.858-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='validation'/><category scheme='http://www.blogger.com/atom/ns#' term='valang'/><title type='text'>Spring Modules Valang</title><content type='html'>&lt;span style="font-family: arial;"&gt;I've been working on adding enhancements to Spring Modules Valang.  I've added a number of new features so far and I have two versions uploaded to the &lt;a href="http://www.springbyexample.org/maven/repo/"&gt;Spring by Example Maven Repository&lt;/a&gt; (org.springbyexample.validation:sbe-validation).  I have it under a different group id and artifact name so there aren't' any collisions in the future with Spring Modules releases.&lt;br /&gt;&lt;br /&gt;I'm also working on documentation, but that's going to take a little longer to finish.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;             Version 0.91                                     &lt;/p&gt;&lt;div class="itemizedlist"&gt;&lt;ul type="disc"&gt;&lt;li&gt;                     Bytecode generation added to DefaultVisitor as a replacement for reflection accessing                simple properties (BeanPropertyFunction) for a significant performance improvement.                 &lt;/li&gt;&lt;li&gt;                       Basic enum comparison support.  In the expression below                the personType is an enum and the value &lt;code class="code"&gt;STUDENT&lt;/code&gt; will                be convereted to an enum for comparison.  The value must match an enum value on the                type being compared or an exception will be thrown.                        &lt;div class="informalexample"&gt;&lt;code class="code"&gt;&lt;br/&gt;personType EQUALS ['STUDENT']&lt;br/&gt;&lt;/code&gt;&lt;/div&gt;                                          For better performance the                full class name can be specified so the enum can be retrieved during parsing.               The first example is for standard enum and the second one is for an inner enum class .                                          &lt;div class="informalexample"&gt;&lt;code class="code"&gt;&lt;br/&gt;personType EQUALS ['org.springmodules.validation.example.PersonType.STUDENT']&lt;br/&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class="informalexample"&gt;&lt;code class="code"&gt;&lt;br/&gt;personType EQUALS ['org.springmodules.validation.example.Person$PersonType.STUDENT']&lt;br/&gt;&lt;/code&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;               Where clause support.  In the expression below, the part of the expression                &lt;code class="code"&gt;price&lt;/code&gt; will only be evaluated if the &lt;code class="code"&gt;personType&lt;/code&gt; is 'STUDENT'.                       Otherwise the validation will be skipped.                       &lt;br /&gt;&lt;div class="informalexample"&gt;&lt;code class="code"&gt;&lt;br/&gt;price &amp;lt; 100 WHERE personType EQUALS ['STUDENT']&lt;br/&gt;&lt;/code&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;               Improved performance of 'IN'/'NOT IN' if comparing a value to a java.util.Set                it will use Set.contains(value).  Static lists of Strings (ex: 'A', 'B', 'C')                are now stored in a Set instead of an ArrayList.                 &lt;/li&gt;&lt;li&gt;               Functions can be configured in Spring, but need to have their scope set as prototype                and use a FunctionWrapper that is also a prototype bean with &lt;span class="emphasis"&gt;&lt;em&gt;&lt;aop:scoped-proxy&gt;&lt;/em&gt;&lt;/span&gt;                set on it.                 &lt;/li&gt;&lt;li&gt;               Removed servlet dependency from Valang project except for the custom JSP tag                ValangValidateTag needing it, but running Valang no longer requires it.               This involved removing ServletContextAware from it's custom dependency injection.               If someone was using this in a custom function, the function can now be configured                directly in Spring and Spring can inject any "aware" values.                 &lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;p&gt;         &lt;/p&gt;&lt;p&gt;             Version 0.92                            &lt;/p&gt;&lt;div class="itemizedlist"&gt;&lt;ul type="disc"&gt;&lt;li&gt;                     Removed custom dependency injection since functions can be configured in Spring.                 &lt;/li&gt;&lt;li&gt;                         Added auto-discovery of FunctionWrapper beans from the Spring context to                      go with existing auto-discovery of FunctionDefinition beans.                  &lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-1521333881254479788?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/1521333881254479788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=1521333881254479788' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/1521333881254479788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/1521333881254479788'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2009/02/spring-modules-valang.html' title='Spring Modules Valang'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-5247523116475994137</id><published>2009-02-16T20:13:00.000-08:00</published><updated>2009-02-21T07:01:19.346-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='aop'/><title type='text'>Generating Bytecode</title><content type='html'>&lt;span style="font-family: arial;"&gt;&lt;br /&gt;I've been looking at the &lt;a href="http://www.javassist.org/"&gt;Javassist&lt;/a&gt; project.  It's really nice.  It's a higher level API for manipulating and generating bytecode.  Below is an example generating a new class that implements and interface, and then implements the interface.  By generating this, it avoids reflection and is significantly faster in tests I've run.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&lt;br /&gt;ClassPool pool = ClassPool.getDefault();&lt;br /&gt;CtClass cc = pool.makeClass(classFunctionName);&lt;br /&gt;&lt;br /&gt;cc.addInterface(pool.get("org.springmodules.validation.valang.functions.Function"));&lt;br /&gt;&lt;br /&gt;StringBuilder generatedMethod = new StringBuilder();&lt;br /&gt;generatedMethod.append("public Object getResult(Object target) {");&lt;br /&gt;generatedMethod.append("    return ");&lt;br /&gt;generatedMethod.append(" ((" + className + ")target).");&lt;br /&gt;generatedMethod.append(property);&lt;br /&gt;generatedMethod.append("();");&lt;br /&gt;&lt;br /&gt;CtMethod m = CtNewMethod.make(generatedMethod.toString(), cc);&lt;br /&gt;cc.addMethod(m);&lt;br /&gt;&lt;br /&gt;result = (Function)cc.toClass().newInstance();&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-5247523116475994137?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/5247523116475994137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=5247523116475994137' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/5247523116475994137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/5247523116475994137'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2009/02/genearting-bytecode.html' title='Generating Bytecode'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-2786285960340240160</id><published>2009-02-01T20:46:00.001-08:00</published><updated>2009-02-13T11:13:24.069-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring by example'/><category scheme='http://www.blogger.com/atom/ns#' term='jpa'/><category scheme='http://www.blogger.com/atom/ns#' term='jmx'/><category scheme='http://www.blogger.com/atom/ns#' term='velocity'/><title type='text'>Spring by Example Update</title><content type='html'>&lt;span style="font-family: arial;"&gt;I've been working for a while on an update to &lt;a href="http://www.springbyexample.org/"&gt;Spring by Example&lt;/a&gt;.  It just happens to be the 1.00 release so I wanted it to be a little bit bigger.  It's over a years worth of work at this point and I think it shows how much work I've put into it.  I'm happy that it's helping people and will continue to work on it as I have time.  I wish I had more.  Especially to keep doing more work with the Spring dm Server.  Below is a list of the lastest examples posted and I'm working on other ones that I'll hopefully be able to finalize over the next month.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: arial;"&gt;&lt;a href="http://www.springbyexample.org/examples/spring-jmx.html"&gt;Spring JMX&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: arial;"&gt;&lt;a href="http://www.springbyexample.org/examples/jpa-joined-inheritance.html"&gt;JPA Joined Inheritance&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: arial;"&gt;&lt;a href="http://www.springbyexample.org/examples/one-to-many-jpa-hibernate-config.html"&gt;One to Many JPA Hibernate Configuration&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: arial;"&gt;&lt;a href="http://www.springbyexample.org/examples/embedded-spring-web-services.html"&gt;Embedded Spring Web Services&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="font-family: arial;"&gt;&lt;a href="http://www.springbyexample.org/examples/velocity-email-template.html"&gt;Velocity E-mail Template&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-2786285960340240160?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/2786285960340240160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=2786285960340240160' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/2786285960340240160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/2786285960340240160'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2009/02/spring-by-example-update.html' title='Spring by Example Update'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-8745410336731416966</id><published>2008-12-09T19:41:00.000-08:00</published><updated>2009-02-13T11:13:54.038-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jaxb'/><category scheme='http://www.blogger.com/atom/ns#' term='maven'/><title type='text'>Maven generating JAXB with the Fluent API</title><content type='html'>&lt;span style="font-family: arial;"&gt;I thought this was interesting and there wasn't a lot of information on this online.  It's using the Maven JAXB plugin to generate JAXB classes with the Fluent API.  All the regular methods for getting and setting values are available, but there is also an API to chain together setting and creating classes.  Thanks to Steve Berman for the Maven config.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;&lt;u&gt;Standard API&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&lt;br /&gt;PersonResponse personList = new PersonResponse();&lt;br /&gt;&lt;br /&gt;Person person = new Person();&lt;br /&gt;person.setId(ID);&lt;br /&gt;person.setFirstName(FIRST_NAME);&lt;br /&gt;person.setLastName(LAST_NAME);&lt;br /&gt;&lt;br /&gt;Person person2 = new Person();&lt;br /&gt;person2.setId(SECOND_ID);&lt;br /&gt;person2.setFirstName(SECOND_FIRST_NAME);&lt;br /&gt;person2.setLastName(SECOND_LAST_NAME);&lt;br /&gt;&lt;br /&gt;personList.getPerson().add(person);&lt;br /&gt;personList.getPerson().add(person2);&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;&lt;u&gt;Fluent API&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&lt;br /&gt;PersonResponse personList = new PersonResponse().withPerson(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new Person().withId(ID).withFirstName(FIRST_NAME).withLastName(LAST_NAME),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new Person().withId(SECOND_ID).withFirstName(SECOND_FIRST_NAME).withLastName(SECOND_LAST_NAME));&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;Inside the build element's plugins section, this can be added to generate JAXB beans with the Fluent API.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&lt;br /&gt;&amp;lt;plugin&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;groupId&amp;gt;org.jvnet.jaxb2.maven2&amp;lt;/groupId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;artifactId&amp;gt;maven-jaxb2-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;extension&amp;gt;true&amp;lt;/extension&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;args&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;arg&amp;gt;-Xfluent-api&amp;lt;/arg&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/args&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;schemaDirectory&amp;gt;src/main/resources&amp;lt;/schemaDirectory&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;plugins&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;plugin&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;groupId&amp;gt;net.java.dev.jaxb2-commons&amp;lt;/groupId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;artifactId&amp;gt;jaxb-fluent-api&amp;lt;/artifactId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;version&amp;gt;2.1.8&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/plugin&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/plugins&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;executions&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;execution&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;goals&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;goal&amp;gt;generate&amp;lt;/goal&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/goals&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/execution&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/executions&amp;gt;&lt;br /&gt;&amp;lt;/plugin&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;repositories&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;repository&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;id&amp;gt;maven2-repository.dev.java.net&amp;lt;/id&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;name&amp;gt;Java.net Maven 2 Repository&amp;lt;/name&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;url&amp;gt;http://download.java.net/maven/2&amp;lt;/url&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/repository&amp;gt;&lt;br /&gt;&amp;lt;/repositories&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-8745410336731416966?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/8745410336731416966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=8745410336731416966' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/8745410336731416966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/8745410336731416966'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/12/maven-generating-jaxb-with-fluent-api.html' title='Maven generating JAXB with the Fluent API'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-3809338764575758115</id><published>2008-12-05T17:16:00.000-08:00</published><updated>2009-02-13T11:15:01.951-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring by example'/><category scheme='http://www.blogger.com/atom/ns#' term='gwt'/><category scheme='http://www.blogger.com/atom/ns#' term='spring dm server'/><category scheme='http://www.blogger.com/atom/ns#' term='bayeux'/><category scheme='http://www.blogger.com/atom/ns#' term='osgi'/><title type='text'>Spring by Example Wins</title><content type='html'>&lt;span style="font-family: arial;"&gt;I was going to really try to get back into working on the book, but I think I realistically don't have the time.  I did make a small update to &lt;a href="http://www.springindepth.com/"&gt;Spring In-depth, In Context&lt;/a&gt; before SpringOne started, but I was thinking about how Spring 3.0 is coming out soon so I would need to go through everything again.  Posting examples on &lt;a href="http://www.springbyexample.org/"&gt;Spring by Example&lt;/a&gt; is less effort since each example is more or less standalone and I'm primarily writing up something specifically on the example.  Instead of trying to explain the subject completely, which involves a lot more research and effort.  Maybe one day I'll try to get back into working on it, but I actually think hands on examples are probably more valuable.  At least that what I always like to see.  I typically just want to get going on a project and I'll learn all the nuances of the technology as I go.  Possibly the preface and intro from the book can become part of the &lt;a href="http://www.springbyexample.org/"&gt;Spring by Example&lt;/a&gt; documentation at some point.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;Based on this decision I moved the work I had done for the book to &lt;a href="http://www.springbyexample.org/"&gt;Spring by Example&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/examples/spring-bayeuex-gwt-chat-webapp.html"&gt;&lt;span style="font-family: arial;"&gt;Spring Bayeux GWT Chat Webapp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/examples/spring-bayeuex-gwt-monitor-webapp.html"&gt;&lt;span style="font-family: arial;"&gt;Spring Bayeux GWT Trade Monitor Webapp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/examples/part-sdms.html"&gt;&lt;span style="font-family: arial;"&gt;Spring dm Server Section&lt;/span&gt;&lt;/a&gt; and the &lt;a href="http://www.springbyexample.org/examples/sdms-simple-message-service.html"&gt;&lt;span style="font-family: arial;"&gt;Spring dm Server Simple Message Service&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-3809338764575758115?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/3809338764575758115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=3809338764575758115' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/3809338764575758115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/3809338764575758115'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/12/spring-by-example-wins.html' title='Spring by Example Wins'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-4635493602093386395</id><published>2008-12-02T16:50:00.000-08:00</published><updated>2008-12-02T16:56:14.299-08:00</updated><title type='text'>SpringOne Americas 2008 Presentation</title><content type='html'>&lt;span style="font-family:arial;"&gt;SpringOne has been really interesting so far.  Rossen Stoyanchev gave a really excellent presentation on all the nuances and best practices for using Spring MVC Annotations.  I'll need to update all my web examples, because there's at least one thing if not more that could be done more elegantly.  Like using the @ModelAttribute on a method to populate the model for a form instead of using a dummy method just for a create (so the form has an instance to bind to).&lt;br /&gt;&lt;br /&gt;My presentation on GWT &amp;amp; Dojo Cometd with Spring Bayeux is tomorrow morning.  I've put a lot of work into the presentation, writing up what I could for &lt;a href="http://www.springindepth.com/"&gt;Spring In Depth, In Context&lt;/a&gt;, and getting the examples cleaned up as much as possible and checked into Subversion.  Hopefully the presentation will go well and everyone will find it interesting.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.springindepth.com/book/gwt-comet-gwt-dojo-cometd-spring-bayeux-jetty.html"&gt;&lt;span style="font-family:arial;"&gt;GWT &amp;amp; Dojo Cometd Client with Spring Bayeux on Jetty&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-4635493602093386395?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/4635493602093386395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=4635493602093386395' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/4635493602093386395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/4635493602093386395'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/12/springone-americas-2008.html' title='SpringOne Americas 2008 Presentation'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-9159678988570512362</id><published>2008-12-02T10:54:00.000-08:00</published><updated>2008-12-04T09:35:19.218-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gwt'/><category scheme='http://www.blogger.com/atom/ns#' term='spring dm server'/><category scheme='http://www.blogger.com/atom/ns#' term='osgi'/><category scheme='http://www.blogger.com/atom/ns#' term='spring in-depth book'/><title type='text'>Spring by Example &amp; 'Spring In-depth, In Context'</title><content type='html'>&lt;span style="font-family:arial;"&gt;I've made updates to both sites.  &lt;a href="http://www.springbyexample.org/"&gt;Spring by Example&lt;/a&gt; doesn't have anything too major, but the last site release updated the &lt;a href="http://www.springbyexample.org/examples/spring-by-example-web-module.html"&gt;Spring by Example Web Module&lt;/a&gt; to version 1.1.1.  For &lt;a href="http://www.springindepth.com/"&gt;Spring In-depth, In Context&lt;/a&gt;, I finally had time to get the Chat and Trade Monitor examples I made for my SpringOne presentation posted and written up for Jetty.  The examples are checked in except for the Trade Monitor example running an embedded Jetty in Tomcat.  This is the same as the Trade Monitor that runs under Jetty, was just to show that you could still use Jetty's Bayeux implementation even if you were on Tomcat.&lt;br /&gt;&lt;br /&gt;Also I finally had time to post a simple Spring dm Server example showing side-by-side versioning.  It has a version 1.0 and 1.1 of a message service.  The version 1.0 uses Commons Lang 2.1.0 and version 1.1 uses Commons Lang 2.4.0.  There is a web module that just displays the data and you can switch back and forth between the two different message services at runtime.  I'll work on this section more to add screen shots and a more detailed explanation of things, but I wanted to get what was ready posted.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.springindepth.com/book/gwt-comet.html"&gt;&lt;span style="font-family:arial;"&gt;GWT &amp;amp; Comet Integration with Spring&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.springindepth.com/book/sdms-basics.html"&gt;&lt;span style="font-family:arial;"&gt;Spring dm Server &amp;amp; OSGi Basics&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-9159678988570512362?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/9159678988570512362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=9159678988570512362' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/9159678988570512362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/9159678988570512362'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/12/spring-by-example-spring-in-depth-in.html' title='Spring by Example &amp; &apos;Spring In-depth, In Context&apos;'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-2301765475885590224</id><published>2008-11-26T20:19:00.000-08:00</published><updated>2008-11-26T20:33:11.451-08:00</updated><title type='text'>Maven &amp; No Commons Logging</title><content type='html'>&lt;span style="font-family:arial;"&gt;Maven includes Commons Logging by default, which isn't what you really want if you'd like to use SLF4J for your logging facade.  A nice solution to fake out Maven was written at this &lt;a href="http://day-to-day-stuff.blogspot.com/2007/10/announcement-version-99-does-not-exist.html"&gt;blog&lt;/a&gt;.  Basically you have a fake version 99.0 as an empty jar named the same as Commons Logging so it's downloaded instead.  &lt;br /&gt;&lt;br /&gt;I noticed builds were running really slow and it seems that he Maven repository (http://no-commons-logging.zapto.org/mvn2) has been down for days.  As a temporary solution I've put the no Commons Logging jars into the Spring by Example repo and put a mirror entry into my settings.xml.  &lt;br /&gt;&lt;br /&gt;It would be nice if Maven just had a way to do global excludes if you don't want a jar no matter what transitive dependencies are resolved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;u&gt;~/.m2/settings.xml&lt;/u&gt;&lt;br /&gt;&amp;lt;settings&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;mirrors&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;mirror&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;id&amp;gt;no-commons-logging&amp;lt;/id&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;name&amp;gt;No Commons Logging&amp;lt;/name&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;url&amp;gt;http://www.springbyexample.org/maven/repo&amp;lt;/url&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;mirrorof&amp;gt;no-commons-logging&amp;lt;/mirrorof&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/mirror&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/mirrors&amp;gt;&lt;br /&gt;&amp;lt;/settings&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-2301765475885590224?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/2301765475885590224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=2301765475885590224' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/2301765475885590224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/2301765475885590224'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/11/maven-no-commons-logging.html' title='Maven &amp; No Commons Logging'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-1917997123300738696</id><published>2008-11-19T08:23:00.000-08:00</published><updated>2008-11-19T14:25:02.173-08:00</updated><title type='text'>SpringOne Americas 2008</title><content type='html'>&lt;span style="font-family:arial;"&gt;I'm presenting this year at &lt;a href="http://americas.springone.com/"&gt;SpringOne Americas 2008&lt;/a&gt;.  I'm really looking forward to it and have been working on examples and the slides for the conference.  That's why I haven't posted much lately.  I'll be presenting a Case Study of my investigation of GWT, Comet, and Bayeux integration with Spring for developing a trade monitor.  I'll be posting the examples soon and will also write about them, but the slides will just be for those that the attend the conference.  It should be a very good conference.  I really enjoyed it last year.  It's one of the more technical conferences I've been to.&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://americas.springone.com/conference/speaker/david_winterfeldt.html"&gt;&lt;span style="font-family:arial;"&gt;Speaker Profile&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-1917997123300738696?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/1917997123300738696/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=1917997123300738696' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/1917997123300738696'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/1917997123300738696'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/11/springone-americas-2008.html' title='SpringOne Americas 2008'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-6509025793329040878</id><published>2008-10-26T12:21:00.000-07:00</published><updated>2008-11-18T19:44:24.361-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring by example'/><category scheme='http://www.blogger.com/atom/ns#' term='gwt'/><category scheme='http://www.blogger.com/atom/ns#' term='comet'/><title type='text'>GWT &amp; Comet Spring Integration</title><content type='html'>&lt;span style="font-family:arial;"&gt;I'm making good progress integrating GWT &amp;amp; Comet with Spring.  I just posted an update to the &lt;a href="http://www.springbyexample.org/static/0.92/html/ar25.html"&gt;Spring by Example Web Module&lt;/a&gt; for a basic Spring GWT Controller and Spring Bayeux configuration for Comet on Jetty.  Basically there is a Spring version of the Bayeux implementation and can configure it completely in Spring.  Then it can be injected into &lt;span style="font-style: italic;"&gt;BayeuxService&lt;/span&gt; implementations and there is a servlet that gets Bayeux from Spring instead of creating it.  I think I'll possibly have a GWT version of the Dojo Comet Chat example soon.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-6509025793329040878?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/6509025793329040878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=6509025793329040878' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/6509025793329040878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/6509025793329040878'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/10/gwt-comet-spring-integration.html' title='GWT &amp; Comet Spring Integration'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-6967951166362793444</id><published>2008-10-22T20:18:00.000-07:00</published><updated>2008-10-27T09:27:58.030-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring by example'/><title type='text'>Spring by Example RSS Feed</title><content type='html'>&lt;span style="font-family:arial;"&gt;The &lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;a href="http://www.springbyexample.org/"&gt;Spring by Example&lt;/a&gt; main RSS feed has been updated to a new url, which is &lt;a href="http://www.springbyexample.org/feed/"&gt;http://www.springbyexample.org/feed/&lt;/a&gt;.  Before the feed was generated by the TWiki so it wasn't also including the static examples.  Also, sometimes something on the TWiki was accidentally posted before it was ready and then stayed in a bad state on sites like Google Reader.  The &lt;a href="http://www.springbyexample.org/twiki/bin/view/Main/WebRss"&gt;TWiki RSS feed&lt;/a&gt; is still active.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-6967951166362793444?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/6967951166362793444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=6967951166362793444' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/6967951166362793444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/6967951166362793444'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/10/spring-by-example-rss-feed.html' title='Spring by Example RSS Feed'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-3356040029012137127</id><published>2008-10-22T18:49:00.000-07:00</published><updated>2008-10-22T20:20:09.243-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring by example'/><title type='text'>Spring by Example Update</title><content type='html'>&lt;span style="font-family:arial;"&gt;I finally had time to update the example site and add a new module, but I've decided to start posting &lt;a href="http://www.springbyexample.org/"&gt;Spring by Example&lt;/a&gt; site specific postings on it's own blog (&lt;a href="http://springbyexample.blogspot.com/"&gt;http://springbyexample.blogspot.com/&lt;/a&gt;).  I'll use this blog for more about what I've been doing.&lt;br /&gt;&lt;br /&gt;The new module is &lt;a href="http://www.springbyexample.org/static/0.91/html/ar19.html"&gt;Custom ServletContext Scope Module&lt;/a&gt;.  It let's you use Spring's custom scope to store beans in the web applications &lt;span style="font-style: italic;"&gt;ServletContext&lt;/span&gt;.  I needed this to refactor some old webapps that were sharing data using a static class and wanted to have them share the data in the &lt;span style="font-style: italic;"&gt;ServletContext&lt;/span&gt;, but I don't have time to completely refactor them.&lt;br /&gt;&lt;br /&gt;I also have a simple OSGi example using the Spring dm Server that I'll post and write up when I have time.  Otherwise I've been putting a lot of time into working on GWT, Comet, and Spring integration.  I'll eventually post more on this too when I get further along.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-3356040029012137127?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/3356040029012137127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=3356040029012137127' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/3356040029012137127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/3356040029012137127'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/10/spring-by-example-update.html' title='Spring by Example Update'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-5855669282476699919</id><published>2008-10-11T16:19:00.000-07:00</published><updated>2008-10-11T16:23:27.828-07:00</updated><title type='text'>Commons Configuration with Spring Modules</title><content type='html'>&lt;span style="font-family:arial;"&gt;DanielP has kindly posted an example on how to use Commons Configuration with Spring Modules for loading properties from a database and using them in your Spring Configuration.  Thank you DanielP.&lt;br /&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/SpringModulesWithCommonsConfiguration"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:arial;"&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/SpringModulesWithCommonsConfiguration"&gt;Spring Modules with Commons Configuration&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-5855669282476699919?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/5855669282476699919/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=5855669282476699919' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/5855669282476699919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/5855669282476699919'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/10/commons-configuration-with-spring.html' title='Commons Configuration with Spring Modules'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-5848120637059275351</id><published>2008-08-12T04:26:00.000-07:00</published><updated>2008-08-12T04:34:49.056-07:00</updated><title type='text'>Spring by Example Content Update</title><content type='html'>&lt;span style="font-family:arial;"&gt;I've updated all of the examples on &lt;/span&gt;&lt;span style="font-family:arial;"&gt; &lt;a href="http://www.springbyexample.org/"&gt;Spring by Example&lt;/a&gt; by making them&lt;/span&gt;&lt;span style="font-family:arial;"&gt; static content instead of being served in the &lt;a href="http://www.springbyexample.org/twiki/bin/view/Main/WebHome"&gt;TWiki&lt;/a&gt;.  I think the formatting is improved and I think it will make maintaining things easier.  The &lt;a href="http://www.springbyexample.org/twiki/bin/view/Main/WebHome"&gt;Spring by Example TWiki&lt;/a&gt; is still running and available for user contributions.&lt;br /&gt;&lt;br /&gt;This is the first draft converting the content.  If you find any errors or problems with any examples, please let me know.&lt;br /&gt;&lt;a href="http://www.springbyexample.org/static/0.9/html/"&gt;&lt;br /&gt;&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/static/0.9/html/"&gt;Spring by Example Table of Contents&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-5848120637059275351?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/5848120637059275351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=5848120637059275351' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/5848120637059275351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/5848120637059275351'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/08/spring-by-example-content-update.html' title='Spring by Example Content Update'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-3386315760648270382</id><published>2008-08-04T05:10:00.001-07:00</published><updated>2008-08-04T05:27:47.293-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring by example'/><category scheme='http://www.blogger.com/atom/ns#' term='spring web services'/><category scheme='http://www.blogger.com/atom/ns#' term='spring framework'/><title type='text'>Spring Web Services Example</title><content type='html'>&lt;span style="font-family:arial;"&gt;I ended up having time to finish up a really basic Spring Web Services example using JAXB for marshalling.  It was very simple.  Really once you have a project setup you will just have to focus on your XSD and business logic.  It's nice having the marshalling/unmarshalling handled for you, but if the XML you're receiving becomes larger and you just need a specific part of it you can create a method that uses &lt;span style="font-style: italic;"&gt;@XPathParam&lt;/span&gt; annotation in front of method variables to get a few values.&lt;br /&gt;&lt;br /&gt;In the current example once everything is setup the client just has to make a call on the &lt;span style="font-style: italic;"&gt;WebServiceTemplate&lt;/span&gt; passing in the request and receiving the response.  Both are JAXB generated beans.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PersonResponse response =&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (PersonResponse) wsTemplate.marshalSendAndReceive(request);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/SimpleSpringWebServices"&gt;&lt;span style="font-family:arial;"&gt;Simple Spring Web Services&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;em&gt;&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-3386315760648270382?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/3386315760648270382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=3386315760648270382' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/3386315760648270382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/3386315760648270382'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/08/spring-web-services-example.html' title='Spring Web Services Example'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-7011622321099204202</id><published>2008-08-02T22:10:00.000-07:00</published><updated>2008-08-04T05:27:27.553-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tiles'/><category scheme='http://www.blogger.com/atom/ns#' term='spring by example'/><category scheme='http://www.blogger.com/atom/ns#' term='spring mvc'/><category scheme='http://www.blogger.com/atom/ns#' term='gwt'/><category scheme='http://www.blogger.com/atom/ns#' term='spring framework'/><title type='text'>Simple GWT Spring Webapp Example</title><content type='html'>&lt;span style="font-family:arial;"&gt;I finally had time to finish up the GWT example I've been working on.  I may add a bit more to it in the future (like an autocomplete search widget), but there is a lot there and should be helpful getting people started integrating GWT with Spring. &lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/SimpleGwtSpringWebapp"&gt;&lt;span style="font-family:arial;"&gt;Simple GWT Spring Webapp&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:arial;"&gt;My general impression of using GWT is positive.  It's definitely nice that you can work in Java and all the JavaScript is generated for you.  Especially that it should perform well and work in different browers.  It's a little tedious keeping everything in sync between the static servlet I use when running GWT in debug mode (avoids integrating Spring and injection into GWT debug) and the Spring controller.  Also to have GWT use the main message resource for internationalization, a JavaScript object has to be maintained on the static HTML and JSP page (GWT debug vs. Spring webapp).  It also wasn't obvious that if I made a bean to use with the main GWT entry point class that it had to be in the same package or a subpackage.&lt;br /&gt;&lt;br /&gt;Also, as a side note, I have the person form working using Spring JS.  It isn't too much work once I realized that it was working, but Spring Web Flow was refreshing the page afterword until I added at the end of the 'save' transition a render element specifying to only update the 'content' fragment.  Otherwise only the 'onclick' attribute of the save button has to be modified.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier;"&gt;&lt;br /&gt;&amp;lt;input type="submit" id="save"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="_eventId_save" value="&amp;lt;fmt:message key="button.save"&amp;gt;"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; onclick="Spring.remoting.submitForm('save', 'person', {fragments:'content'}); return false;"/&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;You currently can't specify a target div for returned fragments.  I filed a JIRA (&lt;a href="http://jira.springframework.org/browse/SWF-817"&gt;Enhance AjaxEventDecoration in Spring JS to specify a Target Div&lt;/a&gt;) to allow a targetId.  Ideally it will be a list like fragments so you can specify what fragment goes with what div.  I wanted to be able to have menu links refresh the content div without refreshing the entire page.  Current funtionally assumes that you would just use AJAX for updates within functional areas.  Like, I'm on the person page and want to just update the messages and personForm divs with fragments.  So the fragment is expected to be wrapped in the div that is already is on the page and they are automatically matched up and updated.  I think it will be a useful feature and hopefully will get added in an upcoming release.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-7011622321099204202?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/7011622321099204202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=7011622321099204202' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/7011622321099204202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/7011622321099204202'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/08/simple-gwt-spring-webapp-example.html' title='Simple GWT Spring Webapp Example'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-8371146044330448146</id><published>2008-07-27T00:10:00.000-07:00</published><updated>2008-08-04T05:27:13.720-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tiles'/><category scheme='http://www.blogger.com/atom/ns#' term='spring by example'/><category scheme='http://www.blogger.com/atom/ns#' term='spring mvc'/><category scheme='http://www.blogger.com/atom/ns#' term='gwt'/><category scheme='http://www.blogger.com/atom/ns#' term='spring framework'/><title type='text'>Spring by Example JDBC, Spring Dynamic Tiles Module, and Google Web Toolkit</title><content type='html'>&lt;span style="font-family:arial;"&gt;I almost have everything ready to post a simple &lt;a href="http://code.google.com/webtoolkit/"&gt;Google Web Toolkit&lt;/a&gt; (GWT) example with Spring.  I have everything checked in and I also had to update &lt;a href="http://www.springbyexample.org/twiki/bin/view/Main/Downloads#Spring_by_Example_JDBC_Module"&gt;Spring by Example JDBC&lt;/a&gt; and &lt;a href="http://www.springbyexample.org/twiki/bin/view/Main/Downloads#Dynamic_Tiles_Module"&gt;Spring by Example Dynamic Tiles Module&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Main/Downloads#Spring_by_Example_JDBC_Module"&gt;Spring by Example JDBC&lt;/a&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt; version 1.0.3 was upgraded to match changes in Spring 2.5.5 and &lt;span style="font-style: italic;"&gt;HsqldbInitializingDriverManagerDataSource&lt;/span&gt; &amp;amp; &lt;span style="font-style: italic;"&gt;InitializingDriverManagerDataSource&lt;/span&gt; were changed to use &lt;span style="font-style: italic;"&gt;SimpleDriverDataSource&lt;/span&gt; (which was added in Spring 2.5.5).&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Main/Downloads#Dynamic_Tiles_Module"&gt;Spring by Example Dynamic Tiles Module&lt;/a&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt; 1.1 has a number of changes.  The project was updated to use Spring 2.5.5, AJAX support like Spring JS and Spring Web Flow is provided, and a few other items (see release notes in the projects README.txt).  Also, &lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Main/Downloads#Dynamic_Tiles_Module"&gt;Spring by Example Dynamic Tiles Module&lt;/a&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt; 1.0 was compiled with Java 6, but should have been compiled with Java 5.  The projects are basically all ready, but just need a little more testing.  Although everything is checked into Subversion.&lt;br /&gt;&lt;br /&gt;I'll try to get everything finalized and checked in over the next couple of days.  I think the AJAX support that works with Spring JS' &lt;span style="font-style: italic;"&gt;Spring.remoting.submitForm&lt;/span&gt; is great.  It's really nice to have simple and easy control over updating specific div sections that match parts of a Tiles template.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-8371146044330448146?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/8371146044330448146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=8371146044330448146' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/8371146044330448146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/8371146044330448146'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/07/google-web-toolkit.html' title='Spring by Example JDBC, Spring Dynamic Tiles Module, and Google Web Toolkit'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-1992397462769838718</id><published>2008-07-10T21:05:00.000-07:00</published><updated>2008-08-04T05:26:05.004-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring by example'/><category scheme='http://www.blogger.com/atom/ns#' term='hibernate'/><category scheme='http://www.blogger.com/atom/ns#' term='spring framework'/><title type='text'>Spring JPA Example with Hibernate</title><content type='html'>&lt;span style="font-family:arial;"&gt;This took longer than I expected since I was able to reuse the Entity beans from the Hibernate annotation example.  I had a lot of trouble getting the right jars to work together.  Hopefully the Maven config in the project will help someone else.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/OneToManyJpaHibernateConfiguration"&gt;&lt;span style="font-family:arial;"&gt;One to Many JPA Hibernate Configuration&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:arial;"&gt;The key things besides the classpath to get setup in the example were just the Spring Config and putting the JPA configuration in META-INF/persistence.xml.  Also the &lt;span style="font-style: italic;"&gt;LocalContainerEntityManagerFactoryBean&lt;/span&gt; actually returns a &lt;span style="font-style: italic;"&gt;javax.persistence.EntityManagerFactory&lt;/span&gt;.  I assumed it returned an &lt;span style="font-style: italic;"&gt;EntityManger&lt;/span&gt; based on the name of the class.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;One other point is that &lt;span style="font-style: italic;"&gt;JpaDaoSupport&lt;/span&gt;&lt;/span&gt; has &lt;span style="font-style: italic;"&gt;setEntityManger&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;setEntityManagerFactory&lt;/span&gt; as final.  So you can't override them, use &lt;span style="font-style: italic;"&gt;@Autowired&lt;/span&gt;, then super the value to the parent method.  I ended up passing in the &lt;span style="font-style: italic;"&gt;EntityManagerFactory&lt;/span&gt; in the constructor using &lt;span style="font-style: italic;"&gt;@Autowired&lt;/span&gt;.  Which is probably better since it's required, but I'm used to typically using setters in Spring.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;"&gt;Note&lt;/span&gt;: This example has the DAO class extend &lt;span style="font-style: italic;"&gt;JpaDaoSupport&lt;/span&gt; and uses the &lt;span style="font-style: italic;"&gt;JpaTemplate&lt;/span&gt;, but Spring recommends the native JPA style of coding.&lt;br /&gt;&lt;br /&gt;"&lt;/span&gt;&lt;span class="emphasis"&gt;&lt;em&gt;JpaTemplate mainly exists as a sibling of JdoTemplate and HibernateTemplate, offering the same style for people used to it.  &lt;/em&gt;&lt;/span&gt;&lt;span class="emphasis"&gt;&lt;em&gt;or newly started projects, consider adopting the native JPA style of coding data access objects instead, based on a "shared EntityManager" reference obtained through the JPA &lt;tt class="literal"&gt;@PersistenceContext&lt;/tt&gt; annotation&lt;/em&gt;&lt;/span&gt;." (from &lt;a href="http://static.springframework.org/spring/docs/2.5.x/reference/orm.html#orm-jpa"&gt;Spring 2.5.x JPA documentation&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-1992397462769838718?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/1992397462769838718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=1992397462769838718' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/1992397462769838718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/1992397462769838718'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/07/spring-jpa-example-with-hibernate.html' title='Spring JPA Example with Hibernate'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-4159554975790316151</id><published>2008-07-10T04:39:00.000-07:00</published><updated>2008-08-04T05:25:25.708-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring framework'/><title type='text'>Spring Config with Zero XML</title><content type='html'>&lt;span style="font-family:arial;"&gt;So, if you really don't want to use any XML to configure Spring and you also don't want to use the Spring JavaConfig project (create beans using Java code), you can actually use annotation-based config.  I found this looking at the &lt;span style="font-style: italic;"&gt;context:component-scan &lt;/span&gt;unit tests.  You just create a &lt;/span&gt;&lt;span style="font-style: italic;"&gt;GenericApplicationContext&lt;/span&gt; and a &lt;span style="font-style: italic;"&gt;ClassPathBeanDefinitionScanner&lt;/span&gt;.  Then call refresh on the context load the bans and register a shutdown hook so you get destruction callbacks on your beans when the JVM is shutdown.  The &lt;span style="font-style: italic;"&gt;ClassPathBeanDefinitionScanner &lt;/span&gt;registers the &lt;span style="font-style: italic;"&gt;@Autowired&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;@Required&lt;/span&gt; bean post processors.  It also registers the JSR-250 Commons Annotations and the &lt;span style="font-style: italic;"&gt;PersistenceAnnotationBeanPostProcessor&lt;/span&gt; for JPA if their jars are in the classpath.  It's pretty straightforward.&lt;br /&gt;&lt;br /&gt;Also it could be a good way to unit test how many beans are being pick up by the &lt;span style="font-style: italic;"&gt;context:component-scan&lt;/span&gt; in case you're worried you configured the packages it's scanning incorrectly.&lt;br /&gt;&lt;br /&gt;A downside to this is that if you are using the Spring IDE in Eclipse, you won't be able to register an XML file with it.  The latest version handles XML configured beans and ones that are scanned so you can get consolidated bean graphs and all the other help it provides.  I personally wouldn't do this and it's worth having a very, very small XML file just to define &lt;span style="font-style: italic;"&gt;context:component-scan&lt;/span&gt; directly.&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;String basePackage = this.getClass().getPackage().getName();&lt;br /&gt;&lt;div id="1en8" class="ArwC7c ckChnd"&gt;&lt;br /&gt;GenericApplicationContext ctx = new GenericApplicationContext();&lt;br /&gt;ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner&lt;wbr&gt;(ctx);&lt;br /&gt;int beanCount = scanner.scan(basePackage);&lt;br /&gt;&lt;br /&gt;ctx.refresh();&lt;br /&gt;ctx.registerShutdownHook();&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-4159554975790316151?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/4159554975790316151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=4159554975790316151' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/4159554975790316151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/4159554975790316151'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/07/spring-config-with-zero-xml.html' title='Spring Config with Zero XML'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-5262446183187523410</id><published>2008-07-07T17:12:00.000-07:00</published><updated>2008-08-04T05:29:07.755-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring framework'/><category scheme='http://www.blogger.com/atom/ns#' term='spring in-depth book'/><title type='text'>Spring In-depth, In Context</title><content type='html'>&lt;span style="font-family:arial;"&gt;I've been working for a while on a book for Spring 2.5.  I've decided to post it for free online and hopefully it will be useful to people.  It currently has a very good introduction to Spring, basic bean creation using XML and Annotations.  Although the Annotations chapter isn't 100% complete.  There are also partially complete chapters on resources &amp;amp; ApplicationContexts and AOP.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;As updates are available, I'll continue to post them.  I decided since there was a lot of information and examples done, it was better to release it now and continue to work on it when I have free time.  I hope it helps people.  It was a lot of work getting even this much done.  There are so many nuances to Spring's configuration options between XML and Annotation-based configuration.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Also, a very special thanks to Susan Kerschbaumer who has co-authored the book with me and has personally done a really excellent job with what she has done so far.  Currently Susan has only had time to work on the Preface, Chapter 1, and Chapter 2.  But as she has time she will focus on other chapters.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;a href="http://www.springindepth.com/"&gt;Spring In-depth, In Context&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;    &lt;li&gt;&lt;a href="http://www.springindepth.com/2.5.x/0.10/pr01.html"&gt;Preface&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;    &lt;li&gt;&lt;a href="http://www.springindepth.com/2.5.x/0.10/ch01.html"&gt;Chapter 1: Spring In Context: Core Concepts&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;    &lt;li&gt;&lt;a href="http://www.springindepth.com/2.5.x/0.10/ch02.html"&gt;Chapter 2: A Practical Introduction to Inversion of Control&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;    &lt;li&gt;&lt;a href="http://www.springindepth.com/2.5.x/0.10/ch03.html"&gt;Chapter 3: In-depth Inversion of Control (IoC) [Draft]&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;    &lt;li&gt;&lt;a href="http://www.springindepth.com/2.5.x/0.10/ch04.html"&gt;Chapter 4: Annotation-based Bean Configuration [Draft]&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;    &lt;li&gt;&lt;a href="http://www.springindepth.com/2.5.x/0.10/ch05.html"&gt;Chapter 5: Bean &amp;amp; Resource Loading [Draft]&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;    &lt;li&gt;&lt;a href="http://www.springindepth.com/2.5.x/0.10/ch06.html"&gt;Chapter 6 :AOP [Draft]&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-5262446183187523410?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/5262446183187523410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=5262446183187523410' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/5262446183187523410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/5262446183187523410'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/07/spring-in-depth-in-context.html' title='Spring In-depth, In Context'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-6671253002693557465</id><published>2008-06-24T18:57:00.000-07:00</published><updated>2008-06-25T04:46:43.204-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring by example'/><category scheme='http://www.blogger.com/atom/ns#' term='spring web flow'/><category scheme='http://www.blogger.com/atom/ns#' term='spring framework'/><title type='text'>Spring Web Flow 2.0 Subflows</title><content type='html'>&lt;span style="font-family: arial;"&gt;I have a simple subflow working with Spring Web Flow 2.0.  It also has success messages and validation controlled by the flow.  The example builds on &lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/SimpleSpringWebFlowWebapp"&gt;Simple Spring Web Flow Webapp&lt;/a&gt; by adding an address subflow to the person flow along with displaying a message resource after a successful save.  Validation for the flow and subflow are handled automatically by Spring Web Flow.  The person flow uses a bean, &lt;/span&gt;&lt;span style="font-family: arial;"&gt;&lt;span style="font-style: italic;"&gt;personValidator&lt;/span&gt;,&lt;/span&gt;&lt;span style="font-family: arial;"&gt; named to match the flow.  The address flow has a method, '&lt;span style="font-style: italic;"&gt;validateAddressForm(MessageContext context)&lt;/span&gt;', in the &lt;span style="font-style: italic;"&gt;Address&lt;/span&gt; class that matches the id of the view-state it should be called for&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/SpringWebFlowSubflowWebapp"&gt;&lt;span style="font-family:arial;"&gt;Spring Web Flow Subflow Webapp&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family: arial;"&gt;&lt;br /&gt;The subflow was a little bit of work.  It's pretty straightfoward, but I wasn't used to reading the error messages from Web Flow showing all the scope variables.  Also, I couldn't find a specific example doing a subflow for Spring Web Flow 2.0.  Basically the input needs to be configured in the &lt;i&gt;subflow-state&lt;/i&gt; and then again at the beginning of the subflow, and the output needs to be configured the same way.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;u&gt;Excerpt from Person Flow&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;subflow-state id="address" subflow="address"&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;input name="id" value="addressId"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;input name="person" value="person"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;output name="address" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;transition on="saveAddress" to="personForm"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;evaluate expression="personDao.saveAddress(id, address)" result="flowScope.person" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;set name="flashScope.statusMessageKey" value="'address.form.msg.success'" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/transition&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;transition on="cancelAddress" to="personForm" /&amp;gt;&lt;br /&gt;&amp;lt;/subflow-state&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Excerpt from Address Subflow&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;input name="id" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;input name="person" /&amp;gt;&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;end-state id="saveAddress"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;output name="address" value="address"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/end-state&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-6671253002693557465?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/6671253002693557465/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=6671253002693557465' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/6671253002693557465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/6671253002693557465'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/06/spring-web-flow-20-subflows.html' title='Spring Web Flow 2.0 Subflows'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-6759769602724482708</id><published>2008-06-19T10:26:00.000-07:00</published><updated>2008-06-19T11:00:12.583-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring web flow'/><title type='text'>Spring Web Flow Request Exception</title><content type='html'>&lt;span style="font-family: arial;"&gt;In the previous post on Spring Web Flow 2.0, I mentioned that I was getting a 'Could not complete request' error as an IllegalStateException at the end of the flow.  I found the issue.  It was because the URL in the flow handler wasn't a context relative one.  I was returning 'person/search', but that was just being added to the end of the current URL.  The correct value to return is 'contextRelative:/person/search.html' (the servlet-mapping for the &lt;i&gt;DispatcherServlet&lt;/i&gt; is '*.html').  With this working, I was able to remove the view attribute from the &lt;span style="font-style: italic;"&gt;end-state&lt;/span&gt; elements in the flow.  See the &lt;/span&gt;&lt;span style="font-family: arial;"&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/SimpleSpringWebFlowWebapp"&gt;Simple Spring Web Flow Webapp&lt;/a&gt; example for more information.&lt;br /&gt;&lt;br /&gt;@Component&lt;br /&gt;public class PersonFlowHandler extends AbstractFlowHandler {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/**&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Where the flow should go when it ends.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@Override&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public String handleExecutionOutcome(FlowExecutionOutcome outcome,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HttpServletRequest request, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HttpServletResponse response) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return getContextRelativeUrl(PersonController.SEARCH_VIEW_KEY);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/**&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Where to redirect if there is an exception not handled by the flow.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@Override&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public String handleException(FlowException e, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HttpServletRequest request, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HttpServletResponse response) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (e instanceof NoSuchFlowExecutionException) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return getContextRelativeUrl(PersonController.SEARCH_VIEW_KEY);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw e;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/**&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Gets context relative url with an '.html' extension.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private String getContextRelativeUrl(String view) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return "contextRelative:" + view + ".html";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-6759769602724482708?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/6759769602724482708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=6759769602724482708' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/6759769602724482708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/6759769602724482708'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/06/spring-web-flow-request-exception.html' title='Spring Web Flow Request Exception'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-7353222270004354816</id><published>2008-06-17T22:31:00.000-07:00</published><updated>2008-06-19T11:02:25.705-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring by example'/><category scheme='http://www.blogger.com/atom/ns#' term='spring web flow'/><category scheme='http://www.blogger.com/atom/ns#' term='spring framework'/><title type='text'>Simple Spring Web Flow 2.0 Example Ready</title><content type='html'>&lt;span style="font-family:arial;"&gt;I finally have a very Simple Spring Web Flow 2.0 example ready.  It's building on the Spring MVC annotation-based Controller and Spring Security 2.0 examples I did recently.  I'm actually still working on a more advanced example showing how to have a subflow for Person addresses, but I wanted to post what was working so far and it might be less confusing to people as they're getting started since there is less going on.&lt;br /&gt;&lt;br /&gt;There is an error currently when leaving the flow from a save and a cancel.  It says 'Could not complete request' and is an IllegalStateException.  It seems to be some problem with a redirect, but everything works fine.&lt;br /&gt;&lt;br /&gt;The more advanced subflow example just needs to have messages and validation added to it., and I might try to switch it from using a Hibernate DAO class to using Spring Web Flow's built in JPA persistence hooks.  It really took a long time to get the subflow working.  I had to try a lot of different things to get the address id passed into the subflow.  Spring Web Flow is really nice, but there could be a lot more documentation and examples illustrating things like this.  I couldn't find any concrete examples doing this for Spring Web Flow 2.0.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/SimpleSpringWebFlowWebapp"&gt;&lt;/a&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/SimpleSpringWebFlowWebapp"&gt;&lt;span style="font-family:arial;"&gt;Simple Spring Web Flow Webapp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;The person flow uses Spring Security to limit the flow to a 'ROLE_USER'.  Based on whether or not an &lt;i&gt;id&lt;/i&gt; attribute is available, the &lt;i&gt;decision-state&lt;/i&gt; element will forward to a 'createPerson' or 'editPerson' &lt;i&gt;action-state&lt;/i&gt;.  The 'createPerson' one uses El to create a new Person instance for the form to bind to using a method on the person controller.  The edit uses the person DAO instance to look up the person record.  They both forward to the 'personForm' where you can save or cancel, and save uses the person DAO to save the person instance.  The person instance is automatically bound by specifying the &lt;i&gt;model&lt;/i&gt; attribute as 'person' on the &lt;i&gt;view-state&lt;/i&gt;.  Both cancel and save then populate the latest search results and forward to the search page.&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;flow xmlns="http://www.springframework.org/schema/webflow"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;xsi:schemaLocation="http://www.springframework.org/schema/webflow&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;secured attributes="ROLE_USER" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;input name="id" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;decision-state id="createOrEdit"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;if test="id == null" then="createPerson" else="editPerson" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/decision-state&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;action-state id="createPerson"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;evaluate expression="personController.newPerson()"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result="flowScope.person" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;transition to="personForm" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/action-state&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;action-state id="editPerson"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;evaluate expression="personDao.findPersonById(id)"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result="flowScope.person" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;transition to="personForm" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/action-state&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;view-state id="personForm" model="person" view="/person/form"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;transition on="save" to="savePerson"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;evaluate expression="personDao.save(person)" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;evaluate expression="personDao.findPersons()"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result="flowScope.persons" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/transition&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;transition on="cancel" to="cancelPerson" bind="false"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;evaluate expression="personDao.findPersons()"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result="flowScope.persons" /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/transition&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/view-state&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;end-state id="savePerson" view="/person/search" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;end-state id="cancelPerson" view="/person/search" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/flow&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-7353222270004354816?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/7353222270004354816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=7353222270004354816' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/7353222270004354816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/7353222270004354816'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/06/simple-spring-web-flow-20-example-ready.html' title='Simple Spring Web Flow 2.0 Example Ready'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-7545558527427427214</id><published>2008-06-09T21:44:00.000-07:00</published><updated>2008-06-19T11:01:54.188-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring by example'/><category scheme='http://www.blogger.com/atom/ns#' term='spring framework'/><category scheme='http://www.blogger.com/atom/ns#' term='spring security'/><title type='text'>Using Spring Security to Secure a Webapp</title><content type='html'>&lt;span style="font-family:arial;"&gt;I had to go to a few different places to get all this working, but I have simple security on a webapp that secures the URLs and a method on a DAO interface.  Besides securing the delete method in the DAO interface, the link is also hidden from non-admin users.  I have this working with JDBC authentication and also with static users defined in the XML (which are commented out, but still in the XML configuration).&lt;br /&gt;&lt;br /&gt;Basically you just need to define a security filter, configure Spring Security in an XML file, secure methods either with pointcuts in the XML or with annotations. &lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/SimpleSpringSecurityWebapp"&gt;&lt;span style="font-family:arial;"&gt;Simple Spring Security Webapp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Secure DAO Method&lt;/u&gt;&lt;br /&gt;Either secure with an annotation-based config, as in the example posted.&lt;br /&gt;&lt;br /&gt;&amp;lt;security:global-method-security secured-annotations="enabled" /&amp;gt;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;&amp;nbsp; * Deletes person.&lt;br /&gt;&amp;nbsp; */&lt;br /&gt;@Secured ({"ROLE_ADMIN"})&lt;br /&gt;public void delete(Person person);&lt;br /&gt;&lt;br /&gt;Or as a pointcut in the XML configuration.&lt;br /&gt;&lt;br /&gt;&amp;lt;security:global-method-security&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- Any delete method in a class ending in 'Dao' in the 'org.springbyexample.orm.hibernate3.annotation.dao' package. --&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;security:protect-pointcut &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; expression="execution(* org.springbyexample.orm.hibernate3.annotation.dao.*Dao.delete(..))"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;access="ROLE_ADMIN"/&amp;gt;&lt;br /&gt;&amp;lt;/security:global-method-security&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;In Spring Security Config&lt;/u&gt;&lt;br /&gt;&amp;lt;security:authentication-provider&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;security:jdbc-user-service data-source-ref="dataSource" /&amp;gt;&lt;br /&gt;&amp;lt;/security:authentication-provider&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;SQL Script&lt;/u&gt;&lt;br /&gt;Script works for HSQLDB and based on &lt;a href="http://www.acegisecurity.org/dbinit.txt"&gt;Spring Security Script&lt;/a&gt;.  The ACL tables aren't defined because they aren't used at all in this example.&lt;br /&gt;&lt;br /&gt;SET IGNORECASE TRUE;&lt;br /&gt;&lt;br /&gt;CREATE TABLE users (&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; username VARCHAR(50) NOT NULL PRIMARY KEY,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; password VARCHAR(50) NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; enabled BIT NOT NULL&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;CREATE TABLE authorities (&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; username VARCHAR(50) NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; authority VARCHAR(50) NOT NULL&lt;br /&gt;);&lt;br /&gt;CREATE UNIQUE INDEX ix_auth_username ON authorities (username, authority);&lt;br /&gt;&lt;br /&gt;ALTER TABLE authorities ADD CONSTRAINT fk_authorities_users foreign key (username) REFERENCES users(username);&lt;br /&gt;&lt;br /&gt;INSERT INTO users VALUES ('david', 'newyork', true);&lt;br /&gt;INSERT INTO users VALUES ('alex', 'newjersey', true);&lt;br /&gt;INSERT INTO users VALUES ('tim', 'illinois', true);&lt;br /&gt;&lt;br /&gt;INSERT INTO authorities VALUES ('david', 'ROLE_USER');&lt;br /&gt;INSERT INTO authorities VALUES ('david', 'ROLE_ADMIN');&lt;br /&gt;INSERT INTO authorities VALUES ('alex', 'ROLE_USER');&lt;br /&gt;INSERT INTO authorities VALUES ('tim', 'ROLE_USER');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-7545558527427427214?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/7545558527427427214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=7545558527427427214' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/7545558527427427214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/7545558527427427214'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/06/using-spring-security-to-secure-webapp.html' title='Using Spring Security to Secure a Webapp'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-1189598588541256620</id><published>2008-06-08T11:25:00.000-07:00</published><updated>2008-06-19T11:01:08.996-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring by example'/><category scheme='http://www.blogger.com/atom/ns#' term='ltw'/><category scheme='http://www.blogger.com/atom/ns#' term='spring framework'/><category scheme='http://www.blogger.com/atom/ns#' term='aop'/><category scheme='http://www.blogger.com/atom/ns#' term='maven'/><category scheme='http://www.blogger.com/atom/ns#' term='aspectj'/><title type='text'>Unit Testing AspectJ Load-time Weaving with Maven</title><content type='html'>&lt;span style="font-family: arial;"&gt;&lt;br /&gt;This came up as a question on the Spring forums and I actually spent a bit of time trying to figure out how to get the unit test working properly when I did this originally.  To unit test AspectJ Load-time Weaving (LTW), the surefire plugin needs to be configured to take the LTW agent.  Which in this example is the Spring Agent.  Also, the test needs to be run in it's own JVM so the javaagent argument can be applied.&lt;br /&gt;&lt;br /&gt;The dependency on spring-agent can have it's scope set to 'provided'.  It isn't needed as part of the build since it's used as a command line argument and Maven still downloads the jar so it can be referenced for the test in the local Maven repository.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/AspectJLoadTimeWeavingInSpring"&gt;AspectJ Load-time Weaving in Spring&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Note&lt;/i&gt;: The argLine element should all be together on one line, but was separated to display in the blog entry.&lt;br /&gt;&lt;br /&gt;&amp;lt;properties&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;spring.version&amp;gt;2.5.4&amp;lt;/spring.version&amp;gt;&lt;br /&gt;&amp;lt;/properties&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;dependency&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &amp;lt;groupId&amp;gt;org.springframework&amp;lt;/groupId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactId&amp;gt;spring-agent&amp;lt;/artifactId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;version&amp;gt;${spring.version}&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;&lt;br /&gt;&amp;lt;/dependency&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;plugin&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactId&amp;gt;maven-surefire-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;version&amp;gt;2.4&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;forkMode&amp;gt;once&amp;lt;/forkMode&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;argLine&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -javaagent:${settings.localRepository}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /org/springframework/spring-agent/${spring.version}/&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; spring-agent-${spring.version}.jar&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/argLine&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;useSystemClassloader&amp;gt;true&amp;lt;/useSystemClassloader&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/configuration&amp;gt;&lt;br /&gt;&amp;lt;/plugin&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-1189598588541256620?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/1189598588541256620/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=1189598588541256620' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/1189598588541256620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/1189598588541256620'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/06/unit-testing-aspectj-load-time-weaving.html' title='Unit Testing AspectJ Load-time Weaving with Maven'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-9153916826807661779</id><published>2008-06-06T12:49:00.000-07:00</published><updated>2008-06-06T20:30:10.500-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='i18n'/><category scheme='http://www.blogger.com/atom/ns#' term='maven'/><title type='text'>Maven Internationalized Compilation Issue</title><content type='html'>&lt;span style="font-family:arial;"&gt;I've never had this come up before, but as I was working on a security that was using the  internationalization (i18n) from the  &lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/BasicWebappInternationalization"&gt;Basic Webapp Internationalization&lt;/a&gt; I decided to add actually inserting a UTF-8 Korean name into the database.  This ended up revealing a bug in the&lt;br /&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/SpringByExampleJDBC"&gt;Spring by Example JDBC Module&lt;/a&gt;.  It wasn't correctly setting the encoding type when reading in a script file.  This was easy enough to fix and I made a 1.0.2 release with that and a few other changes including better unit testing for UTF-8 scripts.&lt;br /&gt;&lt;br /&gt;I had everything working in Eclipse, but I couldn't successfully run the tests from the command line.  I spent quite a while on this and finally realized it was the actual compilation step that was causing a problem.  It took a long time because debugging in Eclipse, everything was fine.&lt;br /&gt;&lt;br /&gt;The solution to the problem was to explicitly add the character encoding type to the Maven compiler plugin.  Eclipse was automatically correctly setting the encoding.  After doing the internationalization examples, it seems like everything is still stuck the way it was 7-10 years ago for the most part.  You would think that everything should default to the way Java stores a &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/String.html"&gt;&lt;i&gt;java.lang.String&lt;/i&gt;&lt;/a&gt; (UTF-16).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;plugin&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;artifactid&gt;maven-compiler-plugin&amp;lt;/artifactid&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;source&amp;gt;1.5&amp;lt;/source&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;target&amp;gt;1.5&amp;lt;/target&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;encoding&amp;gt;UTF-8&amp;lt;/encoding&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/configuration&amp;gt;&lt;br /&gt;&amp;lt;/plugin&amp;gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-9153916826807661779?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/9153916826807661779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=9153916826807661779' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/9153916826807661779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/9153916826807661779'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/06/maven-internationalized-compilation.html' title='Maven Internationalized Compilation Issue'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-5351709027199887617</id><published>2008-05-24T13:13:00.000-07:00</published><updated>2008-06-06T20:30:36.954-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring by example'/><category scheme='http://www.blogger.com/atom/ns#' term='spring mvc'/><category scheme='http://www.blogger.com/atom/ns#' term='spring framework'/><title type='text'>Simple Form using Spring MVC Annotations</title><content type='html'>&lt;span style="font-family:arial;"&gt;I just posted a new example using Spring 2.5's new MVC annotations. The new annotations seem pretty nice.  I'm not always for tightly coupling configuration with annotations, but in this case most controllers normally have a single purpose.  Plus, you still have the XML configuration as an option if a looser coupling between controller and mappings is needed.&lt;br /&gt;&lt;br /&gt;The webapp has basic create, update, delete, and search functionality for a person form. The form basically just has a hidden id (primary key), first name, and last name fields.  The example uses Spring MVC annotations, Tiles 2 with Spring By Example's &lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/DynamicTilesSpringMVCModule"&gt;Dynamic Tiles Spring MVC Module&lt;/a&gt;, Hibernate configured with annotations and used in Spring with a Hibernate template, and internationalized messages.  So a requested URL will go through a controller if there is a mapping, data may be put in place for the page to render, message resources are also put into scope for the page to render, and finally the Dynamic Tiles view renderer takes the request URL and uses it as the body of a default Tiles template.  &lt;/span&gt;&lt;span style="font-family:arial;"&gt;The example is released under the Apache 2.0 license.&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:arial;"&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/SimpleSpringMVCFormAnnotationConfigWebapp"&gt;Simple Spring MVC Form Annotation Configuration Webapp&lt;br /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;The @RequestMapping annotation is used to indicate what requests a method should handle and can handle Ant style patterns to match a request (not shown below).  The @RequestParam annotation can be used to have a request parameter automatically mapped to a variable in the method signature.  Or a class can be specified, like in the save method, and any values from the request that can be bound to an instance of the class will be and that instance will be passed into the method.&lt;br /&gt;&lt;br /&gt;The create method shows that an Object returned will automatically put into the model based on the classes' name (Person.class --&gt; 'person').&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;Excerpt from Controller&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;pre class="prettyprint"&gt;&lt;span class="lit"&gt;@Controller&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;PersonController&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="kwd"&gt;final&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Logger&lt;/span&gt;&lt;span class="pln"&gt; logger &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;LoggerFactory&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;getLogger&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;PersonController&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="kwd"&gt;private&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;final&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; FORM_VIEW_KEY &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"/form/person"&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="kwd"&gt;private&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;final&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; SEARCH_VIEW_KEY &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"/search/person"&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="kwd"&gt;private&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;final&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; FORM_MODEL_KEY &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"person"&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="kwd"&gt;private&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;final&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; SEARCH_MODEL_KEY &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"persons"&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Creates a person object and forwards to person form.&lt;br /&gt;*/&lt;br /&gt;@RequestMapping(value="/form/person.html")&lt;br /&gt;public Person create() {&lt;br /&gt;   return new Person();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="com"&gt;/**&lt;br /&gt;* Gets a person based on it's id.&lt;br /&gt;*/&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="lit"&gt;@RequestMapping&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;value&lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="str"&gt;"/info/person.html"&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;ModelAndView&lt;/span&gt;&lt;span class="pln"&gt; info&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;@RequestParam&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"id"&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Integer&lt;/span&gt;&lt;span class="pln"&gt; id&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;   &lt;/span&gt;&lt;span class="typ"&gt;Person&lt;/span&gt;&lt;span class="pln"&gt; result &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; personDao&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;findPersonById&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;id&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;   &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;new&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;ModelAndView&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;FORM_VIEW_KEY&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;                           FORM_MODEL_KEY&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;                           result&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="com"&gt;/**&lt;br /&gt;* Saves a person.&lt;br /&gt;*/&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="lit"&gt;@RequestMapping&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;value&lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="str"&gt;"/save/person.html"&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;ModelAndView&lt;/span&gt;&lt;span class="pln"&gt; save&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;Person&lt;/span&gt;&lt;span class="pln"&gt; person&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;   personDao&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;save&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;person&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;   &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;new&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;ModelAndView&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;FORM_VIEW_KEY&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;                           FORM_MODEL_KEY&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;                           person&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="pln"&gt;    &lt;/span&gt;&lt;span class="com"&gt;/**&lt;br /&gt;* Searches for all persons and returns them in a&lt;br /&gt;* &lt;code&gt;Collection&lt;/code&gt; as 'persons' in the&lt;br /&gt;* &lt;code&gt;ModelMap&lt;/code&gt;.&lt;br /&gt;*/&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="lit"&gt;@RequestMapping&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;value&lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="str"&gt;"/search/person.html"&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;ModelMap&lt;/span&gt;&lt;span class="pln"&gt; search&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;   &lt;/span&gt;&lt;span class="typ"&gt;Collection&lt;/span&gt;&lt;span class="pun"&gt;&lt;&lt;/span&gt;&lt;span class="typ"&gt;Person&lt;/span&gt;&lt;span class="pun"&gt;&gt;&lt;/span&gt;&lt;span class="pln"&gt; lResults &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; personDao&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;findPersons&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;   &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;new&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;ModelMap&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;SEARCH_MODEL_KEY&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; lResults&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="pun"&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-5351709027199887617?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/5351709027199887617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=5351709027199887617' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/5351709027199887617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/5351709027199887617'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/05/simple-form-using-spring-mvc.html' title='Simple Form using Spring MVC Annotations'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-536149775532818054</id><published>2008-05-24T11:57:00.000-07:00</published><updated>2008-05-24T21:27:14.839-07:00</updated><title type='text'>JavaOne 2008</title><content type='html'>&lt;span style="font-family:arial;"&gt;JavaOne was interesting this year.  It was non-stop from morning until late at night between presentations, meeting people, and parties in the evening.  I wish more of the presentations were more technical, but many were to convey new technologies, JSRs, etc. and didn't have time to delve in-depth.  Although, spec leads don't always make the best lecturers even though they know the subject well.  Two very good speakers were Brian Goetz and Joshua Bloch.&lt;br /&gt;&lt;br /&gt;Brian Goetz's presentation of possible new concurrency features in Java 7 was very interesting.  A key feature is to allow a large task that can keep being forked to build a work queue and let the VM manage threading and delegating the task to available CPUs.  From what he said, this will apparently scale much better than the way things are handled currently on large multi-core systems, which will become more and more prevalent.  Built on top of this forking will be ParallelArrays which will allow much better concurrent processing of large arrays by delegating tasks like getting the max value, sums, filtering, etc. to multiple core processors and then processing the results coming back from all the cores.&lt;br /&gt;&lt;br /&gt;Joshua Bloch has an update to his Effective Java book adding around 20 more examples.  Apparently his example of creating the classic singleton with a private constructor that returns an instance through a method is hackable in some way (he didn't go over the code) and he said the best way to create a singleton is to use an Enum since then the VM will enforce the singleton paradigm for you.  Otherwise he covered some interesting tips on more effectively using enums instead of using complicated two dimensional arrays to contain the data.  He signed autographs of the new book at the book store a number of times and I believe his book was the top seller at the book store.&lt;br /&gt;&lt;br /&gt;Getting to see new technologies was probably the highlight of JavaOne for me.  &lt;a href="http://www.sentilla.com/"&gt;Sentilla&lt;/a&gt; has a new wireless sensor device that uses Java ME.  They had them setup at the conference to record temperature, CO2 levels, and used an IR sensor to track people coming in and out of conference rooms.  I got a dev kit to play with, but I still need to order some sensors for it (comes with a built in accelerometer).  The new Java Speech API presentation was really interesting.  It looks very easy to use for speech recognition and synthesis.  The spec lead from &lt;a href="http://www.conversay.com/"&gt;Conversay&lt;/a&gt; did a great demo of their implementation for mobile devices.  In a completely normal voice he was able to create a reminder.  They've apparently worked on this for 3 years and this implementation in just 256K of memory (main engine not in Java).  I was also able to attend the JSR-303 Bean Validation presentation.  It's nice to finally see that there will be a validation implementation in the Java language for people to leverage.  Validation is very often overlooked by developers even thought it's very important, but hopefully this will help make validation much more accesible to the average developer.  In the final keynote address with James Gosling, there were a number of interesting things.  There was a Java powered car with quite a number of sensors on it.  The JMars project uses Java to help correlate all the data we've been receiving from Mars to make it easier to review.  It was pretty cool that they showed a satellite image and were able to bring up a rover view of the same spot.  Also an arrow pointed between the two images to indicate the rock you saw from orbit was the same one the rover was looking at.  Someone from CERN labs was there and apparently almost everything they have is Java powered.  Lot's of Swing GUIs and probably one of the cooler things was seeing Java 3D show the result of a collision and all the subatomic particles generated.&lt;br /&gt;&lt;br /&gt;It's really amazing what Java is being used for and how much better the performance is compared to 10 years ago.  It's also amazing how far Open Source projects have come and their wide acceptance in corporate culture.  SpringSource, the developers of the Spring Framework, have become a very large company based their framework.  I saw people from SpringSource every night I was out.  Oddly there were only 3 Spring presentations at JavaOne (two of new features in Spring 2.5 by Rod Johnson and a Spring Security presentation by Ben Alex).  I say oddly because according to SpringSource, Spring has surpassed EJBs as the primary skillset requested on job boards from developers.  I felt Sun focused a little too much on it's technologies.  It is supposed to be JavaOne, not SunOne.  There's nothing wrong with an Open Source project surpassing something in Java EE.  In fact I think that this is what gives Java an edge over .NET.  Without all the great open source initiatives, it would be a much more level playing field between the two.&lt;br /&gt;&lt;br /&gt;I'm glad I was able to attend and hopefully I will be able to attend again next year.  &lt;/span&gt;&lt;span style="font-family:arial;"&gt;I had time to see Tim O'Brien, author of the Jakarta Commons Cookbook (among others), and current Maven Sage.  I also met Emmanuel Bernard, the specification lead for JSR-303, briefly after his presentation.  I was able to talk to a few people from SpringSource that I met at The Spring Experience too&lt;/span&gt;&lt;span style="font-family:arial;"&gt;.  I highly recommend going to The Spring Experience if you're using Spring or want to.   It looks like Java will be more and more places that you might not expect it over the next year.  Hopefully it will be another good year for Java and the language and Open Source projects will continue to evolve to fulfill everyone's needs.  I'm happy that I still enjoy programming in it and also to be getting back involved in Open Source.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-536149775532818054?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/536149775532818054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=536149775532818054' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/536149775532818054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/536149775532818054'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/05/javaone-2008.html' title='JavaOne 2008'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-5539368723031033177</id><published>2008-05-24T11:46:00.000-07:00</published><updated>2008-06-06T20:31:02.374-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring by example'/><category scheme='http://www.blogger.com/atom/ns#' term='hibernate'/><category scheme='http://www.blogger.com/atom/ns#' term='spring framework'/><title type='text'>Spring Hibernate Examples</title><content type='html'>&lt;span style="font-family:arial;"&gt;Before JavaOne I was able to post some Hibernate examples to &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.springbyexample.org/"&gt;Spring by Example&lt;/a&gt;&lt;span style="font-family:arial;"&gt;. They are simple examples showing how to configure Hibernate with XML or annotations and setting them up with a Spring Hibernate template. There is also one example showing how to use transactions and also how to do a transactional JUnit 4 test.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;ul style="font-family: arial;"&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/SimpleHibernateXmlConfiguration"&gt;Simple Hibernate XML Configuration&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/OneToManyHibernateXmlConfiguration"&gt;One to Many Hibernate XML Configuration&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/OneToManyHibernateAnnotationConfiguration"&gt;One to Many Hibernate Annotation Configuration&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/HibernateTransactionAnnotationConfiguration"&gt;Hibernate Transaction Annotation Configuration&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/SimpleSpringTransactionalJUnit4Test"&gt;Simple Spring Transactional JUnit 4 Test&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-5539368723031033177?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/5539368723031033177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=5539368723031033177' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/5539368723031033177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/5539368723031033177'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/05/hibernate-examhttpwwwbloggercomimggllin.html' title='Spring Hibernate Examples'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-8879783213852452398</id><published>2008-03-26T06:10:00.000-07:00</published><updated>2008-06-06T20:31:22.031-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='maven'/><title type='text'>JAXB with Maven</title><content type='html'>Finally Sun has Maven repositories for getting Sun jars and also they have a nice plugin for generating JAXB 2 classes with Maven using the &lt;a href="https://maven-jaxb2-plugin.dev.java.net/"&gt;maven-jaxb2 plugin&lt;/a&gt;.  It defaults to generating schemas located in &lt;span style="font-style: italic;"&gt;src/main/resources&lt;/span&gt; and the generated output goes to &lt;span style="font-style: italic;"&gt;target/generated-sources/xjc&lt;/span&gt;.  The generated output will automatically be included in your final jar.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Excerpt from pom.xml&lt;/u&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;dependency&amp;gt;&lt;br /&gt;    &amp;lt;groupId&amp;gt;javax.xml.bind&amp;lt;/groupId&amp;gt;&lt;br /&gt;    &amp;lt;artifactId&amp;gt;jaxb-api&amp;lt;/artifactId&amp;gt;&lt;br /&gt;    &amp;lt;version&amp;gt;2.1&amp;lt;/version&amp;gt;&lt;br /&gt;    &amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;&lt;br /&gt;&amp;lt;/dependency&amp;gt;&lt;br /&gt;&amp;lt;dependency&amp;gt;&lt;br /&gt;    &amp;lt;groupId&amp;gt;javax.xml&amp;lt;/groupId&amp;gt;&lt;br /&gt;    &amp;lt;artifactId&amp;gt;jaxb-impl&amp;lt;/artifactId&amp;gt;&lt;br /&gt;    &amp;lt;version&amp;gt;2.1&amp;lt;/version&amp;gt;&lt;br /&gt;    &amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;&lt;br /&gt;&amp;lt;/dependency&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;build&amp;gt;&lt;br /&gt;   &amp;lt;plugins&amp;gt;&lt;br /&gt;       &amp;lt;plugin&amp;gt;&lt;br /&gt;           &amp;lt;groupid&amp;gt;org.jvnet.jaxb2.maven2&amp;lt;/groupid&amp;gt;&lt;br /&gt;           &amp;lt;artifactid&amp;gt;maven-jaxb2-plugin&amp;lt;/artifactid&amp;gt;&lt;br /&gt;           &amp;lt;executions&amp;gt;&lt;br /&gt;               &amp;lt;execution&amp;gt;&lt;br /&gt;                   &amp;lt;goals&amp;gt;&lt;br /&gt;                       &amp;lt;goal&amp;gt;generate&amp;lt;/goal&amp;gt;&lt;br /&gt;                   &amp;lt;/goals&amp;gt;&lt;br /&gt;               &amp;lt;/execution&amp;gt;&lt;br /&gt;           &amp;lt;/executions&amp;gt;&lt;br /&gt;       &amp;lt;/plugin&amp;gt;&lt;br /&gt;   &amp;lt;/plugins&amp;gt;&lt;br /&gt;&amp;lt;/build&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;repositories&amp;gt;&lt;br /&gt;   &amp;lt;repository&amp;gt;&lt;br /&gt;       &amp;lt;id&amp;gt;maven2-repository.dev.java.net&amp;lt;/id&amp;gt;&lt;br /&gt;       &amp;lt;name&amp;gt;Java.net Maven 2 Repository&amp;lt;/name&amp;gt;&lt;br /&gt;       &amp;lt;url&amp;gt;http://download.java.net/maven/2&amp;lt;/url&amp;gt;&lt;br /&gt;   &amp;lt;/repository&amp;gt;&lt;br /&gt;&amp;lt;/repositories&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- For maven-jaxb2-plugin --&amp;gt;&lt;br /&gt;&amp;lt;pluginrepositories&amp;gt;&lt;br /&gt;   &amp;lt;pluginrepository&amp;gt;&lt;br /&gt;       &amp;lt;id&amp;gt;maven2-repository.dev.java.net&amp;lt;/id&amp;gt;&lt;br /&gt;       &amp;lt;name&amp;gt;Java.net Maven 2 Repository&amp;lt;/name&amp;gt;&lt;br /&gt;       &amp;lt;url&amp;gt;http://download.java.net/maven/2&amp;lt;/url&amp;gt;&lt;br /&gt;   &amp;lt;/pluginrepository&amp;gt;&lt;br /&gt;&amp;lt;/pluginrepositories&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-8879783213852452398?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/8879783213852452398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=8879783213852452398' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/8879783213852452398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/8879783213852452398'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/03/jaxb-with-maven.html' title='JAXB with Maven'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-257345774830404325.post-5681808037104727959</id><published>2008-03-07T22:13:00.000-08:00</published><updated>2008-05-24T11:44:09.814-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring by example'/><category scheme='http://www.blogger.com/atom/ns#' term='spring framework'/><title type='text'>Spring by Example Site is Open!</title><content type='html'>&lt;span style="font-family:arial;"&gt;The &lt;a href="http://www.springbyexample.org/"&gt;Spring by Example&lt;/a&gt; site is finally open!  I've been working this for a couple of months, but wanted it to be fairly nice when it went live.  It has a few good examples and I have more to post.  A few people I know have said they will contribute examples as they have time also.  These are some of my favorite examples posted so far.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/CustomThreadScopeExample"&gt;Custom Thread Scope&lt;/a&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Spring custom scope implementation for thread scoped beans.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/DynamicTilesSpringMVCModule"&gt;Dynamic Tiles Spring MVC Module&lt;/a&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Have a default Tiles definition that takes the url of an incoming request and assumes it should be the request body and dynamically inserts the url into the default definition.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/SpringByExampleJDBC"&gt;Spring by Example JDBC&lt;/a&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Some nice utitlies for helping initialize scripts and to make it easier using HSQL DB.  They are especially useful for unit tests.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/SpringByExampleJCRModule"&gt;Spring by Example JCR Module&lt;/a&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Utilities for helping to recurse through JCR Nodes.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/SpringByExampleHttpClientTemplate"&gt;Spring by Example Util's HttpClientTemplate&lt;/a&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Callback template around Commons HttpClient.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;a href="http://www.springbyexample.org/twiki/bin/view/Example/SpringByExampleHttpClientOxmTemplate"&gt;Spring by Example Util's HttpClientOxmTemplate&lt;/a&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Callback template around Commons HttpClient that uses Spring OXM to marshall and unmarshall XML for HTTP requests.&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;Tim Voet also posted an example using a &lt;span style="font-style: italic;"&gt;BeanPostProcessor&lt;/span&gt; to dynamically insert a logger based on the bean's class if it has a &lt;span style="font-style: italic;"&gt;setLogger&lt;/span&gt; method. This is a nice way to avoid typos when creating loggers.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/257345774830404325-5681808037104727959?l=davidwinterfeldt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwinterfeldt.blogspot.com/feeds/5681808037104727959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=257345774830404325&amp;postID=5681808037104727959' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/5681808037104727959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/257345774830404325/posts/default/5681808037104727959'/><link rel='alternate' type='text/html' href='http://davidwinterfeldt.blogspot.com/2008/03/spring-by-example-site-is-open.html' title='Spring by Example Site is Open!'/><author><name>David Winterfeldt</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
