<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DUcFQHYzfCp7ImA9WhRUFUU.&quot;"><id>tag:blogger.com,1999:blog-11593374</id><updated>2012-01-26T14:10:11.884Z</updated><category term="firefox" /><category term="Mobile" /><category term="Gaming" /><category term="Leadership" /><category term="Trac" /><category term="Agile" /><category term="Ruby" /><category term="Subversion" /><category term="Linux" /><category term="Thunderbird" /><category term="Shopping" /><category term="Spring" /><category term="Apache" /><category term="Windows" /><category term="Java" /><category term="Blog" /><category term="Web" /><category term="Guitar" /><title>Andrew Beacock's Blog</title><subtitle type="html">&lt;a href="/search/label/Agile"&gt;agile&lt;/a&gt; / &lt;a href="/search/label/Apache"&gt;apache&lt;/a&gt; / &lt;a href="/search/label/Java"&gt;java&lt;/a&gt; / &lt;a href="/search/label/Leadership"&gt;leadership&lt;/a&gt; / &lt;a href="/search/label/Linux"&gt;linux&lt;/a&gt; / &lt;a href="/search/label/Mobile"&gt;mobile&lt;/a&gt; / &lt;a href="/search/label/Ruby"&gt;ruby&lt;/a&gt; / &lt;a href="/search/label/Subversion"&gt;subversion&lt;/a&gt; / &lt;a href="/search/label/Web"&gt;web&lt;/a&gt;</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://blog.andrewbeacock.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>243</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/andrewbeacock" /><feedburner:info uri="andrewbeacock" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><logo>http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png</logo><feedburner:emailServiceId>andrewbeacock</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site.</feedburner:browserFriendly><entry gd:etag="W/&quot;DUcFQHYzcCp7ImA9WhRUFUU.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-5274102223674917289</id><published>2012-01-25T23:47:00.003Z</published><updated>2012-01-26T14:10:11.888Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-26T14:10:11.888Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Web" /><title>Beware of JavaScript's parseInt function - 010 does not equal 10...</title><content type="html">I use JavaScript &amp;amp; jQuery quite a bit in my day job helping to add a bit of 'shiny' to our web applications. One feature that I added recently kept a track of the percentages that you had typed in the form.&amp;nbsp; It told you at the bottom of the page how much percentage you had left - I used JavaScript's parseInt function to help me in this respect.&lt;br /&gt;
&lt;br /&gt;
As the application passed through system test it was found that if you typed '020' as a percentage my application said that you had 84% left to assign rather than the expected 80% - any ideas what's going on?&lt;br /&gt;
&lt;br /&gt;
Yes that's right - the leading zero was causing &lt;a href="http://www.w3schools.com/jsref/jsref_parseInt.asp"&gt;parseInt&lt;/a&gt; to treat the number as an octal (base 8) number and so 020 was two lots of 8 = 16. It appears that this &lt;a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/parseInt#ECMAScript_5_Removes_Octal_Interpretation"&gt;octal recognition is being deprecated&lt;/a&gt; but who knows when it will actually go so for now I've had to add ", 10" (i.e. a decimal radix) to the end of all of my parseInt calls:&lt;br /&gt;
&lt;pre&gt;parseInt(percentage, 10);
&lt;/pre&gt;Double check any code that you use which uses parseInt to make sure it doesn't trip you up in the same way that I way!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-5274102223674917289?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=pYGGzoLhH0A:5546VxkVxDQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=pYGGzoLhH0A:5546VxkVxDQ:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=pYGGzoLhH0A:5546VxkVxDQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=pYGGzoLhH0A:5546VxkVxDQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=pYGGzoLhH0A:5546VxkVxDQ:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=pYGGzoLhH0A:5546VxkVxDQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=pYGGzoLhH0A:5546VxkVxDQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/5274102223674917289/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=5274102223674917289" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/5274102223674917289?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/5274102223674917289?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/pYGGzoLhH0A/beware-of-javascripts-parseint-010-does.html" title="Beware of JavaScript's parseInt function - 010 does not equal 10..." /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2012/01/beware-of-javascripts-parseint-010-does.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkQCRHkzeCp7ImA9WhRTEU0.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-2263854981946561518</id><published>2011-10-31T22:32:00.000Z</published><updated>2011-10-31T22:32:45.780Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-31T22:32:45.780Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Web" /><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><title>Do 'is' boolean methods work in JSPs with JSTL?</title><content type="html">When coding in &lt;a href="http://www.oracle.com/technetwork/java/jstl-137486.html"&gt;JSTL&lt;/a&gt; you often want to use conditional logic (I'm thinking &lt;c:if&gt; and the like) to be able to structure your page correctly. Auto-generated getter &amp;amp; setter methods will normally create isX() methods for the getters of boolean values  (at least in &lt;a href="http://www.eclipse.org/"&gt;Eclipse&lt;/a&gt; it does) but can you access this method directly from JSTL without writing a getX() version?&lt;/c:if&gt;&lt;br /&gt;
&lt;br /&gt;
Does &lt;a href="http://www.oracle.com/technetwork/java/jstl-137486.html"&gt;JSTL&lt;/a&gt; support 'is' boolean methods though? Ask a random poll of Java we developers and you will get conflicting answers so I decided to investigate, want the short answer?&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;YES&lt;/b&gt; - JSTL does support accessing isX() methods directly as if you were accessing a getX() method, but only if the return type of the isX() method is a &lt;a href="http://download.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html"&gt;primative boolean&lt;/a&gt;. If you return an object of any kind (such as &lt;a href="http://download.oracle.com/javase/6/docs/api/java/lang/Boolean.html"&gt;Boolean&lt;/a&gt; isObjectBooleanTrue()) then JSTL fails to find the method and will give you a rather nasty JSP exception:&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;div class="MsoNormal"&gt;
javax.el.&lt;wbr&gt;&lt;/wbr&gt;PropertyNotFoundException: The class 'com.andrewbeacock.BooleanTest' does&lt;/div&gt;
not have the property 'objectBooleanTrue'.&lt;/blockquote&gt;
So yes, 'is' methods work in JSTL but make sure you ONLY return &lt;a href="http://download.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html"&gt;primitive booleans&lt;/a&gt; from them.&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-2263854981946561518?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=o79RD_mUnn0:-VDpqHLcyO4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=o79RD_mUnn0:-VDpqHLcyO4:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=o79RD_mUnn0:-VDpqHLcyO4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=o79RD_mUnn0:-VDpqHLcyO4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=o79RD_mUnn0:-VDpqHLcyO4:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=o79RD_mUnn0:-VDpqHLcyO4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=o79RD_mUnn0:-VDpqHLcyO4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/2263854981946561518/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=2263854981946561518" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/2263854981946561518?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/2263854981946561518?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/o79RD_mUnn0/do-is-boolean-mthods-work-in-jsps-with.html" title="Do 'is' boolean methods work in JSPs with JSTL?" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2011/10/do-is-boolean-mthods-work-in-jsps-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAAQHoyfSp7ImA9WhdaF0k.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-7827805803198327294</id><published>2011-10-27T20:29:00.000+01:00</published><updated>2011-10-27T20:29:01.495+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-27T20:29:01.495+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><title>How to stop Eclipse reformating your Java enumerations &amp; comments</title><content type="html">Eclipse is a wonderful IDE for the Java language and I’ve used it daily for at least the past 4 years but it does have some 'issues'. One is regarding it’s code formatting (or reformatting) support, normally it does a great job of putting stuff in the right place but there are occasions where it just fails to get it right.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Enumerations&lt;/b&gt;&lt;br /&gt;
When I write enums I like to have each item on it's own row, I find it's easier to read and amend in the future:&lt;br /&gt;
&lt;pre class="brush:java"&gt;public enum Family {
    MOTHER,
    FATHER,
    DAUGHTER,
    SON;
}
&lt;/pre&gt;But Eclipse has other ideas and formats it so that it looks like this:&lt;br /&gt;
&lt;pre class="brush:java"&gt;public enum Family {
    MOTHER, FATHER, DAUGHTER, SON;
}
&lt;/pre&gt;A way to get around this (and any other times where you have a few lines of code that you don't want collapsing into one is to add the double-slash style code comments to the end of each line: &lt;br /&gt;
&lt;pre class="brush:java"&gt;public enum Family {
    MOTHER, //
    FATHER, //
    DAUGHTER, //
    SON;
}
&lt;/pre&gt;&lt;b&gt;Block comments&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
I recently wanted to have a decent sized chunk of XML stored within Java's block comments (/* ... */) so that I could refer to it as I coded a mapping class. Everytime I saved the class Eclipse reformatted my XML so that it looked like someone had been sick on the page.&lt;br /&gt;
&lt;br /&gt;
After a little digging I found this gem buried in the original coding conventions document from Sun back in 1997:&lt;br /&gt;
&lt;blockquote&gt;Block comments can start with /*-, which is recognized by indent(1) as the beginning of a block comment that should not reformatted.&lt;/blockquote&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Taken from section 5.1.1 of &lt;a href="http://www.oracle.com/technetwork/java/codeconventions-150003.pdf"&gt;Java Code Conventions&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Now I'm pretty damn sure that Eclipse doesn't use indent for it's layout but I tried it anyway and it works a treat! Simply add the minus sign to the start of the block comment section and it will leave the whole block comment alone:&lt;br /&gt;
&lt;pre class="brush:java"&gt;/*-
    &lt;xml&gt;
        &lt;some lovely="formatted"&gt;
            XML which we don't want
        &lt;some&gt;
        &lt;silly formatter="to touch"/&gt;
    &lt;/xml&gt;
*/
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-7827805803198327294?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=YeMOreRrpbQ:t5NfyepPWe4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=YeMOreRrpbQ:t5NfyepPWe4:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=YeMOreRrpbQ:t5NfyepPWe4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=YeMOreRrpbQ:t5NfyepPWe4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=YeMOreRrpbQ:t5NfyepPWe4:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=YeMOreRrpbQ:t5NfyepPWe4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=YeMOreRrpbQ:t5NfyepPWe4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/7827805803198327294/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=7827805803198327294" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/7827805803198327294?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/7827805803198327294?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/YeMOreRrpbQ/how-to-stop-eclipse-reformating-your.html" title="How to stop Eclipse reformating your Java enumerations &amp; comments" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2011/10/how-to-stop-eclipse-reformating-your.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEYEQngzeyp7ImA9WhdQFkw.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-8772649264043279631</id><published>2011-08-17T21:15:00.000+01:00</published><updated>2011-08-17T21:15:03.683+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-17T21:15:03.683+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Web" /><title>Always note DNS server settings offline</title><content type="html">Had a strange experience this evening - complete loss of the internet. My router was suggesting that I had ASDL connectivity, and even an IP address but I wasn't able to load any websites. After a bit of debugging with the help of a remote friend I figured out that I wasn't able to connect to &lt;a href="http://blog.andrewbeacock.com/2009/05/replace-your-broadband-providers-dns.html"&gt;my OpenDNS name servers&lt;/a&gt; and so google.com wasn't resolving for me.&lt;br /&gt;
&lt;br /&gt;
I updated my router with &lt;a href="http://code.google.com/speed/public-dns/"&gt;Google's DNS settings&lt;/a&gt; and was back in play - just goes to show that what appears to be an ISP outage can be a case of name servers not being available at that time.&lt;br /&gt;
&lt;br /&gt;
Make sure you make a note of a few free DNS server details (i.e. both &lt;a href="http://blog.andrewbeacock.com/2009/05/replace-your-broadband-providers-dns.html"&gt;OpenDNS&lt;/a&gt; and &lt;a href="http://code.google.com/speed/public-dns/"&gt;GoogleDNS&lt;/a&gt;) offline so you can try them out if you ever end up 'offline'!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-8772649264043279631?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=d1c2ggghRps:J5II1759o_0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=d1c2ggghRps:J5II1759o_0:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=d1c2ggghRps:J5II1759o_0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=d1c2ggghRps:J5II1759o_0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=d1c2ggghRps:J5II1759o_0:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=d1c2ggghRps:J5II1759o_0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=d1c2ggghRps:J5II1759o_0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/8772649264043279631/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=8772649264043279631" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/8772649264043279631?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/8772649264043279631?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/d1c2ggghRps/always-note-dns-server-settings-offline.html" title="Always note DNS server settings offline" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2011/08/always-note-dns-server-settings-offline.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0YDSHg_cCp7ImA9WhZWFE0.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-2536727652733395788</id><published>2011-05-14T21:32:00.000+01:00</published><updated>2011-05-14T21:32:59.648+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-14T21:32:59.648+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Spring" /><title>Misleading wiring messages with aliased Spring DataSources</title><content type="html">When accessing databases in &lt;a href="http://www.springsource.org/"&gt;Spring&lt;/a&gt; you commonly use a &lt;a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/jdbc.html#jdbc-introduction"&gt;dataSource.xml file&lt;/a&gt; of some description to hold the XML &lt;a href="http://en.wikipedia.org/wiki/Stanza"&gt;stanzas&lt;/a&gt; describing the connection details to various databases or schemas.&lt;br /&gt;
&lt;br /&gt;
When dealing with multiple dataSource requirements you might find that more than one logical dataSource bean name actually points to the same physical connection. Rather than define multiple datasource stanzas with exactly the same details, Spring allows the use of the &lt;alias&gt; element to point easily to an existing bean but use a different name:&lt;pre class="brush:xml"&gt;&amp;lt;bean id="personDataSource" class="org.apache.commons.dbcp.BasicDataSource"&amp;gt;
        &amp;lt;property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" /&amp;gt;
        &amp;lt;property name="url" value="jdbc:oracle:thin:@database:port:SID" /&amp;gt;
        &amp;lt;property name="username" value="USER" /&amp;gt;
        &amp;lt;property name="password" value="PASS" /&amp;gt;
        &amp;lt;property name="validationQuery" value="select 1 from dual"/&amp;gt;
    &amp;lt;/bean&amp;gt;

    &amp;lt;alias alias="customerDataSource" name="personDataSource"/&amp;gt;
&lt;/pre&gt;&lt;b&gt;BUT (this is the whole point of this blog post really!)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
If you get wiring errors when Spring tried to wire data sources into other beans it DOESN'T see aliased beans as first class citizens, when the error reports which data sources are available it won't list the aliased names, suggesting that you actually have less data sources than you really do!&lt;br /&gt;
&lt;br /&gt;
So although aliases are great (and have saved me loads of lines of duplicated XML  config) make sure you consider that they won't be shown in lists of 'available data sources'.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-2536727652733395788?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=6TzJGAJ7KRc:-ADFvxIO_tA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=6TzJGAJ7KRc:-ADFvxIO_tA:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=6TzJGAJ7KRc:-ADFvxIO_tA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=6TzJGAJ7KRc:-ADFvxIO_tA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=6TzJGAJ7KRc:-ADFvxIO_tA:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=6TzJGAJ7KRc:-ADFvxIO_tA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=6TzJGAJ7KRc:-ADFvxIO_tA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/2536727652733395788/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=2536727652733395788" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/2536727652733395788?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/2536727652733395788?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/6TzJGAJ7KRc/misleading-wiring-messages-with-aliased.html" title="Misleading wiring messages with aliased Spring DataSources" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2011/05/misleading-wiring-messages-with-aliased.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcNQHk4eip7ImA9WhZXEkU.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-545702924295993882</id><published>2011-05-01T21:34:00.000+01:00</published><updated>2011-05-01T21:34:51.732+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-01T21:34:51.732+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Subversion" /><title>Sound advice for a source code commit frequency</title><content type="html">A &lt;a href="http://twitter.com/blarti"&gt;colleague&lt;/a&gt; of mine commented recently in a discussion on how often one should commit their source code:&lt;br /&gt;
&lt;blockquote&gt;commit on keyup&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- always tends to keep everything as up to the minute as possible&lt;/blockquote&gt;Classic! and yes it was tongue in cheek advice!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-545702924295993882?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=Nkmy5Fv-diA:AJi22LZe6vc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=Nkmy5Fv-diA:AJi22LZe6vc:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=Nkmy5Fv-diA:AJi22LZe6vc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=Nkmy5Fv-diA:AJi22LZe6vc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=Nkmy5Fv-diA:AJi22LZe6vc:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=Nkmy5Fv-diA:AJi22LZe6vc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=Nkmy5Fv-diA:AJi22LZe6vc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/545702924295993882/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=545702924295993882" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/545702924295993882?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/545702924295993882?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/Nkmy5Fv-diA/sound-advice-for-source-code-commit.html" title="Sound advice for a source code commit frequency" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2011/05/sound-advice-for-source-code-commit.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMGQXszfip7ImA9WhZSE0k.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-2721774514127246563</id><published>2011-03-28T20:27:00.000+01:00</published><updated>2011-03-28T20:27:00.586+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-28T20:27:00.586+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Web" /><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Spring" /><title>Using &amp; comparing enumerations (enums) with JSTL</title><content type="html">Often in your &lt;a href="http://www.oracle.com/technetwork/java/index-jsp-135995.html"&gt;JSTL&lt;/a&gt; pages you will want to test a value of a particular variable before displaying something on the page. Often you are comparing against primitive types or other objects but what if you want to compare against an &lt;a href="http://download.oracle.com/javase/tutorial/java/javaOO/enum.html"&gt;enumerated type&lt;/a&gt;?&lt;br /&gt;
&lt;br /&gt;
Attempting to access the enumeration directly as &lt;code&gt;Colour.BLUE&lt;/code&gt; doesn't work as the class/enum isn't available but what you can do it compare objects against their label or enum name.&lt;br /&gt;
&lt;br /&gt;
If we have a Colour enumeration:&lt;br /&gt;
&lt;pre class="brush:java"&gt;public enum Colour {
    RED, GREEN, BLUE
}&lt;/pre&gt;and we have a car object which has a getColour() method on it (returning the enumerated type) we can test against it in JSTL by using the specific name:&lt;br /&gt;
&lt;pre class="brush:xml"&gt;&amp;lt;c:if test="${car.colour eq 'BLUE'}"&amp;gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-2721774514127246563?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=hplvUKDB5L0:rxIa5_XFvpk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=hplvUKDB5L0:rxIa5_XFvpk:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=hplvUKDB5L0:rxIa5_XFvpk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=hplvUKDB5L0:rxIa5_XFvpk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=hplvUKDB5L0:rxIa5_XFvpk:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=hplvUKDB5L0:rxIa5_XFvpk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=hplvUKDB5L0:rxIa5_XFvpk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/2721774514127246563/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=2721774514127246563" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/2721774514127246563?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/2721774514127246563?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/hplvUKDB5L0/using-comparing-enumerations-enums-with.html" title="Using &amp; comparing enumerations (enums) with JSTL" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2011/03/using-comparing-enumerations-enums-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QFQ3s_fSp7ImA9WhZTF0k.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-4233911093618764565</id><published>2011-03-21T23:15:00.000Z</published><updated>2011-03-21T23:15:12.545Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-21T23:15:12.545Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><category scheme="http://www.blogger.com/atom/ns#" term="Windows" /><title>Keyboard shortcut for 'paste as plain text' in Pidgin</title><content type="html">I use &lt;a href="http://www.pidgin.im/"&gt;Pidgin&lt;/a&gt; at work for communicating with my remote colleagues and I regularly paste code snippets and log file output into the Pidgin window. Often the text formats completely wrong and you end up sending the recipient a page of garbage rather than the real text.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://lh6.googleusercontent.com/-h36BsxSVPVY/TYfbh94HdkI/AAAAAAAAAws/IUxEfgDUZkI/s1600/pidgin+paste+as+plain+text.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="236" src="https://lh6.googleusercontent.com/-h36BsxSVPVY/TYfbh94HdkI/AAAAAAAAAws/IUxEfgDUZkI/s320/pidgin+paste+as+plain+text.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Pidgin has a right-click context menu option for getting round this called 'paste as plain text' which normally does the trick but what if you normally use CTRL-V to paste your text in? After 2 seconds of experimentation today I found that CTRL-SHIFT-V is the keyboard shortcut for 'paste as plain text', I now feel complete...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-4233911093618764565?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=WdetoJlIE74:DXdVDDygFx4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=WdetoJlIE74:DXdVDDygFx4:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=WdetoJlIE74:DXdVDDygFx4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=WdetoJlIE74:DXdVDDygFx4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=WdetoJlIE74:DXdVDDygFx4:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=WdetoJlIE74:DXdVDDygFx4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=WdetoJlIE74:DXdVDDygFx4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/4233911093618764565/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=4233911093618764565" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/4233911093618764565?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/4233911093618764565?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/WdetoJlIE74/keyboard-shortcut-for-paste-as-plain.html" title="Keyboard shortcut for 'paste as plain text' in Pidgin" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh6.googleusercontent.com/-h36BsxSVPVY/TYfbh94HdkI/AAAAAAAAAws/IUxEfgDUZkI/s72-c/pidgin+paste+as+plain+text.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2011/03/keyboard-shortcut-for-paste-as-plain.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkIDRn0yeyp7ImA9Wx9UFEs.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-5358395155176271477</id><published>2011-02-11T21:42:00.001Z</published><updated>2011-02-11T21:42:57.393Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-11T21:42:57.393Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Web" /><category scheme="http://www.blogger.com/atom/ns#" term="Blog" /><title>Embedding a Google Docs spreadsheet in Blogger</title><content type="html">Blogger is an excellent free blogging platform but if you want anything 'dynamic' then it starts to get in the way. One thought I've had recently was to see how I could share information captured in Google Docs Spreadsheet with Blogger.&lt;br /&gt;
&lt;br /&gt;
I've a few ideas which will take a few posts to explain, so let's start with the most basic - embedding a Google Spreadsheet direct into Blogger.&lt;br /&gt;
&lt;br /&gt;
Access the spreadsheet in Google Docs that you want to expose in Blogger, I've chosen a simple table of the most popular programming languages in 2010:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-VHSGn-umVro/TVWs7FX-UtI/AAAAAAAAAwM/d4nyqDsWkR8/s1600/spreadsheet.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="303" src="http://4.bp.blogspot.com/-VHSGn-umVro/TVWs7FX-UtI/AAAAAAAAAwM/d4nyqDsWkR8/s320/spreadsheet.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Next you'll want to share this spreadsheet with the rest of the world by publishing it as a web page:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-MfRpFCJHBFA/TVWtCHzkoCI/AAAAAAAAAwQ/hJ_OI_Cd9h8/s1600/publish.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="228" src="http://3.bp.blogspot.com/-MfRpFCJHBFA/TVWtCHzkoCI/AAAAAAAAAwQ/hJ_OI_Cd9h8/s320/publish.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Now you need to select the "HTML to embed in a page" option and copy the HTML code into the clipboard:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-CPEQRjcIdHA/TVWtEovuQ5I/AAAAAAAAAwU/SQk1-hMTWWY/s1600/publish+as+a+webpage.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-CPEQRjcIdHA/TVWtEovuQ5I/AAAAAAAAAwU/SQk1-hMTWWY/s320/publish+as+a+webpage.png" width="314" /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp;Open a new post in blogger and ensure that the "Edit HTML" tab is selected and paste the code in:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-X2iN6f6iEFM/TVWtL6Zpy7I/AAAAAAAAAwY/IA3pDhsDBvE/s1600/blogger.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="261" src="http://4.bp.blogspot.com/-X2iN6f6iEFM/TVWtL6Zpy7I/AAAAAAAAAwY/IA3pDhsDBvE/s320/blogger.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Now publish your post and your spreadsheet will be visable in your blog post:&lt;br /&gt;
&lt;br /&gt;
&lt;iframe frameborder="0" height="300" src="https://spreadsheets.google.com/pub?key=0AlvsnAh0wPwVdF9GSlp2Y0Z4ejBtX1RTRUUxbjY1cXc&amp;amp;hl=en&amp;amp;single=true&amp;amp;gid=0&amp;amp;output=html&amp;amp;widget=true" width="500"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
I didn't say it would be pretty though did I? ;)&lt;br /&gt;
&lt;br /&gt;
That's the most basic way of doing it, and any changes you make in Google Docs will be reflected in the Blogger page.  In the next few posts I'll show how a little HTML &amp;amp; JavaScript coding with Google Visualisations means we can have a much neater looking table as well as access to producing some graphs of the data.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-5358395155176271477?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=LtlE8DRY-l8:RdGHVBeiUTE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=LtlE8DRY-l8:RdGHVBeiUTE:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=LtlE8DRY-l8:RdGHVBeiUTE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=LtlE8DRY-l8:RdGHVBeiUTE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=LtlE8DRY-l8:RdGHVBeiUTE:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=LtlE8DRY-l8:RdGHVBeiUTE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=LtlE8DRY-l8:RdGHVBeiUTE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/5358395155176271477/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=5358395155176271477" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/5358395155176271477?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/5358395155176271477?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/LtlE8DRY-l8/embedding-google-docs-spreadsheet-in.html" title="Embedding a Google Docs spreadsheet in Blogger" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-VHSGn-umVro/TVWs7FX-UtI/AAAAAAAAAwM/d4nyqDsWkR8/s72-c/spreadsheet.png" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2011/02/embedding-google-docs-spreadsheet-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUUFRXY6cSp7ImA9Wx5aEkg.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-9173097397972174183</id><published>2010-11-08T21:53:00.000Z</published><updated>2010-11-08T21:53:34.819Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-08T21:53:34.819Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Spring" /><title>How to use MatchMode in your JPA/Hibernate Restrictions &amp; Criteria queries</title><content type="html">Back in July I blogged about &lt;a href="http://blog.andrewbeacock.com/2010/07/how-to-do-andor-type-sql-queries-using.html"&gt;how to do AND/OR type SQL queries using Hibernate AND/OR JPA using disjunctions&lt;/a&gt;. If you looked at the example code you will have seen that I was appending "%" as the wildcard operator in my &lt;a href="http://docs.jboss.org/hibernate/stable/core/reference/en/html/querycriteria.html#querycriteria-narrowing"&gt;Restrictions&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Since then I've used &lt;a href="http://docs.jboss.org/hibernate/stable/core/reference/en/html/querycriteria.html#querycriteria-narrowing"&gt;Restrictions&lt;/a&gt; a couple more times and wondered if there was a better way of specifying them other than string concatenation.&lt;br /&gt;
&lt;br /&gt;
Well there is and it's with the use of the &lt;a href="http://docs.jboss.org/hibernate/stable/core/api/org/hibernate/criterion/MatchMode.html"&gt;MatchMode&lt;/a&gt; class.&lt;br /&gt;
&lt;br /&gt;
Rather than this code:&lt;br /&gt;
&lt;pre class="brush:java"&gt;import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
 
Criteria criteria = session.createCriteria(Product.class);
criteria.add(
  Restrictions.disjunction()
    .add(Restrictions.ilike("code", codeOrName + "%"))
    .add(Restrictions.ilike("name", "%" + codeOrName + "%"))
);
return criteria.list();&lt;/pre&gt;You can now write:&lt;br /&gt;
&lt;pre class="brush:java"&gt;import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
 
Criteria criteria = session.createCriteria(Product.class);
criteria.add(
  Restrictions.disjunction()
    .add(Restrictions.ilike("code", codeOrName, MatchMode.START))
    .add(Restrictions.ilike("name", codeOrName, MatchMode.ANYWHERE))
);
return criteria.list();&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-9173097397972174183?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=_E9ikJ0rIM0:r_pma4RNLHo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=_E9ikJ0rIM0:r_pma4RNLHo:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=_E9ikJ0rIM0:r_pma4RNLHo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=_E9ikJ0rIM0:r_pma4RNLHo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=_E9ikJ0rIM0:r_pma4RNLHo:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=_E9ikJ0rIM0:r_pma4RNLHo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=_E9ikJ0rIM0:r_pma4RNLHo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/9173097397972174183/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=9173097397972174183" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/9173097397972174183?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/9173097397972174183?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/_E9ikJ0rIM0/how-to-use-matchmode-in-your.html" title="How to use MatchMode in your JPA/Hibernate Restrictions &amp; Criteria queries" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2010/11/how-to-use-matchmode-in-your.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUINRnk6fCp7ImA9Wx5bGEw.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-494531915238134785</id><published>2010-11-03T20:53:00.000Z</published><updated>2010-11-03T20:53:17.714Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-03T20:53:17.714Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Web" /><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><title>Accessing &amp; iterating over a Java Map in a JSP page with JSTL</title><content type="html">When you are coding JSP pages using &lt;a href="http://java.sun.com/products/jsp/jstl/"&gt;JSTL&lt;/a&gt; one thing you use a lot is the &lt;a href="http://blog.andrewbeacock.com/2009/04/jstl-foreach-looping-tricks-using.html"&gt;&amp;lt;c:foreach&amp;gt; tag&lt;/a&gt;. This tag a great for iterating over &lt;a href="http://download.oracle.com/javase/6/docs/api/java/util/List.html"&gt;Lists&lt;/a&gt; or &lt;a href="http://download.oracle.com/javase/6/docs/api/java/util/Set.html"&gt;Sets&lt;/a&gt; but what do you do when you want to display the contents of a &lt;a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html"&gt;Map&lt;/a&gt;?&lt;br /&gt;
&lt;br /&gt;
Firstly you need to decide how you are going to use the Map. Do you want to access a 'value' stored within the Map based on a known key or iterate over the Map displaying both key and value?&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Access a Map based on a 'key'&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
This one is pretty straight forward you just need to know the JSTL syntax:&lt;br /&gt;
&lt;pre class="brush:xml"&gt;${aMapFullOfKeysAndValues[yourKnownKey]}
&lt;/pre&gt;Two key points:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt; The key is an existing JSTL variable or a quoted string&lt;/li&gt;
&lt;li&gt; You use square brackets at the end of the Map name&lt;/li&gt;
&lt;/ul&gt;&lt;b&gt;Iterate over a Map pulling out the 'key' &amp;amp; 'value'&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
This is a little more complex, note the name of the variable that is filled on each pass through the Map ('entry'):&lt;br /&gt;
&lt;pre class="brush:xml"&gt;&lt;c:foreach items="${aMapFullOfKeysAndValues}" var="entry"&gt;
    ${entry.key} - ${entry.value}
&lt;/c:foreach&gt;&lt;/pre&gt;Four key points:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt; The name of the Map is placed as the 'items' attribute of the forEach&lt;/li&gt;
&lt;li&gt; To access the 'key' object use ${entry.key}&lt;/li&gt;
&lt;li&gt; To access the 'value' object use ${entry.value}&lt;/li&gt;
&lt;li&gt; If either the key or value is a complex object, simply walk into it: ${entry.value.surname}&lt;/li&gt;
&lt;/ul&gt;Hopefully that has demystified it a little, please post a comment if you found this post useful or I've missed something out!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-494531915238134785?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=auZg2B-8d1M:zk2AxJHu6pU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=auZg2B-8d1M:zk2AxJHu6pU:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=auZg2B-8d1M:zk2AxJHu6pU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=auZg2B-8d1M:zk2AxJHu6pU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=auZg2B-8d1M:zk2AxJHu6pU:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=auZg2B-8d1M:zk2AxJHu6pU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=auZg2B-8d1M:zk2AxJHu6pU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/494531915238134785/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=494531915238134785" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/494531915238134785?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/494531915238134785?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/auZg2B-8d1M/accessing-iterating-over-java-map-in.html" title="Accessing &amp; iterating over a Java Map in a JSP page with JSTL" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2010/11/accessing-iterating-over-java-map-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08DSX45fyp7ImA9Wx5VFUo.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-5276937437699607241</id><published>2010-10-08T22:04:00.000+01:00</published><updated>2010-10-08T22:04:38.027+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-08T22:04:38.027+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Spring" /><title>Spring Autowiring &amp; Component Scanning Problems - Part 6: The Remedy</title><content type="html">Part 5 can be found &lt;a href="http://blog.andrewbeacock.com/2010/10/spring-autowiring-component-scanning.html"&gt;here&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
So what can you do about root context beans not being wired correctly?&lt;br /&gt;
&lt;br /&gt;
One solution is to ensure that all your root context beans have their autowiring specified via XML, either with explicit &lt;property&gt; elements or autowire="byType" or autowire="byName" XML attributes, but this is a bit of a backward step considering how annotation centric Spring is becoming.&lt;br /&gt;
&lt;br /&gt;
You could enable component scanning (via the &lt;context:component-scan&gt; XML element) and go through the beans marking them with the &lt;a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/stereotype/Component.html"&gt;@Component&lt;/a&gt; family of annotations so that the &lt;a href="http://static.springsource.org/spring/docs/2.5.x/reference/beans.html#beans-autowired-annotation"&gt;@Autowired&lt;/a&gt; statements are picked up.  You will also need to remove the XML-based bean definitions from the context files otherwise you will end up with two conflicting beans - one loaded due to the XML declaration and another loaded due to component scanning.&lt;br /&gt;
&lt;br /&gt;
Or you could switch on 'annotation awareness' by adding a &lt;context:annotation-config&gt; XML element to your root application context files.  In fact you only need to add it to one of the root context files as all the beans are loaded into the same context and looking for autowired annotations only happens once all the beans are loaded into the context.&lt;br /&gt;
&lt;br /&gt;
Or you could do all of the above but then you might be creating new problems for yourself... ;-)&lt;/context:annotation-config&gt;&lt;/context:component-scan&gt;&lt;/property&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-5276937437699607241?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=bc_nzrT9aMw:gSDjTnA81Go:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=bc_nzrT9aMw:gSDjTnA81Go:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=bc_nzrT9aMw:gSDjTnA81Go:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=bc_nzrT9aMw:gSDjTnA81Go:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=bc_nzrT9aMw:gSDjTnA81Go:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=bc_nzrT9aMw:gSDjTnA81Go:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=bc_nzrT9aMw:gSDjTnA81Go:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/5276937437699607241/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=5276937437699607241" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/5276937437699607241?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/5276937437699607241?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/bc_nzrT9aMw/spring-autowiring-component-scanning_08.html" title="Spring Autowiring &amp; Component Scanning Problems - Part 6: The Remedy" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2010/10/spring-autowiring-component-scanning_08.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C04FQHg_cCp7ImA9Wx5VFUo.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-8870153653828050947</id><published>2010-10-05T21:52:00.001+01:00</published><updated>2010-10-08T22:05:11.648+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-08T22:05:11.648+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Spring" /><title>Spring Autowiring &amp; Component Scanning Problems - Part 5: The Cause</title><content type="html">Part 4 can be found &lt;a href="http://blog.andrewbeacock.com/2010/09/spring-autowiring-component-scanning_30.html"&gt;here&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
It's not clearly stated in the Spring documentation but the auto-wiring stage for &lt;a href="http://static.springsource.org/spring/docs/2.5.x/reference/mvc.html#mvc-servlet"&gt;DispatcherServlets&lt;/a&gt; only scan through the beans within it's specific application context searching for &lt;a href="http://static.springsource.org/spring/docs/2.5.x/reference/beans.html#beans-autowired-annotation"&gt;autowiring annotations&lt;/a&gt; (@Autowired, @Qualifier, etc.), it does not venture into the root application context to wire those beans.&lt;br /&gt;
&lt;br /&gt;
It sometimes appears that it does cross that root context boundary if you have root bean classes annotated with one of the &lt;a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/stereotype/Component.html"&gt;@Component&lt;/a&gt; family and you enable your web application's component scanning to include that package. What happens is that the bean is loaded into the root application context and then an overwritten version is loaded into the &lt;a href="http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/context/WebApplicationContext.html"&gt;WebApplicationContext&lt;/a&gt;. This overlaid version is then auto-wired as it lives inside the &lt;a href="http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/context/WebApplicationContext.html"&gt;WebApplicationContext&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Part 6 can be found &lt;a href="http://blog.andrewbeacock.com/2010/10/spring-autowiring-component-scanning_08.html"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-8870153653828050947?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=wqo1JySRXr4:8yyDALYANHk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=wqo1JySRXr4:8yyDALYANHk:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=wqo1JySRXr4:8yyDALYANHk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=wqo1JySRXr4:8yyDALYANHk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=wqo1JySRXr4:8yyDALYANHk:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=wqo1JySRXr4:8yyDALYANHk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=wqo1JySRXr4:8yyDALYANHk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/8870153653828050947/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=8870153653828050947" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/8870153653828050947?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/8870153653828050947?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/wqo1JySRXr4/spring-autowiring-component-scanning.html" title="Spring Autowiring &amp; Component Scanning Problems - Part 5: The Cause" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2010/10/spring-autowiring-component-scanning.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C04NQHY_fyp7ImA9Wx5VE0w.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-636887956322028441</id><published>2010-09-30T19:41:00.002+01:00</published><updated>2010-10-05T21:53:11.847+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-05T21:53:11.847+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Spring" /><title>Spring Autowiring &amp; Component Scanning Problems - Part 4: Application Contexts</title><content type="html">&lt;div class="western" style="margin-bottom: 0cm;"&gt;&lt;span style="color: black;"&gt;Part 3 can be found &lt;a href="http://blog.andrewbeacock.com/2010/09/spring-autowiring-component-scanning_20.html"&gt;here &lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="western" style="margin-bottom: 0cm;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="western" style="margin-bottom: 0cm;"&gt;&lt;span style="color: black;"&gt;Spring loads beans into application contexts. Any beans declared in XML files or any annotated classes found via component scanning are placed into a suitable application context - either the root application context or one specific to the web application that the bean is declared in.&lt;/span&gt;&lt;/div&gt;&lt;div class="western" style="margin-bottom: 0cm;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="western" style="margin-bottom: 0cm;"&gt;&lt;span style="color: black;"&gt;Any beans declared (or scanned for) which are not &lt;a href="http://static.springsource.org/spring/docs/2.5.x/reference/mvc.html#mvc-servlet"&gt;DispatcherServlet&lt;/a&gt; related (i.e. not &lt;servlet-name&gt;-servlet.xml files) are placed into one big root application context bucket, the support for separate XML application context files is purely a convenience for you to manage the logical  separation of the beans.&lt;/servlet-name&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="western" style="margin-bottom: 0cm;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="western" style="margin-bottom: 0cm;"&gt;&lt;span style="color: black;"&gt;Each DispatcherServlet gets it's own &lt;a href="http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/context/WebApplicationContext.html"&gt;WebApplicationContext&lt;/a&gt; which &lt;/span&gt;inherits&lt;span style="color: black;"&gt; all the beans from the root application context, overlaying all the beans defined within it's web application scope (i.e. any beans within &lt;/span&gt;&lt;code&gt;&lt;span style="color: black;"&gt;&lt;servlet-name&gt;-servlet.xml)&lt;/servlet-name&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style="color: black;"&gt;. Once all the DispatcherServlet's beans are loaded it will attempt to autowire them together and this is where the potential problems start.&lt;/span&gt;&lt;/div&gt;&lt;div class="western" style="margin-bottom: 0cm;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="western" style="margin-bottom: 0cm;"&gt;&lt;span style="color: black;"&gt;Part 5 can be found &lt;a href="http://blog.andrewbeacock.com/2010/10/spring-autowiring-component-scanning.html"&gt;here&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-636887956322028441?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=rTqGFkoN7yY:Kn_jrb9u1L8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=rTqGFkoN7yY:Kn_jrb9u1L8:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=rTqGFkoN7yY:Kn_jrb9u1L8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=rTqGFkoN7yY:Kn_jrb9u1L8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=rTqGFkoN7yY:Kn_jrb9u1L8:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=rTqGFkoN7yY:Kn_jrb9u1L8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=rTqGFkoN7yY:Kn_jrb9u1L8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/636887956322028441/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=636887956322028441" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/636887956322028441?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/636887956322028441?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/rTqGFkoN7yY/spring-autowiring-component-scanning_30.html" title="Spring Autowiring &amp; Component Scanning Problems - Part 4: Application Contexts" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2010/09/spring-autowiring-component-scanning_30.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEYFSXY8cSp7ImA9Wx5WGEo.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-2161316472656062273</id><published>2010-09-20T21:24:00.002+01:00</published><updated>2010-09-30T19:41:58.879+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-30T19:41:58.879+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Spring" /><title>Spring Autowiring &amp; Component Scanning Problems - Part 3: Autowiring</title><content type="html">Part 2 can be found &lt;a href="http://blog.andrewbeacock.com/2010/09/spring-autowiring-component-scanning_16.html"&gt;here&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
Having a load of beans instantiated in an application context is one thing, having them wired together so that they know about each other is another. Wiring can be done either using XML or via the &lt;a href="http://static.springsource.org/spring/docs/2.5.x/reference/beans.html#beans-autowired-annotation"&gt;@Autowired annotation&lt;/a&gt;.  The annotations on their own don't cause Spring to wire the beans, you need to turn on annotation support for Spring to find them:&lt;br /&gt;
&lt;pre class="brush:xml"&gt;&amp;lt;context:annotation-config/&amp;gt;
&lt;/pre&gt;When added to an application context XML file it instructs Spring to look through all the loaded beans in the relevant application context for annotations like @Autowired, @Qualifier &amp;amp; @Required.  In a reasonably mature Spring application you could have the beans being wired together in a number of ways:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Explicit &amp;lt;property&amp;gt; XML elements referencing other beans&lt;/li&gt;
&lt;li&gt;The addition of autowire="byType" or autowire="byName" XML attributes&lt;/li&gt;
&lt;li&gt;&lt;a href="http://static.springsource.org/spring/docs/2.5.x/reference/beans.html#beans-autowired-annotation"&gt;@Autowired&lt;/a&gt; annotations inside normal classes declared as beans in XML&lt;/li&gt;
&lt;li&gt;&lt;a href="http://static.springsource.org/spring/docs/2.5.x/reference/beans.html#beans-autowired-annotation"&gt;@Autowired&lt;/a&gt; annotations inside &lt;a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/stereotype/Component.html"&gt;@Component&lt;/a&gt;-based classes&lt;/li&gt;
&lt;/ul&gt;Note: The &amp;lt;context:component-scan&amp;gt; element also implicitly defines the &amp;lt;context:annotation-config&amp;gt; autowiring element as well - after all if you are scanning for annotated &lt;a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/stereotype/Component.html"&gt;@Component&lt;/a&gt; classes you want the embedded &lt;a href="http://static.springsource.org/spring/docs/2.5.x/reference/beans.html#beans-autowired-annotation"&gt;@Autowired&lt;/a&gt; annotations to be scanned for as well.&lt;br /&gt;
&lt;br /&gt;
Part 4 can be found &lt;a href="http://blog.andrewbeacock.com/2010/09/spring-autowiring-component-scanning_30.html"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-2161316472656062273?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=l8QsUA1Gu9c:1qUjVrishIk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=l8QsUA1Gu9c:1qUjVrishIk:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=l8QsUA1Gu9c:1qUjVrishIk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=l8QsUA1Gu9c:1qUjVrishIk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=l8QsUA1Gu9c:1qUjVrishIk:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=l8QsUA1Gu9c:1qUjVrishIk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=l8QsUA1Gu9c:1qUjVrishIk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/2161316472656062273/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=2161316472656062273" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/2161316472656062273?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/2161316472656062273?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/l8QsUA1Gu9c/spring-autowiring-component-scanning_20.html" title="Spring Autowiring &amp; Component Scanning Problems - Part 3: Autowiring" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2010/09/spring-autowiring-component-scanning_20.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMEQnY4eCp7ImA9Wx5WEEw.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-6581608629794109857</id><published>2010-09-16T21:09:00.003+01:00</published><updated>2010-09-20T21:26:43.830+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-20T21:26:43.830+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Spring" /><title>Spring Autowiring &amp; Component Scanning Problems - Part 2: Component Scanning</title><content type="html">Part 1 can be found &lt;a href="http://blog.andrewbeacock.com/2010/09/spring-autowiring-component-scanning.html"&gt;here&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Instead of adding explicit beans to your XML files, &lt;a href="http://www.springsource.org/download"&gt;Spring&lt;/a&gt; 2.5 introduced the &lt;a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/stereotype/Component.html"&gt;@Component&lt;/a&gt; annotation family (&lt;a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/stereotype/Service.html"&gt;@Service&lt;/a&gt;, &lt;a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/stereotype/Controller.html"&gt;@Controller&lt;/a&gt;, &lt;a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/stereotype/Repository.html"&gt;@Repository&lt;/a&gt; – all children of the @Component parent annotation).  Simply add these object-level annotations to your class definitions to mark what type of Spring bean they are. Then add the following XML snippet to the application context XML file to tell Spring where to look:&lt;br /&gt;
&lt;pre class="brush:xml"&gt;&amp;lt;context:component-scan base-package="com.andrewbeacock"/&amp;gt;
&lt;/pre&gt;Spring now scans through the whole classpath for the specified package (and sub-packages) looking for @Component-based classes.  Any found are created as beans and placed in the application context.&lt;br /&gt;
&lt;br /&gt;
This purely adds the beans to the relevant application context, it doesn't look inside the class for other annotations until it's finished loading all the remaining beans into the context.&lt;br /&gt;
&lt;br /&gt;
Part 3 can be found &lt;a href="http://blog.andrewbeacock.com/2010/09/spring-autowiring-component-scanning_20.html"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-6581608629794109857?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=P3cYz-xM_Q4:-RMsPxwGET8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=P3cYz-xM_Q4:-RMsPxwGET8:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=P3cYz-xM_Q4:-RMsPxwGET8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=P3cYz-xM_Q4:-RMsPxwGET8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=P3cYz-xM_Q4:-RMsPxwGET8:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=P3cYz-xM_Q4:-RMsPxwGET8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=P3cYz-xM_Q4:-RMsPxwGET8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/6581608629794109857/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=6581608629794109857" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/6581608629794109857?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/6581608629794109857?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/P3cYz-xM_Q4/spring-autowiring-component-scanning_16.html" title="Spring Autowiring &amp; Component Scanning Problems - Part 2: Component Scanning" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2010/09/spring-autowiring-component-scanning_16.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU8AR3o9cSp7ImA9Wx5XFks.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-5970224273553938469</id><published>2010-09-13T20:48:00.001+01:00</published><updated>2010-09-16T21:10:46.469+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-16T21:10:46.469+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Spring" /><title>Spring Autowiring &amp; Component Scanning Problems - Part 1: The Problem</title><content type="html">Let's set the scene a little: You're a developer on a long-running &lt;a href="http://www.springsource.org/"&gt;Spring&lt;/a&gt;-based web application. It's a reasonably large application developed before &lt;a href="http://static.springsource.org/spring/docs/2.5.x/reference/metadata.html"&gt;annotations&lt;/a&gt; were a twinkle in Spring's eye and so uses &lt;a href="http://static.springsource.org/spring/docs/2.5.x/reference/xsd-config.html"&gt;XML&lt;/a&gt; to declare the beans and wiring. Over time the use of annotations has grown - particularly in the area of annotated controllers - and you've started to add &lt;a href="http://static.springsource.org/spring/docs/2.5.x/reference/beans.html#beans-factory-autowire"&gt;@Autowired annotations&lt;/a&gt; rather than explicitly defining the wiring in the XML application context files.&lt;br /&gt;
&lt;br /&gt;
So now you've got a good mix of XML-defined beans and annotated ones, sometimes mixing the two together; a bean is declared in the XML context file but it's wirings are defined using &lt;a href="http://static.springsource.org/spring/docs/2.5.x/reference/beans.html#beans-autowired-annotation"&gt;@Autowired statements&lt;/a&gt; rather than the usual &lt;property&gt; XML elements.&lt;br /&gt;
&lt;br /&gt;
Everything is working perfectly...&lt;br /&gt;
&lt;br /&gt;
You've never had a problem adding @Autowired annotations to beans until now, but a particular bean's members don't seem to get wired (you get a NullPointerException at runtime) but you don't get a wiring error. This is confusing as you know that the @Autowired annotation has 'required' set to true by default, so it should be throwing a wiring exception during the loading of the context at the very least!&lt;br /&gt;
&lt;br /&gt;
Why is it not wiring correctly? Because Spring is not even seeing the @Autowired annotation! To fully understand the issues at hand we need to wind back a bit and cover some theory.&lt;br /&gt;
&lt;br /&gt;
Part 2 can be found &lt;a href="http://blog.andrewbeacock.com/2010/09/spring-autowiring-component-scanning_16.html"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-5970224273553938469?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=sw21wdKQH2E:NaOjmVAx3Nk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=sw21wdKQH2E:NaOjmVAx3Nk:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=sw21wdKQH2E:NaOjmVAx3Nk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=sw21wdKQH2E:NaOjmVAx3Nk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=sw21wdKQH2E:NaOjmVAx3Nk:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=sw21wdKQH2E:NaOjmVAx3Nk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=sw21wdKQH2E:NaOjmVAx3Nk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/5970224273553938469/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=5970224273553938469" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/5970224273553938469?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/5970224273553938469?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/sw21wdKQH2E/spring-autowiring-component-scanning.html" title="Spring Autowiring &amp; Component Scanning Problems - Part 1: The Problem" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2010/09/spring-autowiring-component-scanning.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcFSXYzcSp7ImA9Wx5XFE0.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-8010048130601062805</id><published>2010-09-13T20:43:00.001+01:00</published><updated>2010-09-13T20:43:38.889+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-09-13T20:43:38.889+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Spring" /><title>Something new for my blog</title><content type="html">I'm going to try something new, a multi-post feature which is basically an article I've written for an open source journal but broken up into bite-sized pieces and posted over a couple of weeks (or so).&lt;br /&gt;
&lt;br /&gt;
Please comment if you like it, find it annoying, my content is completely wrong, etc. I'd like to hear from you.&lt;br /&gt;
&lt;br /&gt;
My series is on "Spring Autowiring &amp; Component Scanning Problems"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-8010048130601062805?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=rfx_9yTco-s:NDeNziqZ86c:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=rfx_9yTco-s:NDeNziqZ86c:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=rfx_9yTco-s:NDeNziqZ86c:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=rfx_9yTco-s:NDeNziqZ86c:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=rfx_9yTco-s:NDeNziqZ86c:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=rfx_9yTco-s:NDeNziqZ86c:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=rfx_9yTco-s:NDeNziqZ86c:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/8010048130601062805/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=8010048130601062805" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/8010048130601062805?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/8010048130601062805?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/rfx_9yTco-s/something-new-for-my-blog.html" title="Something new for my blog" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2010/09/something-new-for-my-blog.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkADQXc5eyp7ImA9Wx5SGUQ.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-532419971609810615</id><published>2010-08-16T21:32:00.002+01:00</published><updated>2010-08-16T21:32:50.923+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-16T21:32:50.923+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Web" /><title>Have more than one gmail account?</title><content type="html">Not sure if you are aware of this but Google have added a rather funky dropdown account selector to a number of their applications, more details are here:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://gmailblog.blogspot.com/2010/08/access-two-gmail-accounts-at-once-in.html"&gt;Access two Gmail accounts at once in the same browser&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
A damn fine invention if you ask me!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-532419971609810615?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=N6N-nmQitao:JH-J74bUyPw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=N6N-nmQitao:JH-J74bUyPw:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=N6N-nmQitao:JH-J74bUyPw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=N6N-nmQitao:JH-J74bUyPw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=N6N-nmQitao:JH-J74bUyPw:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=N6N-nmQitao:JH-J74bUyPw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=N6N-nmQitao:JH-J74bUyPw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/532419971609810615/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=532419971609810615" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/532419971609810615?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/532419971609810615?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/N6N-nmQitao/have-more-than-one-gmail-account.html" title="Have more than one gmail account?" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2010/08/have-more-than-one-gmail-account.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEMMQXs9eSp7ImA9Wx5TFE4.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-6185198137422948225</id><published>2010-07-29T21:46:00.002+01:00</published><updated>2010-07-29T21:48:00.561+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-29T21:48:00.561+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Spring" /><title>How to do AND/OR type SQL queries using Hibernate AND/OR JPA using disjunctions</title><content type="html">If you have been using &lt;a href="http://www.hibernate.org/"&gt;Hibernate&lt;/a&gt; or &lt;a href="http://en.wikipedia.org/wiki/Java_Persistence_API"&gt;JPA&lt;/a&gt; for a while you will know that the &lt;a href="http://docs.jboss.org/hibernate/stable/core/reference/en/html/querycriteria.html"&gt;Criteria&lt;/a&gt; and &lt;a href="http://docs.jboss.org/hibernate/stable/core/reference/en/html/querycriteria.html#querycriteria-narrowing"&gt;Restrictions&lt;/a&gt; classes are very handy for querying the database without writing any SQL code and without worrying about the real column names (these are all captured in the annotations that you have applied to the domain objects).&lt;br /&gt;
&lt;br /&gt;
This is fine when you want to search for objects (rows) which are a combination of columns such as forename = "Andrew" AND surname = "Beacock" but what if you want to search for all people who either have a forename of Andrew and/or a surname of Beacock?&lt;br /&gt;
&lt;br /&gt;
This is where a "&lt;a href="http://docs.jboss.org/hibernate/stable/core/api/org/hibernate/criterion/Restrictions.html#disjunction%28%29"&gt;disjunction&lt;/a&gt;" comes in. This is one of the types hanging off the &lt;a href="http://docs.jboss.org/hibernate/stable/core/api/org/hibernate/criterion/Restrictions.html"&gt;Restrictions&lt;/a&gt; class and deals with AND/OR situations. The code below is looking through the 'products' table for any product that has a code or name starting with the text supplied:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:java"&gt;import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
 
Criteria criteria = session.createCriteria(Product.class);
criteria.add(
  Restrictions.disjunction()
    .add(Restrictions.ilike("code", codeOrName + "%"))
    .add(Restrictions.ilike("name", codeOrName + "%"))
);
return criteria.list();&lt;/pre&gt;&lt;br /&gt;
You can obviously add as many additional Restrictions as you like to the disjunction to make it as simple or complex as you like...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-6185198137422948225?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=PCMOseti7bw:grwwKI7y840:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=PCMOseti7bw:grwwKI7y840:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=PCMOseti7bw:grwwKI7y840:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=PCMOseti7bw:grwwKI7y840:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=PCMOseti7bw:grwwKI7y840:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=PCMOseti7bw:grwwKI7y840:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=PCMOseti7bw:grwwKI7y840:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/6185198137422948225/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=6185198137422948225" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/6185198137422948225?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/6185198137422948225?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/PCMOseti7bw/how-to-do-andor-type-sql-queries-using.html" title="How to do AND/OR type SQL queries using Hibernate AND/OR JPA using disjunctions" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2010/07/how-to-do-andor-type-sql-queries-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkcHSXc7fCp7ImA9WxFaGE8.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-7780166795247817022</id><published>2010-07-22T20:47:00.000+01:00</published><updated>2010-07-22T20:47:18.904+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-22T20:47:18.904+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Web" /><category scheme="http://www.blogger.com/atom/ns#" term="firefox" /><category scheme="http://www.blogger.com/atom/ns#" term="Mobile" /><title>iPhone version of the excellent Password Composer</title><content type="html">I've been using the excellent &lt;a href="http://www.xs4all.nl/%7Ejlpoutre/BoT/Javascript/PasswordComposer/"&gt;Password Composer&lt;/a&gt; &lt;a href="http://www.greasespot.net/"&gt;Greasemonkey&lt;/a&gt; script for &lt;a href="http://www.firefox.com/"&gt;Firefox&lt;/a&gt; for over 2 years now - it's a great way to ensure that your master password isn't spread around the web yet never gets in the way of accessing a site.&lt;br /&gt;
&lt;br /&gt;
My collegue&lt;a href="http://andykayley.blogspot.com/"&gt; Andy Kayley&lt;/a&gt; recently pointed out that there is an &lt;a href="http://www.indelible.org/ink/iphone-pwdcomposer/"&gt;iPhone version&lt;/a&gt; available so that you can easily access your &lt;a href="http://www.xs4all.nl/%7Ejlpoutre/BoT/Javascript/PasswordComposer/"&gt;Password Composer&lt;/a&gt; encrypted passwords whilst on the move!&amp;nbsp; It's written by &lt;a href="http://www.indelible.org/about/"&gt;Jon Parise&lt;/a&gt; and not only does he include a &lt;a href="http://www.indelible.org/ink/iphone-pwdcomposer/"&gt;link to his version&lt;/a&gt; but also goes into excellent detail on how he developed the iPhone application!&lt;br /&gt;
&lt;br /&gt;
Now I just need to get myself an iPhone... ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-7780166795247817022?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=N7DcPbT5QgU:1X3o8nz3OLc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=N7DcPbT5QgU:1X3o8nz3OLc:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=N7DcPbT5QgU:1X3o8nz3OLc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=N7DcPbT5QgU:1X3o8nz3OLc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=N7DcPbT5QgU:1X3o8nz3OLc:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=N7DcPbT5QgU:1X3o8nz3OLc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=N7DcPbT5QgU:1X3o8nz3OLc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/7780166795247817022/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=7780166795247817022" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/7780166795247817022?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/7780166795247817022?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/N7DcPbT5QgU/iphone-version-of-excellent-password.html" title="iPhone version of the excellent Password Composer" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2010/07/iphone-version-of-excellent-password.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0ECR3k9eyp7ImA9WxFXEU4.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-8375579566958303503</id><published>2010-05-17T22:27:00.001+01:00</published><updated>2010-05-17T22:27:46.763+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-17T22:27:46.763+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Web" /><title>googlemail is going, gmail returns (if you're in the UK)</title><content type="html">This might be old news now but Google now have the ability to use 'gmail.com' for UK people rather than the awkward 'googlemail.com':&lt;br /&gt;
&lt;blockquote&gt;Why did you change the name from Google  Mail to Gmail?&lt;br /&gt;
&lt;br /&gt;
A little more than a year after Gmail first launched, Google changed the  name of its webmail service in the United Kingdom to "Google Mail" due  to negotiations over a trademark dispute. We have reached a settlement,  so we are happily changing the name back to Gmail, and offering  @gmail.com addresses to all Google Mail users in the UK. Plus, it's  shorter and easier to type this way :) &lt;/blockquote&gt;There's more information about it here: &lt;a href="http://gmailblog.blogspot.com/2010/05/google-mail-is-becoming-gmail-in-uk.html"&gt;Google Mail is becoming Gmail in the UK&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="technoratitag"&gt;Technorati Tags: &lt;a href="http://www.technorati.com/tags/Google" rel="tag"&gt;Google&lt;/a&gt;, &lt;a href="http://www.technorati.com/tags/Gmail" rel="tag"&gt;Gmail&lt;/a&gt;, &lt;a href="http://www.technorati.com/tags/Andrew%20Beacock" rel="tag"&gt;Andrew Beacock&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-8375579566958303503?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=X4lUR2EAVqs:TawpEJ608TU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=X4lUR2EAVqs:TawpEJ608TU:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=X4lUR2EAVqs:TawpEJ608TU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=X4lUR2EAVqs:TawpEJ608TU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=X4lUR2EAVqs:TawpEJ608TU:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=X4lUR2EAVqs:TawpEJ608TU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=X4lUR2EAVqs:TawpEJ608TU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/8375579566958303503/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=8375579566958303503" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/8375579566958303503?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/8375579566958303503?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/X4lUR2EAVqs/googlemail-is-going-gmail-returns-if.html" title="googlemail is going, gmail returns (if you're in the UK)" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2010/05/googlemail-is-going-gmail-returns-if.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkQDQnkyeyp7ImA9WxFRFU4.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-7970809860415449776</id><published>2010-04-28T21:29:00.002+01:00</published><updated>2010-04-29T09:39:33.793+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-29T09:39:33.793+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Web" /><category scheme="http://www.blogger.com/atom/ns#" term="firefox" /><title>Firebug is a jQuery console test/debugging tool too!</title><content type="html">I thought everyone knew this, but after a chat with a couple of colleagues this week it seems that most don't know that...&lt;br /&gt;
&lt;br /&gt;
...if you use &lt;a href="http://getfirebug.com/"&gt;Firebug&lt;/a&gt; (in &lt;a href="http://www.mozilla.com/firefox/"&gt;Firefox&lt;/a&gt;) on a &lt;a href="http://jquery.com/"&gt;jQuery&lt;/a&gt;-enabled website, &lt;a href="http://getfirebug.com/"&gt;Firebug&lt;/a&gt;'s console can handle &lt;a href="http://api.jquery.com/category/selectors/"&gt;jQuery selectors&lt;/a&gt; and other&lt;a href="http://docs.jquery.com/Main_Page"&gt; jQuery magic&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
To see for yourself, make sure you have &lt;a href="http://getfirebug.com/"&gt;Firebug&lt;/a&gt; installed, then visit the &lt;a href="http://jquery.com/"&gt;jQuery home page&lt;/a&gt;. Ensure that&lt;a href="http://getfirebug.com/enable"&gt; the console is enabled&lt;/a&gt; and type the following and hit return:&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;$('#jq-content').fadeOut()&lt;/pre&gt;You should hopefully see most of &lt;a href="http://jquery.com/"&gt;jQuery's home page&lt;/a&gt; gently fade out!&lt;br /&gt;
&lt;br /&gt;
This feature is invaluable when investigating &amp;amp; debugging jQuery javascript code, make sure you install &lt;a href="http://getfirebug.com/"&gt;Firebug&lt;/a&gt; into Firefox today!&lt;br /&gt;
&lt;br /&gt;
&lt;span class="technoratitag"&gt;Technorati Tags: &lt;a href="http://www.technorati.com/tags/jQuery" rel="tag"&gt;jQuery&lt;/a&gt;, &lt;a href="http://www.technorati.com/tags/Firebug" rel="tag"&gt;Firebug&lt;/a&gt;, &lt;a href="http://www.technorati.com/tags/Firefox" rel="tag"&gt;Firefox&lt;/a&gt;, &lt;a href="http://www.technorati.com/tags/Andrew%20Beacock" rel="tag"&gt;Andrew Beacock&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-7970809860415449776?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=-crlMnbwgYM:y81G9PoYgZM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=-crlMnbwgYM:y81G9PoYgZM:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=-crlMnbwgYM:y81G9PoYgZM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=-crlMnbwgYM:y81G9PoYgZM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=-crlMnbwgYM:y81G9PoYgZM:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=-crlMnbwgYM:y81G9PoYgZM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=-crlMnbwgYM:y81G9PoYgZM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/7970809860415449776/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=7970809860415449776" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/7970809860415449776?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/7970809860415449776?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/-crlMnbwgYM/firebug-is-jquery-console-test-tool-too.html" title="Firebug is a jQuery console test/debugging tool too!" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>1</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2010/04/firebug-is-jquery-console-test-tool-too.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcARH09eCp7ImA9WxFSF0Q.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-4549125087615357040</id><published>2010-04-20T21:39:00.001+01:00</published><updated>2010-04-20T21:40:45.360+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-20T21:40:45.360+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Web" /><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Spring" /><title>jQuery tip: Selecting ids with periods in them (dots/'.')</title><content type="html">I was messing around with &lt;a href="http://jquery.com/"&gt;jQuery&lt;/a&gt; today combined with a &lt;a href="http://static.springsource.org/spring/docs/2.5.x/reference/mvc.html"&gt;Spring form-backed bean&lt;/a&gt; and was finding that my jQuery was failing to work. The id of the input field bound to my Spring form was &lt;code&gt;person.id&lt;/code&gt;.&lt;br /&gt;
&lt;br /&gt;
Trying to get the value entered into the input box was failing, this is what I was trying:&lt;pre class="brush:javascript"&gt;$('#person.id').val();&lt;/pre&gt;The problem here is the period - '.' - jQuery see these as CSS notation and so fails to find an element with that id, what you need to do is add two backslashes ('\\') before the period to escape it, like this:&lt;pre class="brush:javascript"&gt;$('#person\\.id').val();&lt;/pre&gt;See the &lt;a href="http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_element_by_an_ID_that_has_characters_used_in_CSS_notation.3F"&gt;jQuery FAQ&lt;/a&gt; for more details.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="technoratitag"&gt;Technorati Tags: &lt;a href="http://www.technorati.com/tags/jQuery" rel="tag"&gt;jQuery&lt;/a&gt;, &lt;a href="http://www.technorati.com/tags/Spring" rel="tag"&gt;Spring&lt;/a&gt;, &lt;a href="http://www.technorati.com/tags/Andrew Beacock" rel="tag"&gt;Andrew Beacock&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-4549125087615357040?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=8WaS75I4Jtk:JVL13Yrg7iE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=8WaS75I4Jtk:JVL13Yrg7iE:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=8WaS75I4Jtk:JVL13Yrg7iE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=8WaS75I4Jtk:JVL13Yrg7iE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=8WaS75I4Jtk:JVL13Yrg7iE:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=8WaS75I4Jtk:JVL13Yrg7iE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=8WaS75I4Jtk:JVL13Yrg7iE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/4549125087615357040/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=4549125087615357040" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/4549125087615357040?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/4549125087615357040?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/8WaS75I4Jtk/jquery-tip-selecting-ids-with-periods.html" title="jQuery tip: Selecting ids with periods in them (dots/'.')" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2010/04/jquery-tip-selecting-ids-with-periods.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4AQ30yfSp7ImA9WxFSE0w.&quot;"><id>tag:blogger.com,1999:blog-11593374.post-236074449283691450</id><published>2010-04-14T22:36:00.007+01:00</published><updated>2010-04-15T08:35:42.395+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-15T08:35:42.395+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Spring" /><title>Great tip regarding annotated Spring form validation &amp; BindingResult</title><content type="html">Found an interesting little gotcha at work last week, I was adding form validation to an &lt;a href="http://static.springsource.org/spring/docs/2.5.6/reference/mvc.html"&gt;annotated Spring controller&lt;/a&gt;, creating a &lt;a href="http://static.springsource.org/spring/docs/2.0.x/reference/validation.html"&gt;custom Validator&lt;/a&gt; to do the work and wiring it in to the controller's method signature with the use of the &lt;a href="http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/validation/BindingResult.html"&gt;BindingResult&lt;/a&gt; parameter (I just tacked it on the end of my existing parameters):&lt;br /&gt;
&lt;pre class="brush:java"&gt;@RequestMapping(method=RequestMethod.POST, params="action=person")
public String createPerson(@ModelAttribute("person") PersonForm person, ModelMap model, BindingResult result) {
    // code goes here...
}&lt;/pre&gt;This resulted in a slightly odd error message:&lt;br /&gt;
&lt;pre&gt;java.lang.IllegalStateException: Errors/BindingResult argument 
declared without preceding model attribute. Check your handler method 
signature!&lt;/pre&gt;I was a little confused by this message, it was indicating that I didn't have the form's model attribute declared &lt;a href="http://www.thefreedictionary.com/preceding"&gt;before&lt;/a&gt; the BindingResult but I certainly have. After some google searching for this error message I found a website created by a colleague of mine (&lt;a href="http://blog.lishman.com/"&gt;Mark Lishman&lt;/a&gt;) which had just the answer that I needed:&lt;br /&gt;
&lt;blockquote&gt;The &lt;code&gt;BindingResult&lt;/code&gt; parameter must be positioned directly  after the                       corresponding model argument that is being  validated.&lt;/blockquote&gt;Taken from the information tip box on the &lt;a href="http://levelup.lishman.com/index.php"&gt;Level Up&lt;/a&gt; &lt;a href="http://levelup.lishman.com/spring/form-processing/validation.php"&gt;Spring MVC Form Validation page&lt;/a&gt;.&lt;br /&gt;
So basically it meant that my controller method should have been this:&lt;br /&gt;
&lt;pre class="brush:java"&gt;@RequestMapping(method=RequestMethod.POST, params="action=person")
public String createPerson(@ModelAttribute("person") PersonForm person, BindingResult result, ModelMap model) {
    // code goes here...
}
&lt;/pre&gt;&lt;a href="http://levelup.lishman.com/index.php"&gt;Level Up&lt;/a&gt; is an excellent resource for people starting out with &lt;a href="http://levelup.lishman.com/spring/getting-started/index.php"&gt;Spring&lt;/a&gt;, &lt;a href="http://levelup.lishman.com/hibernate/getting-started/index.php"&gt;Hibernate&lt;/a&gt; &amp;amp; &lt;a href="http://levelup.lishman.com/oracle/sql-basics/index.php"&gt;Oracle&lt;/a&gt;, check it all out at the &lt;a href="http://levelup.lishman.com/index.php"&gt;Level Up website&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="technoratitag"&gt;Technorati Tags: &lt;a href="http://www.technorati.com/tags/Spring" rel="tag"&gt;Spring&lt;/a&gt;, &lt;a href="http://www.technorati.com/tags/Annotation" rel="tag"&gt;Annotation&lt;/a&gt;, &lt;a href="http://www.technorati.com/tags/Validation" rel="tag"&gt;Validation&lt;/a&gt;, &lt;a href="http://www.technorati.com/tags/Level%20Up" rel="tag"&gt;Level Up&lt;/a&gt;, &lt;a href="http://www.technorati.com/tags/Mark%20Lishman" rel="tag"&gt;Mark Lishman&lt;/a&gt;, &lt;a href="http://www.technorati.com/tags/Andrew%20Beacock" rel="tag"&gt;Andrew Beacock&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11593374-236074449283691450?l=blog.andrewbeacock.com' alt='' /&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=YeuD5ohsMsU:reIPIzuVHtQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=YeuD5ohsMsU:reIPIzuVHtQ:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=YeuD5ohsMsU:reIPIzuVHtQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=YeuD5ohsMsU:reIPIzuVHtQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=YeuD5ohsMsU:reIPIzuVHtQ:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/andrewbeacock?a=YeuD5ohsMsU:reIPIzuVHtQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/andrewbeacock?i=YeuD5ohsMsU:reIPIzuVHtQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://blog.andrewbeacock.com/feeds/236074449283691450/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=11593374&amp;postID=236074449283691450" title="11 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/236074449283691450?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/11593374/posts/default/236074449283691450?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/andrewbeacock/~3/YeuD5ohsMsU/good-tip-regarding-annotated-spring.html" title="Great tip regarding annotated Spring form validation &amp; BindingResult" /><author><name>Andy B</name><uri>http://www.blogger.com/profile/01039992884679308726</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://bp0.blogger.com/_Vu_eUOpUOMk/RgWamJV19TI/AAAAAAAAAGw/Lu_6ZKf-Glw/s400/buddy_icon.png" /></author><thr:total>11</thr:total><feedburner:origLink>http://blog.andrewbeacock.com/2010/04/good-tip-regarding-annotated-spring.html</feedburner:origLink></entry></feed>

