<?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" gd:etag="W/&quot;D0EESXc4fyp7ImA9WxNUEUk.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728</id><updated>2009-11-02T17:06:48.937+10:00</updated><title>just some Java guy</title><subtitle type="html">I could not fail to disagree with you less!</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/" /><link rel="hub" href="http://pubsubhubbub.appspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>47</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><link rel="self" href="http://feeds.feedburner.com/JustSomeJavaGuy" type="application/atom+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry gd:etag="W/&quot;D0EESXc_fCp7ImA9WxNUEUk.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-1913550428410819420</id><published>2009-11-02T17:05:00.002+10:00</published><updated>2009-11-02T17:06:48.944+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-02T17:06:48.944+10:00</app:edited><title>It's funny cause it's true</title><content type="html">“The problem with object-oriented languages is they’ve got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle.”—Joe Armstrong&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-1913550428410819420?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/jkCWNwg-vXg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/1913550428410819420/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=1913550428410819420" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/1913550428410819420?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/1913550428410819420?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/11/its-funny-cause-its-true.html" title="It's funny cause it's true" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;CkcCQXw_eip7ImA9WxNVFU8.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-6666955079799021666</id><published>2009-10-26T11:18:00.001+10:00</published><updated>2009-10-26T11:21:00.242+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-26T11:21:00.242+10:00</app:edited><title>Dependency Injection Makes Your Code Worse</title><content type="html">Read my article which explains why, and feel free to comment: &lt;br /&gt;&lt;br /&gt;&lt;a href="http://java.dzone.com/articles/dependency-injection-makes"&gt;http://java.dzone.com/articles/dependency-injection-makes&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-6666955079799021666?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/ph4uri95nC8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/6666955079799021666/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=6666955079799021666" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/6666955079799021666?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/6666955079799021666?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/10/dependency-injection-makes-your-code.html" title="Dependency Injection Makes Your Code Worse" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;D0YDRXo8eCp7ImA9WxNWEk4.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-9135907561954637825</id><published>2009-10-11T14:08:00.005+10:00</published><updated>2009-10-11T14:26:14.470+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-11T14:26:14.470+10:00</app:edited><title>understanding monads - thanks to jQuery</title><content type="html">In my previous post I wrote about jQuery: &lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;...if you simply wrap the "this" keyword with $(), it magically somehow becomes a jQuery object...&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I was taking a short break from watching Bathurst and googling monads again... when I came across &lt;a href="http://importantshock.wordpress.com/2009/01/18/jquery-is-a-monad/"&gt;this great blog post&lt;/a&gt;. It turns out that the magical things I love about jQuery are a monad!&lt;br /&gt;&lt;br /&gt;I feel like I'm a little bit closer to understanding monads now, and I'm happy to have a name to describe the magic I was using without knowing what it was.&lt;br /&gt;&lt;br /&gt;Go Lowndesy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-9135907561954637825?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/uY1R9lZIszo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/9135907561954637825/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=9135907561954637825" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/9135907561954637825?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/9135907561954637825?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/10/understanding-monads-thanks-to-jquery.html" title="understanding monads - thanks to jQuery" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;CUUFR3wzeyp7ImA9WxNXGU0.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-8108260486512737577</id><published>2009-10-07T18:11:00.002+10:00</published><updated>2009-10-07T18:13:36.283+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-07T18:13:36.283+10:00</app:edited><title>jQuery - using "this" in a .each() function</title><content type="html">The "this" keyword can be used in two ways inside a jQuery callback function. If you use "this" in the callback below without putting the $() around it, you will get a reference to the HTML element selected by the $(".currency") class selector.&lt;br /&gt;&lt;br /&gt;However, if you simply wrap the "this" keyword with $(), it magically somehow becomes a jQuery object, and you can use all the regular jQuery functions on it like .text() and .val()&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$(&amp;quot;.currency&amp;quot;).each(function() {&lt;br /&gt;   $(this).text(formatCurrency($(this).text()));&lt;br /&gt;});&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-8108260486512737577?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/jPQEo1djGIg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/8108260486512737577/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=8108260486512737577" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/8108260486512737577?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/8108260486512737577?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/10/jquery-using-this-in-each-function.html" title="jQuery - using &quot;this&quot; in a .each() function" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;D0EERHk5fip7ImA9WxNQGEs.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-1330432742732222767</id><published>2009-09-25T18:00:00.000+10:00</published><updated>2009-09-25T18:00:05.726+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-25T18:00:05.726+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="jQuery" /><title>How to copy a field value from a jQuery UI Dialog into a form</title><content type="html">If you have a form on your page, and would like to display a jQuery dialog which prompts for some extra data to add to the form before you submit it, here's how you can do it:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;lt;SCRIPT language=JavaScript&amp;gt;&lt;br /&gt;    function copyValueAndSubmit() {&lt;br /&gt;        $('#popupDiv').dialog(&amp;quot;destroy&amp;quot;).appendTo(&amp;quot;#myForm&amp;quot;);&lt;br /&gt;        $(&amp;quot;#myForm&amp;quot;).submit();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    $(function() {$('#popupDiv').dialog({autoOpen: false});});&lt;br /&gt;&amp;lt;/SCRIPT&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;form id=&amp;quot;myForm&amp;quot; name=&amp;quot;myForm&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;input id=&amp;quot;field1&amp;quot;/&amp;gt;&lt;br /&gt;    &amp;lt;input id=&amp;quot;field2&amp;quot;/&amp;gt;&lt;br /&gt;    &amp;lt;button type=&amp;quot;button&amp;quot; onclick=&amp;quot;$('#popupDiv').dialog('open');&amp;quot;&amp;gt;Save&amp;lt;/button&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;div style=&amp;quot;visibility:hidden;&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;div id=&amp;quot;popupDiv&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;input id=&amp;quot;field3&amp;quot;/&amp;gt;&lt;br /&gt;        &amp;lt;button type=&amp;quot;button&amp;quot; onclick=&amp;quot;copyValueAndSubmit();&amp;quot;&amp;gt;Submit&amp;lt;/button&amp;gt;&lt;br /&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Basically, the &lt;pre&gt;.dialog("destroy").appendTo("#myForm")&lt;/pre&gt; call allows you to grab whatever was in the popup dialog and append it to the form on your page before it gets submitted.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-1330432742732222767?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/7FnsZi_Vd6w" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/1330432742732222767/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=1330432742732222767" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/1330432742732222767?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/1330432742732222767?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/09/how-to-copy-field-value-from-jquery-ui.html" title="How to copy a field value from a jQuery UI Dialog into a form" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;D0UGQnc5fip7ImA9WxNQGEk.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-663464464668689138</id><published>2009-09-25T12:18:00.001+10:00</published><updated>2009-09-25T12:20:23.926+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-25T12:20:23.926+10:00</app:edited><title>No wonder Apple is concerned about Google's iPhone apps</title><content type="html">I just got my &lt;a href="http://justsomejavaguy.blogspot.com/2009/09/will-it-float-iphone-3gs-edition.html"&gt;replacement&lt;/a&gt; iPhone and it seemed to vibrate randomly. I thought maybe there was a problem with it - but it turns out Google has just enabled push email!&lt;br /&gt;&lt;br /&gt;I am extremely impressed with Google. Push Gmail is free and awesome, their calendar support and integration with the iPhone is awesome (including multiple calendars), and it all works with Google Apps for your own Domain as well.&lt;br /&gt;&lt;br /&gt;I think Google just killed MobileMe.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-663464464668689138?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/NIsZJwGlg1Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/663464464668689138/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=663464464668689138" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/663464464668689138?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/663464464668689138?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/09/no-wonder-apple-is-concerned-about.html" title="No wonder Apple is concerned about Google's iPhone apps" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;DkMER34yfCp7ImA9WxNQEUo.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-1128007913067653096</id><published>2009-09-17T17:54:00.004+10:00</published><updated>2009-09-17T18:00:06.094+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-17T18:00:06.094+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="mvc" /><category scheme="http://www.blogger.com/atom/ns#" term="spring" /><category scheme="http://www.blogger.com/atom/ns#" term="annotations" /><title>How to determine the type of Request with Spring MVC's @InitBinder</title><content type="html">If you want to determine the request method of a request (i.e."POST", "GET" etc) in Spring MVC, using a SimpleFormController you could just call  isFormSubmission(). When using annotations, the @RequestMapping annotation gives you that functionality for free in the annotation parameters.&lt;br /&gt;&lt;br /&gt;If you want to achieve the same thing on a method annotated with @InitBinder, the same does not apply. However, you can simply do this:&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&lt;br /&gt;@InitBinder&lt;br /&gt;public void initBinder(HttpServletRequest request) {&lt;br /&gt;    if (&amp;quot;POST&amp;quot;.equals(request.getMethod()){&lt;br /&gt;        //Do something&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Why would you want to know the type of request in an @InitBinder method? Stay tuned to find out one pretty cool application.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-1128007913067653096?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/Oin14-REvyI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/1128007913067653096/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=1128007913067653096" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/1128007913067653096?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/1128007913067653096?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/09/how-to-determine-type-of-request-with.html" title="How to determine the type of Request with Spring MVC's @InitBinder" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;A0EDR30_fip7ImA9WxNQEEU.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-9055748973850696621</id><published>2009-09-16T18:13:00.003+10:00</published><updated>2009-09-16T18:27:56.346+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-16T18:27:56.346+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="hibernate" /><category scheme="http://www.blogger.com/atom/ns#" term="jpa" /><category scheme="http://www.blogger.com/atom/ns#" term="oracle" /><title>Hibernate's "DELETE_ORPHAN" and a DataIntegrityViolationException</title><content type="html">Suppose you have DELETE_ORPHAN set on a parent child relationship like this:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;class Parent {&lt;br /&gt;    private List&amp;lt;Child&amp;gt; children = new ArrayList&amp;lt;Child&amp;gt;();&lt;br /&gt;&lt;br /&gt;    @OneToMany(cascade = CascadeType.ALL)&lt;br /&gt;    @Cascade({org.hibernate.annotations.CascadeType.DELETE_ORPHAN})&lt;br /&gt;    @JoinColumn(name = &amp;quot;ID&amp;quot;, nullable = false)&lt;br /&gt;    @IndexColumn(name = &amp;quot;INDEX&amp;quot;)&lt;br /&gt;    public List&amp;lt;BulkAmendmentCashflow&amp;gt; getBulkAmendmentCashflows() {&lt;br /&gt;        return bulkAmendmentCashflows;&lt;br /&gt;    }&lt;br /&gt;    ...&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;If your friendly Database Administrator (DBA) has set a unique database constraint on the "ID" and "INDEX" columns of your Oracle database, then under certain conditions you will get this sort of error:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;org.springframework.dao.DataIntegrityViolationException:&lt;br /&gt;...&lt;br /&gt;Caused by: java.sql.BatchUpdateException: ORA-00001: unique constraint (DB_NAME.UNIQUE_CONSTRAINT_NAME) violated&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;It usually occurs when you are both adding a new child and deleting an old child in the same transaction. &lt;br /&gt;&lt;br /&gt;I haven't fully investigated the cause of this in detail, but it seems likely to me that Hibernate is adding the new row before it deletes the old row. The new row gets the same INDEX as the row being deleted, so that the INDEX is kept in numeric order. Even though the transaction hasn't been completed, Oracle registers this as a violation of the constraint. &lt;br /&gt;&lt;br /&gt;There is an easy fix which keeps everyone happy (and the DBA can still keep their precious constraint!).&lt;br /&gt;&lt;br /&gt;The DBA needs to enable deferred constraints in Oracle on the constraint like this:&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&lt;br /&gt;alter table TABLE_NAME drop constraint CONSTRAINT_NAME;&lt;br /&gt;alter table TABLE_NAME add constraint CONSTRAINT_NAME UNIQUE (ID, INDEX) DEFERRABLE INITIALLY DEFERRED;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-9055748973850696621?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/rsbhx-3iL3I" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/9055748973850696621/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=9055748973850696621" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/9055748973850696621?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/9055748973850696621?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/09/hibernates-deleteorphan-and.html" title="Hibernate's &quot;DELETE_ORPHAN&quot; and a DataIntegrityViolationException" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;A0ABQ387cCp7ImA9WxNQEEU.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-8846017684943237588</id><published>2009-09-14T18:26:00.003+10:00</published><updated>2009-09-16T18:29:12.108+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-16T18:29:12.108+10:00</app:edited><title>Will it float? (iPhone 3GS edition)</title><content type="html">The Hi-Ho girls say: No.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_H9tXH4aTj8g/Sq4Bw7MNJVI/AAAAAAAAAGs/zX4SD4bGQKk/s1600-h/lettermanhdxpp5.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 223px;" src="http://1.bp.blogspot.com/_H9tXH4aTj8g/Sq4Bw7MNJVI/AAAAAAAAAGs/zX4SD4bGQKk/s400/lettermanhdxpp5.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5381240544788555090" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If your iPhone ends up in a swimming pool somehow like mine did, I recommend getting a vacuum cleaner onto it immediately. Pop out the sim card and suck from both ends - this is the best way to get the water out quickly.&lt;br /&gt;&lt;br /&gt;Do not use a hair dryer, it will simply push the water into places it shouldn't go, and evaporate the water, leaving behind all kinds of nasty residue.&lt;br /&gt;&lt;br /&gt;After you have vacuumed for about 15 minutes, get some silica gel packets (or kitty litter that contains silica) and put the phone in a zip-lock bag with them for two days. You can recharge silica gel packets by putting them into the oven for 30 minutes at 105 degrees Celsius.&lt;br /&gt;&lt;br /&gt;If it still doesn't work, don't call your home and contents insurer yet. Water damage is not covered under warranty, but Apple offers something called an "Out of warranty service" for $268.95 which might be a better option. &lt;br /&gt;&lt;br /&gt;As long as your phone hasn't been smashed into a million pieces or jailbroken into oblivion, they will fix it or replace it, even if your phone has been in the water.&lt;br /&gt;&lt;br /&gt;To summarise the most important point - if your phone goes in the water, use a Vacuum Cleaner!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-8846017684943237588?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/mFaEVAnnlMU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/8846017684943237588/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=8846017684943237588" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/8846017684943237588?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/8846017684943237588?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/09/will-it-float-iphone-3gs-edition.html" title="Will it float? (iPhone 3GS edition)" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_H9tXH4aTj8g/Sq4Bw7MNJVI/AAAAAAAAAGs/zX4SD4bGQKk/s72-c/lettermanhdxpp5.jpg" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;Dk8NQHs7cCp7ImA9WxNSEk4.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-3331741303658377331</id><published>2009-08-25T18:26:00.003+10:00</published><updated>2009-08-26T07:14:51.508+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-26T07:14:51.508+10:00</app:edited><title>Should I use BigDecimal or Double?</title><content type="html">Here's something to keep in mind using doubles and BigDecimals. When you do this:&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;System.out.println(new BigDecimal(0.1));&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;You get this:&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;0.1000000000000000055511151231257827021181583404541015625&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Pretty weird hey!&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigDecimal.html#BigDecimal(double)"&gt;javadoc&lt;/a&gt; explains what is going on, but I'll attempt to summarise it.&lt;br /&gt;&lt;br /&gt;Basically, The weirdness is not with BigDecimal, it is with double. Doubles &lt;span style="font-style:italic;"&gt;cannot&lt;/span&gt; accurately represent most decimal fractions. &lt;br /&gt;&lt;br /&gt;Why? Because a double by definition is a representation of a number that can be stored in 64 bits of data. If we want to store a number, the only way the computer can remember it is by setting 64 individual bits to either 1 or 0. This is fine for most whole numbers.&lt;br /&gt;&lt;br /&gt;However if we want to store a &lt;span style="font-style:italic;"&gt;decimal&lt;/span&gt; fraction like 0.1 - it simply cannot be done in 64 &lt;span style="font-style:italic;"&gt;binary&lt;/span&gt; bits of data.  &lt;span style="font-style:italic;"&gt;Binary&lt;/span&gt; land doesn't really know anything about &lt;span style="font-style:italic;"&gt;decimal&lt;/span&gt; land. It's like an inhabitant of Lineland trying to understand the world of &lt;a href="http://www.ibiblio.org/eldritch/eaa/F01.HTM"&gt;Flatland&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So to save our requested 0.1 double, the computer frantically flips those 64 ones and zeros until it gets something that is as close as possible to 0.1 - which as it turns out is 0.1000000000000000055511151231257827021181583404541015625.&lt;br /&gt;&lt;br /&gt;Then, when we use that double in BigDecimal's constructor - BigDecimal does an "exact conversion", and uses the number that is literally represented by those 64 bits.&lt;br /&gt;&lt;br /&gt;To summarise, if you care about the precision of your decimal fractions (eg. for storing currency), you should definitely be using BigDecimal. You should only be looking to use double if you know exactly why you need it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-3331741303658377331?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/OEANpDwLHxE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/3331741303658377331/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=3331741303658377331" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/3331741303658377331?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/3331741303658377331?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/08/should-i-use-bigdecimal-or-double.html" title="Should I use BigDecimal or Double?" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;AkAAQnc5eCp7ImA9WxNSEUU.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-6005592818644323231</id><published>2009-08-25T18:23:00.003+10:00</published><updated>2009-08-25T18:25:43.920+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-25T18:25:43.920+10:00</app:edited><title>How to automatically reload the page every 5 minutes</title><content type="html">There are a few ways to ensure that a page gets automatically refreshed - this one seems to work the best across multiple browsers.&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;lt;SCRIPT language=JavaScript&amp;gt;&lt;br /&gt;    //Refresh screen every 5 minutes.&lt;br /&gt;    setInterval('location.reload();', &amp;quot;300000&amp;quot;);&lt;br /&gt;&amp;lt;/SCRIPT&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-6005592818644323231?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/bNVCCkRp7Gc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/6005592818644323231/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=6005592818644323231" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/6005592818644323231?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/6005592818644323231?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/08/how-to-automatically-reload-page-every.html" title="How to automatically reload the page every 5 minutes" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;CEcEQHk5eip7ImA9WxNTFUk.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-1319473428363788921</id><published>2009-08-18T06:43:00.002+10:00</published><updated>2009-08-18T06:46:41.722+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-18T06:46:41.722+10:00</app:edited><title>Formatting source code on Blogger</title><content type="html">One would think that being owned by Google now, Blogger would have made SOME improvements. I haven't seen anything yet - and one thing that is sorely missing is the ability to easily format source code.&lt;br /&gt;&lt;br /&gt;Here is what I use for now:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://formatmysourcecode.blogspot.com/ "&gt;http://formatmysourcecode.blogspot.com/ &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-1319473428363788921?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/vvBAvrbNDko" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/1319473428363788921/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=1319473428363788921" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/1319473428363788921?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/1319473428363788921?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/08/formatting-source-code-on-blogger.html" title="Formatting source code on Blogger" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></entry><entry gd:etag="W/&quot;AkIFRno7fyp7ImA9WxNTFEQ.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-7103314878409084849</id><published>2009-08-17T18:38:00.004+10:00</published><updated>2009-08-17T18:41:57.407+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-17T18:41:57.407+10:00</app:edited><title>A single form checkbox macro for Freemarker and Spring</title><content type="html">If you want to use Freemarker in your SpringMVC project, Spring comes with a limited amount of macros in the file spring.ftl.&lt;br /&gt;&lt;br /&gt;One macro noteworthy for its absence is a macro to display a single checkbox. I've seen various snippets of example code around the web on how to do this, but all of them seemed to be deficient in either error handling or binding. Here's a macro that works!&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;lt;#macro formCheckbox path attributes=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;@spring.bind path /&amp;gt;&lt;br /&gt;    &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;_${spring.status.expression}&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;    &amp;lt;input type=&amp;quot;checkbox&amp;quot; id=&amp;quot;${spring.status.expression}&amp;quot; name=&amp;quot;${spring.status.expression}&amp;quot;&lt;br /&gt;           &amp;lt;#if spring.status.value?? &amp;amp;&amp;amp; spring.status.value?string==&amp;quot;true&amp;quot;&amp;gt;checked=&amp;quot;true&amp;quot;&amp;lt;/#if&amp;gt;&lt;br /&gt;    ${attributes}&lt;br /&gt;    &amp;lt;@spring.closeTag/&amp;gt;&lt;br /&gt;&amp;lt;/#macro&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-7103314878409084849?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/-T2VgZR5Zlg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/7103314878409084849/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=7103314878409084849" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/7103314878409084849?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/7103314878409084849?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/08/single-form-checkbox-macro-for.html" title="A single form checkbox macro for Freemarker and Spring" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;DkYBSH4-fSp7ImA9WxJUE08.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-7296827497289366514</id><published>2009-07-12T00:50:00.002+10:00</published><updated>2009-07-12T00:55:59.055+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-12T00:55:59.055+10:00</app:edited><title>How to modify http headers in Internet Explorer</title><content type="html">When developing for the web, you may want to simulate various HTTP Header values for your application. This is easy in Firefox - there are a number of plugins that allow you to do this like &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/967"&gt;Modify Headers&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;However for IE6 it is more difficult. The best solution I have found is this one:&lt;br /&gt;&lt;br /&gt;- Download &lt;a href="http://www.fiddler2.com/Fiddler2/version.asp"&gt;Fiddler&lt;/a&gt;.&lt;br /&gt;- Open the 'Customize Rules' window (Rules-&gt;Customize Rules...)&lt;br /&gt;- find this function: static function OnBeforeRequest(oSession: Session)&lt;br /&gt;- inside this function, add the header values that you would like to add, in this format:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;oSession.oRequest["headerName"] = "headerValue";&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;-save&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Voilà! Internet Explorer will now accept your custom header values. You will probably need to clear your browser cookies before it takes effect.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-7296827497289366514?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/bSVoFq7_fBs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/7296827497289366514/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=7296827497289366514" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/7296827497289366514?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/7296827497289366514?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/07/how-to-modify-http-headers-in-internet.html" title="How to modify http headers in Internet Explorer" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;A0EBQHs7fyp7ImA9WxJVE00.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-3369770800372030282</id><published>2009-06-30T07:05:00.003+10:00</published><updated>2009-06-30T07:07:31.507+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-30T07:07:31.507+10:00</app:edited><title>How to enable internet tethering (phone as modem) for iPhone 3GS on Australia's Three network</title><content type="html">Go Here:&lt;br /&gt;&lt;br /&gt;http://andrew.harrison.org/notes/3-tethering-and-mms/using-your-iphone-on-3/&lt;br /&gt;&lt;br /&gt;Follow the instructions in section 3 - "Enable tethering and MMS".&lt;br /&gt;&lt;br /&gt;I've done this and it works beautifully on a Windows machine.&lt;br /&gt;&lt;br /&gt;Then:&lt;br /&gt;&lt;br /&gt;Pair your iphone with windows in:&lt;br /&gt;Start -&gt; Control Panel -&gt; Bluetooth devices.&lt;br /&gt;&lt;br /&gt;Once it has been paired, you can connect to the internet simply by going to:&lt;br /&gt;Start -&gt; Connect to -&gt; Bluetooth network connection&lt;br /&gt;&lt;br /&gt;The iphone will appear in here as an access point.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-3369770800372030282?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/aPE3K8OXmHc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/3369770800372030282/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=3369770800372030282" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/3369770800372030282?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/3369770800372030282?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/06/how-to-enable-internet-tethering-phone.html" title="How to enable internet tethering (phone as modem) for iPhone 3GS on Australia's Three network" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;A0MDQnYyfSp7ImA9WxJVE00.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-3219172537782479099</id><published>2009-06-30T06:58:00.003+10:00</published><updated>2009-06-30T07:04:33.895+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-30T07:04:33.895+10:00</app:edited><title>How to update page text using javascript (and prototype)</title><content type="html">&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$('blah').innerHTML = '${valueToSet}';&lt;br /&gt;&amp;lt;label id=&amp;quot;blah&amp;quot;/&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Note: .innerText only works in IE.&lt;br /&gt;&lt;br /&gt;And if you want to display end-of-line characters correctly, for example, if the data has been entered using a textfield (using Freemarker and prototype)&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;$('commentsView').innerHTML = '${closeout.comments!&amp;quot;&amp;quot;?js_string}'; &lt;br /&gt;&amp;lt;label id=&amp;quot;commentsView&amp;quot;/&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-3219172537782479099?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/ITNZ4lkwQ2k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/3219172537782479099/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=3219172537782479099" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/3219172537782479099?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/3219172537782479099?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/06/how-to-update-page-text-using.html" title="How to update page text using javascript (and prototype)" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;DE8EQnY-fCp7ImA9WxJWEUU.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-8784920799059175018</id><published>2009-06-17T06:46:00.004+10:00</published><updated>2009-06-17T07:13:23.854+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-17T07:13:23.854+10:00</app:edited><title>13" Macbook Pro vs Vaio : Initial Hardware Impressions</title><content type="html">I just took delivery of a 13" Macbook Pro, after being a long time 13" Vaio user. Here are my initial impressions of the hardware, divided into WIN and FAIL Categories. I'll start with fail, because that is the most fun.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;FAILZ&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;High Gloss Screen == FAIL&lt;br /&gt;There's no question - it is too glossy. UQ has issued a &lt;a href="http://www.hrd.qut.edu.au/healthsafety/worksafely/highGloss.jsp"&gt;health and safety warning&lt;/a&gt; for it.&lt;br /&gt;&lt;br /&gt;Missing keys == FAIL&lt;br /&gt;No Home, End, Page Up, Page Down and Delete keys? What were they thinking? There's plenty of room to put them in, I guess I'll have to adjust my habits somehow - anyone know what mac users do to make up for these keys?&lt;br /&gt;&lt;br /&gt;Sharp wrist rest == FAIL&lt;br /&gt;The front lip of the macbook (when open) is a machined 90 degree angle, and is about as sharp a 90 degree angle as I have ever seen. When I'm lounging on my couch, this is where the heel of my hands rests (and rubs against). Painful! Yeah apple it makes the laptop look cool when it is closed, but this is one sacrifice of form over function that you shouldn't have taken.&lt;br /&gt;&lt;br /&gt;Click anywhere trackpad == FAIL&lt;br /&gt;I'm pretty sure I read somewhere that you can click anywhere on the oversized trackpad. Well you can't - you can click in about the bottom third of the trackpad, any higher than that the clicking action progressively diminishes into no click at all. &lt;br /&gt;&lt;br /&gt;Glowing Apple Logo == FAIL&lt;br /&gt;This is something I'd like to turn off. I don't consider myself an apple fanboy, and having that glowing apple log on the bus is embarrassing,&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;WINZ&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Backlit Keyboard == WIN&lt;br /&gt;It is very well designed, has nice keys and the backlighting is great at night. I still think they could have made the keys bigger though - my old Vaio managed to have full size keys with the same overall width.&lt;br /&gt;&lt;br /&gt;Stylish == WIN&lt;br /&gt;It's a beautiful machine, the aluminium and glass just looks superb. What amazed me is that when you turn it over - the bottom is just flat aluminium. They've managed to hide all the ugly bits very well.&lt;br /&gt;&lt;br /&gt;External Buttons, Lights, Plugs == WIN&lt;br /&gt;Superbly designed - hidden notification lights, a built in battery indicator on the side and the thing feels REALLY solid. It makes a precision 'thunk' when you close it like nothing I've ever heard.&lt;br /&gt;&lt;br /&gt;Oversize trackpad == WIN&lt;br /&gt;Nice and sensitive - almost as good as a Vaio. My tap to click occasionally doesn't register, but perhaps I just need to adjust my tap a little bit. The large size of the trackpad is brilliant too - why doesn't everyone make them this size?&lt;br /&gt;&lt;br /&gt;Low Weight == WIN&lt;br /&gt;It feels a LOT lighter than my Vaio - especially when in my back pack.&lt;br /&gt;&lt;br /&gt;Sound == WIN&lt;br /&gt;The speakers are hidden somewhere - (in front of the keyboard I think?) and they are excellent.  The sound is stereo, it goes loud, and it is directed towards me, which the Vaio was notoriously lacking in.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-8784920799059175018?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/nqtcKMnYqlE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/8784920799059175018/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=8784920799059175018" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/8784920799059175018?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/8784920799059175018?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/06/13-macbook-pro-vs-vaio-initial-hardware.html" title="13&quot; Macbook Pro vs Vaio : Initial Hardware Impressions" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></entry><entry gd:etag="W/&quot;CEEHQXk5eyp7ImA9WxJXEUQ.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-2590905173753309718</id><published>2009-06-05T19:01:00.001+10:00</published><updated>2009-06-05T19:03:50.723+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-05T19:03:50.723+10:00</app:edited><title>Maven jetty plugin can't find applicationContext.xml?</title><content type="html">If you get this error, in your web.xml you need to be explicit about the location of your applicationContext.xml (even if you have a Spring ContextLoaderListener defined).&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;lt;context-param&amp;gt;&lt;br /&gt;        &amp;lt;param-name&amp;gt;contextConfigLocation&amp;lt;/param-name&amp;gt;&lt;br /&gt;        &amp;lt;param-value&amp;gt;classpath:applicationContext.xml&amp;lt;/param-value&amp;gt;&lt;br /&gt; &amp;lt;/context-param&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;I would have thought that being a maven-jetty-plugin it would know where to look, but apparently it is too stoopid.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-2590905173753309718?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/bQ5Bd_wA4A8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/2590905173753309718/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=2590905173753309718" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/2590905173753309718?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/2590905173753309718?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/06/maven-jetty-plugin-cant-find.html" title="Maven jetty plugin can't find applicationContext.xml?" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;C04AQHo_cSp7ImA9WxJQFUU.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-3987752174872689289</id><published>2009-05-29T17:23:00.001+10:00</published><updated>2009-05-29T17:25:41.449+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-29T17:25:41.449+10:00</app:edited><title>How not to inspire your team to achieve greatness</title><content type="html">Today the data team leader sent out an email to the entire IT team that was only two paragraphs long, and yet managed to cram in all of the following phrases:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;"governance imperative"&lt;/li&gt;&lt;li&gt;"business initiative"&lt;/li&gt;&lt;li&gt;"management-driven"&lt;/li&gt;&lt;li&gt;"critical success factor"&lt;/li&gt;&lt;li&gt;"proactively"&lt;/li&gt;&lt;li&gt;"process and control"&lt;/li&gt;&lt;li&gt;"integrated, consolidated, improved"&lt;/li&gt;&lt;li&gt;"cross functional"&lt;/li&gt;&lt;li&gt;"fuels that power the modern corporation"&lt;/li&gt;&lt;li&gt;"mired in the prenatal lifecycle"&lt;/li&gt;&lt;li&gt;"need for effective collaboration"&lt;/li&gt;&lt;li&gt;"support mechanism for initiatives"&lt;/li&gt;&lt;li&gt;"effective collaborative structure for data-intense business initiatives"&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;In the words of Lisa Simpson: "Excuse me, but aren't these just buzzwords that dumb people use to sound smart?"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-3987752174872689289?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/vg4tWVr64Ms" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/3987752174872689289/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=3987752174872689289" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/3987752174872689289?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/3987752174872689289?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/05/how-not-to-inspire-your-team-to-achieve.html" title="How not to inspire your team to achieve greatness" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;CEUNRngzfSp7ImA9WxJQFEw.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-707241894812326281</id><published>2009-05-27T18:13:00.002+10:00</published><updated>2009-05-27T18:18:17.685+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-27T18:18:17.685+10:00</app:edited><title>Maven, Quartz and Spring 2.x</title><content type="html">If you have tried to use &lt;a href="http://static.springframework.org/spring/docs/2.5.x/reference/scheduling.html"&gt;scheduling&lt;/a&gt; in Spring 2.x and you are using Maven - you will probably be having trouble.&lt;br /&gt;&lt;br /&gt;In your stacktrace, you might be seeing this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Caused by: java.lang.NoClassDefFoundError: org/quartz/ObjectAlreadyExistsException&lt;br /&gt;    at java.lang.Class.getDeclaredConstructors0(Native Method)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;or this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Caused by: java.lang.NoSuchMethodError: org.apache.commons.collections.SetUtils.orderedSet(Ljava/util/Set;)Ljava/util/Set;&lt;br /&gt;    at org.quartz.JobDetail.&lt;init&gt;(JobDetail.java:85)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;It seems that the good folks over at &lt;a href="http://www.opensymphony.com"&gt;OpenSymphony&lt;/a&gt; (makers of &lt;a href="http://www.opensymphony.com/quartz/"&gt;Quartz&lt;/a&gt;) couldn't care less about Maven (I don't blame them) and making sure their pom.xml is correct (which it isn't).&lt;br /&gt;&lt;br /&gt;And Spring, which uses Quartz for scheduling, doesn't seem too concerned either about making sure that their pom.xml has the correct dependencies for Quartz (which it doesn't).&lt;br /&gt;&lt;br /&gt;The short of it is, if you want everything to just work, you'll need to explicitly include these two dependencies in your pom.xml:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;        &amp;lt;dependency&amp;gt;&lt;br /&gt;            &amp;lt;groupid&amp;gt;opensymphony&amp;lt;/groupid&amp;gt;&lt;br /&gt;            &amp;lt;artifactid&amp;gt;quartz-all&amp;lt;/artifactid&amp;gt;&lt;br /&gt;            &amp;lt;version&amp;gt;1.6.1&amp;lt;/version&amp;gt;&lt;br /&gt;        &amp;lt;/dependency&amp;gt;&lt;br /&gt;        &amp;lt;dependency&amp;gt;&lt;br /&gt;            &amp;lt;groupid&amp;gt;commons-collections&amp;lt;/groupid&amp;gt;&lt;br /&gt;            &amp;lt;artifactid&amp;gt;commons-collections&amp;lt;/artifactid&amp;gt;&lt;br /&gt;            &amp;lt;version&amp;gt;3.2&amp;lt;/version&amp;gt;&lt;br /&gt;        &amp;lt;/dependency&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And so, if you are in the unfortunate position of having to use Maven, I empathise. Let us weep together.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-707241894812326281?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/SkRk3yBNvBk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/707241894812326281/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=707241894812326281" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/707241894812326281?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/707241894812326281?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/05/maven-quartz-and-spring-2x.html" title="Maven, Quartz and Spring 2.x" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></entry><entry gd:etag="W/&quot;A0EMQHs5cSp7ImA9WxJQEk4.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-253748379679059128</id><published>2009-05-25T18:17:00.001+10:00</published><updated>2009-05-25T18:21:21.529+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-25T18:21:21.529+10:00</app:edited><title>How to refer to a file resource in test when using Maven</title><content type="html">Just do this, and it will work both in the IDE and in continuous integration:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Stick the file in the "test/resources" folder&lt;/li&gt;&lt;li&gt;&lt;pre&gt;File test = new File(getClass().getResource("/test.txt").getFile());&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;Thanks go to &lt;a href="http://jlorenzen.blogspot.com/2007/06/proper-way-to-access-file-resources-in.html"&gt;James&lt;/a&gt; and &lt;a href="http://www.google.com"&gt;Google&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-253748379679059128?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/Oyk0_SQEu_U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/253748379679059128/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=253748379679059128" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/253748379679059128?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/253748379679059128?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/05/how-to-refer-to-file-resource-in-test.html" title="How to refer to a file resource in test when using Maven" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;Ck8CQXw9fSp7ImA9WxJRGUo.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-3631065631224257859</id><published>2009-05-22T15:41:00.000+10:00</published><updated>2009-05-22T15:41:00.265+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-22T15:41:00.265+10:00</app:edited><title>Unexpected behaviour when defining @SessionAttributes by type in Spring MVC</title><content type="html">When defining model attributes that should serve as "command" objects (i.e. they span multiple requests), you have two options.&lt;br /&gt;&lt;br /&gt;You can define them either using Type or Name e.g.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;@SessionAttributes(types = {MyModelObject.class})&lt;br /&gt;@SessionAttributes(names = {"myModelObject"})&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I chose types originally, as at least this is something my compiler knows about - whereas a model name is just a string and will not be checked by the compiler.&lt;br /&gt;&lt;br /&gt;However using types caused a problem I didn't expect. If you decide to pass a Hibernate-managed domain object as your model, then it may not be the type you expect it to be! It has probably been wrapped using CGLIB for lazy loading reasons behind the scenes.&lt;br /&gt;&lt;br /&gt;So Spring cannot recognise the type of your model object, and hence it will not get set as a session scoped object. The next time you go to use it, it just won't be there, and there will be no warning or error as to why.&lt;br /&gt;&lt;br /&gt;Tricky! So from now on I just use the NAME option instead of TYPE when defining SpringMVC @SessionAttributes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-3631065631224257859?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/ucxkUXuNJ4M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/3631065631224257859/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=3631065631224257859" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/3631065631224257859?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/3631065631224257859?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/05/unexpected-behaviour-when-defining.html" title="Unexpected behaviour when defining @SessionAttributes by type in Spring MVC" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;A0UASH0yfCp7ImA9WxJRGE0.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-8719227410113066182</id><published>2009-05-20T18:44:00.002+10:00</published><updated>2009-05-20T18:47:29.394+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-20T18:47:29.394+10:00</app:edited><title>How to persist application config data in a database</title><content type="html">Suppose we have some Application wide configuration data that needs to be editable by users. For example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;RBA Interest Rate = 3.75%;&lt;br /&gt;Email Trigger = $50,000 or 20%;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;How can this information be stored in the database? It doesn't really relate to any entity in particular, it is just application-wide config data. Here's one way I've found of doing it - using an enum and a persistable entity class.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public enum ConfigParameterEnum {&lt;br /&gt;    RBA_INTEREST_RATE,&lt;br /&gt;    EMAIL_TRIGGER   &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@Entity&lt;br /&gt;public class ConfigParameter extends PersistableEntity {&lt;br /&gt;&lt;br /&gt;    private ConfigParameterEnum configParameterEnum;&lt;br /&gt;    private Class&lt;?&gt; clazz;&lt;br /&gt;    private String stringValue;&lt;br /&gt;&lt;br /&gt;    ...getters and setters...&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This way we still get the benefit of defined parameter names and also typed data, so the "email trigger" can be stored as either a value or a percentage.&lt;br /&gt;&lt;br /&gt;It will be easy for our Java code to find a persisted configuration parameter by name using the enum, and it will be easy to start using it thanks to the Class stored with it in the database.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-8719227410113066182?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/djqfvNnYPZQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/8719227410113066182/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=8719227410113066182" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/8719227410113066182?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/8719227410113066182?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/05/how-to-persist-application-config-data.html" title="How to persist application config data in a database" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;Dk4AQHoyeCp7ImA9WxJTE0Q.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-3491712663533126414</id><published>2009-04-22T17:17:00.005+10:00</published><updated>2009-04-22T20:09:01.490+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-22T20:09:01.490+10:00</app:edited><title>Thoughts about Spring MVC Controllers</title><content type="html">MVC has always seemed very complicated to me - and I think it is a concept that should be a lot simpler than most web frameworks make it. Spring Web MVC 2.5 has made some wonderful advancements over previous versions, with their emphasis on "convention over configuration" (or perhaps more accurately "convention, then configuration").&lt;br /&gt;&lt;br /&gt;For example, the superb @RequestMapping annotation, and ability to return a String as the view name which gets magically resolved, with the model automagically being implied in various ways which are outside the scope of this blog post:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;@Controller&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;public class AwesomeController {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    @RequestMapping("/importDailyBalance.do")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    public String importDailyBalance(HttpSession session) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        //do stuff&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        return "importDailyBalance";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Less well known, and hardly explained in the &lt;a href="http://static.springframework.org/spring/docs/2.5.x/reference/mvc.html"&gt;Spring Reference&lt;/a&gt; is some really cool stuff you can do like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;@Controller&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;@RequestMapping("/*.do")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;public class AwesomeController {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    @RequestMapping&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    public void importDailyBalance(HttpSession session) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        //do stuff&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;See! All I have to do on my method is add the @RequestMapping annotation - and Spring will figure out when it should be called based on the name of the method, and also what view it should resolve to.&lt;br /&gt;&lt;br /&gt;There is a tiny paragraph in the Spring Reference called &lt;span style="font-style: italic; font-weight: bold;"&gt;13.11.3.1. Advanced @RequestMapping options&lt;/span&gt; which basically just introduces some of these ideas, however I only picked up on it after reading one of the &lt;a href="http://blogs.warwick.ac.uk/chrismay/entry/spring_25_web"&gt;Spring developer's comments to an external blog&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;However that's pretty much where the "convention over configuration" ends. In my opinion, the convention over configuration doesn't go far enough. If you are happy for spring to serve every web request, you can actually change the "*.do" to "*.*"&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;@Controller&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;@RequestMapping("/*.*")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;public class AwesomeController {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    @RequestMapping&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    public void importDailyBalance(HttpSession session) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        //do stuff&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;It would be reasonable to assume that the two @RequestMapping configurations above could serve as a default for a @Controller. Or even better for the controller level mapping, by "convention" it could use the URL suffix pattern defined in the dispatcherServlet, which could then optionally be "configurable".&lt;br /&gt;&lt;br /&gt;But no, they do not. You cannot do something like this in Spring, and expect it to work:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;@Controller&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;public class AwesomeController {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    public void importDailyBalance(HttpSession session) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        //do stuff&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Wouldn't it be nice if the only annotation needed was the @Controller tag? That would be truly convention over configuration, and front end web development would be so much better! I can't see any technical reason why this couldn't be done, method names are resolved to views using the very sophisticated InternalPathMethodNameResolver.&lt;br /&gt;&lt;br /&gt;About the requirement for a @RequestMapping Annotation on every publicly callable method, Juergen Holler says this:&lt;br /&gt;&lt;blockquote&gt;This protects non-anntotated methods from ever getting invoked as a request handler - a danger with any pure convention-based solution, in particular now that the method signatures do not have to follow a specific convention (like they had to with MultiActionController).&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;But is a public method in a Controller being called really a danger? After all, if we are using a convention based solution, why would you have a public method in a controller that isn't supposed to be called?&lt;br /&gt;&lt;br /&gt;This is really just a minor annoyance for now though. I'm really looking forward to Spring 3 - after the progress they have made in 2.5 (as well as WebFlow 2), you can tell they are really trying to acheive their mission statement of "Eliminating Enterprise Java Complexity".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-3491712663533126414?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/-CqlzGZNaC8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/3491712663533126414/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=3491712663533126414" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/3491712663533126414?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/3491712663533126414?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/04/mvc-has-always-seemed-very-complicated.html" title="Thoughts about Spring MVC Controllers" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry><entry gd:etag="W/&quot;DEIHQHY8eCp7ImA9WxVUGUk.&quot;"><id>tag:blogger.com,1999:blog-616578738157248728.post-4884517782062180391</id><published>2009-03-25T11:59:00.000+10:00</published><updated>2009-03-25T12:02:11.870+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-25T12:02:11.870+10:00</app:edited><title>Personification of a startup script</title><content type="html">Every morning when I log in, the startup script at the government department I work at prints this to the screen: "Good Morning Daniel". And if it is afternoon, it prints "Good Afternoon Daniel".&lt;br /&gt;&lt;br /&gt;I can't imagine that a greeting like this would be part of government policy, or even exist in any departmental guidelines or any other document. Most likely, some developer somewhere in history  thought it would be cute. And now this greeting appears to every single government employee every single day.&lt;br /&gt;&lt;br /&gt;I don't like it.&lt;br /&gt;&lt;br /&gt;It's not just because I don't agree that it's cute. Or just because it's something that I have no option of turning off or ignoring. My dislike is much more intense than that, I view this as an affront to my humanity. This computer is a tool to me - nothing more. The greeting it gives me is something that is fundamentally human, it only belongs to humans and should never be uttered by a personified machine. The startup script doesn't care about me, the machine doesn't care about me, and the programmer who wrote it obviously doesn't care about me. So why write it?&lt;br /&gt;&lt;br /&gt;Sometimes humans say this phrase to people they don't like or care about just to be courteous, or out of habit. But in every case it at least involves one human acknowledging the existence of another. Both the computer and this startup script do not even acknowledge my existence - nor can they, so they have no right to use this phrase.&lt;br /&gt;&lt;br /&gt;I don't mind when things are written in a conversational style, or even when text is presented in a first person manner, as if the (human) writer of the text is addressing me personally. But for some long-gone programmer to write a "Good %timeOfDay%, %userName%" script to somehow personify and friendlify the startup screen and think that it will actually mean something to me is the most impersonal, condescending, thoughtless and insulting thing that a programmer could possibly do.&lt;br /&gt;&lt;br /&gt;If you are a programmer, please don't personify your scripts (unless you are being ironic or something).&lt;br /&gt;&lt;br /&gt;And have a nice day.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;P.S. Friendlify is not a word - and nor should it be. It is just a ridiculous made up word that attempts to express a concept that is ridiculous: to make something inanimate friendly.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/616578738157248728-4884517782062180391?l=justsomejavaguy.blogspot.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/JustSomeJavaGuy/~4/DQLhPwg669I" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://justsomejavaguy.blogspot.com/feeds/4884517782062180391/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=616578738157248728&amp;postID=4884517782062180391" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/4884517782062180391?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/616578738157248728/posts/default/4884517782062180391?v=2" /><link rel="alternate" type="text/html" href="http://justsomejavaguy.blogspot.com/2009/03/personification-of-startup-script.html" title="Personification of a startup script" /><author><name>Daniel Alexiuc</name><uri>http://www.blogger.com/profile/00317061160046734390</uri><email>noreply@blogger.com</email><gd:extendedProperty name="OpenSocialUserId" value="14472508167692382477" /></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></entry></feed>
