<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>Daniel E. Markle's Blog - Programming</title>
    <link>http://ashtech.net/~dmarkle/blog/</link>
    <description>Blatherings on Technology and Life</description>
    <dc:language>en</dc:language>
    <admin:errorReportsTo rdf:resource="mailto:" />
    <generator>Serendipity 2.1.4 - http://www.s9y.org/</generator>
    <managingEditor>syntax@ashtech.net (Daniel E. Markle)</managingEditor>
<webMaster>syntax@ashtech.net (Daniel E. Markle)</webMaster>

    <image>
    <url>http://ashtech.net/~syntax/blog/uploads/128blackcat.png</url>
    <title>RSS: Daniel E. Markle's Blog - Programming - Blatherings on Technology and Life</title>
    <link>http://ashtech.net/~dmarkle/blog/</link>
    <width>128</width>
    <height>128</height>
</image>

<item>
    <title>Java Collections, References, and Threads</title>
    <link>http://ashtech.net/~dmarkle/blog/archives/376-Java-Collections,-References,-and-Threads.html</link>
            <category>Programming</category>
    
    <comments>http://ashtech.net/~dmarkle/blog/archives/376-Java-Collections,-References,-and-Threads.html#comments</comments>
    <wfw:comment>http://ashtech.net/~dmarkle/blog/wfwcomment.php?cid=376</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://ashtech.net/~dmarkle/blog/rss.php?version=2.0&amp;type=comments&amp;cid=376</wfw:commentRss>
    

    <author>dmarkle@ashtech.net (Daniel E. Markle)</author>
    <content:encoded>
    Had an interesting discussion today in which a few points on Java came up. My primary focus has never been Java exclusively, so I am far from an expert, but I have been working with Java more extensively in the last few years with the Hadoop stack.&lt;br /&gt;
&lt;br /&gt;
Explore the &lt;a href=&quot;http://tutorials.jenkov.com/java-collections/map.html&quot;&gt;variety of Map implementations&lt;/a&gt;. I usually reach for HashMap when sometimes I should be thinking about the other Map types. Lots of other goodies to review there, when doing development with a &#039;get a project done&#039; focus it&#039;s easy to forget these basics, there&#039;s a bunch of other interesting Java collections topics in the sidebar there too.&lt;br /&gt;
&lt;br /&gt;
There are &lt;a href=&quot;https://community.oracle.com/blogs/enicholas/2006/05/04/understanding-weak-references&quot;&gt;different reference types&lt;/a&gt; in Java which affect garbage collection. Many Java implementations make heavy use of object and object factories, let garbage collection throw away some of the extra stuff you may not need in your implementation.&lt;br /&gt;
&lt;br /&gt;
In the fun with threads category, the &lt;a href=&quot;http://javamex.com/tutorials/synchronization_volatile.shtml&quot;&gt;volatile keyword&lt;/a&gt;. As the author at the link succinctly puts &quot;poorly documented, poorly understood, and rarely used.&quot; Avoid reliance on a changing global variable when using threads, use immutable types. Related to this is Java&#039;s &lt;a href=&quot;https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/package-summary.html&quot;&gt;Atomic classes&lt;/a&gt;, another construct to allow simultaneous access among threads to common values. These can provide efficiency gains in advanced use cases, but in general really think, read about, and consider safer alternative patterns before using. 
    </content:encoded>

    <pubDate>Tue, 14 Feb 2017 22:41:33 -0500</pubDate>
    <guid isPermaLink="false">http://ashtech.net/~dmarkle/blog/archives/376-guid.html</guid>
    
</item>
<item>
    <title>Java Enum Override</title>
    <link>http://ashtech.net/~dmarkle/blog/archives/339-Java-Enum-Override.html</link>
            <category>Programming</category>
    
    <comments>http://ashtech.net/~dmarkle/blog/archives/339-Java-Enum-Override.html#comments</comments>
    <wfw:comment>http://ashtech.net/~dmarkle/blog/wfwcomment.php?cid=339</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://ashtech.net/~dmarkle/blog/rss.php?version=2.0&amp;type=comments&amp;cid=339</wfw:commentRss>
    

    <author>dmarkle@ashtech.net (Daniel E. Markle)</author>
    <content:encoded>
    I get a lot of use out of Java 5 enums:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;enum Galaxies { MilkyWay, Andromeda, NGC4414 }&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
But here&#039;s a nice trick; as enum members are actually classes, you can override the member functions they contain. I find this most useful overriding toString:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;enum Galaxies {&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;MilkyWay {&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;@Override&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;public String toString() {&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;return &quot;Milky Way&quot;;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;},&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Andromeda,&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;NGC4414 {&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;@Override&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;public String toString() {&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;return &quot;NGC 4414&quot;;&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;}&lt;br /&gt;
}&lt;br /&gt;
&lt;/code&gt; 
    </content:encoded>

    <pubDate>Tue, 06 Mar 2012 08:38:07 -0500</pubDate>
    <guid isPermaLink="false">http://ashtech.net/~dmarkle/blog/archives/339-guid.html</guid>
    
</item>
<item>
    <title>Spring @RequestMapping Only on Classes Fails</title>
    <link>http://ashtech.net/~dmarkle/blog/archives/324-Spring-RequestMapping-Only-on-Classes-Fails.html</link>
            <category>Programming</category>
    
    <comments>http://ashtech.net/~dmarkle/blog/archives/324-Spring-RequestMapping-Only-on-Classes-Fails.html#comments</comments>
    <wfw:comment>http://ashtech.net/~dmarkle/blog/wfwcomment.php?cid=324</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://ashtech.net/~dmarkle/blog/rss.php?version=2.0&amp;type=comments&amp;cid=324</wfw:commentRss>
    

    <author>dmarkle@ashtech.net (Daniel E. Markle)</author>
    <content:encoded>
    When using &lt;a href=&quot;http://springframework.org&quot;&gt;Spring&lt;/a&gt; annotation based controllers, &lt;code&gt;@RequestMapping&lt;/code&gt; must be applied to a method as well as the class or it will not work. For example:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
@Controller&lt;br /&gt;
@RequestMapping(&quot;/blah.html&quot;)&lt;br /&gt;
public MyController {&lt;br /&gt;
&amp;#160;@ModelAttribute(&quot;session&quot;)&lt;br /&gt;
&amp;#160;public InventorySession getSession() {&lt;br /&gt;
&amp;#160;&amp;#160;return session;&lt;br /&gt;
&amp;#160;}&lt;br /&gt;
}&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
Will result in &lt;code&gt;No mapping found for HTTP request with URI [/[contextpath]/blah.html]&lt;/code&gt; errors. Request methods (or sub-pages) must be mapped to controller methods, i.e.:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
. . .&lt;br /&gt;
&amp;#160;@RequestMapping(method={RequestMethod.GET})&lt;br /&gt;
&amp;#160;public String getForm() {&lt;br /&gt;
&amp;#160;&amp;#160;return &quot;formView.jsp&quot;;&lt;br /&gt;
&amp;#160;}&lt;br /&gt;
. . .&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
This mistake is particularly easy to make when migrating older code to the newer annotation based model, where mappings on legacy code may make it (erroneously) appear such linking is done in the xml file already. 
    </content:encoded>

    <pubDate>Tue, 22 Mar 2011 19:17:24 -0400</pubDate>
    <guid isPermaLink="false">http://ashtech.net/~dmarkle/blog/archives/324-guid.html</guid>
    
</item>
<item>
    <title>Spring Session Bind to JSP</title>
    <link>http://ashtech.net/~dmarkle/blog/archives/323-Spring-Session-Bind-to-JSP.html</link>
            <category>Programming</category>
    
    <comments>http://ashtech.net/~dmarkle/blog/archives/323-Spring-Session-Bind-to-JSP.html#comments</comments>
    <wfw:comment>http://ashtech.net/~dmarkle/blog/wfwcomment.php?cid=323</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://ashtech.net/~dmarkle/blog/rss.php?version=2.0&amp;type=comments&amp;cid=323</wfw:commentRss>
    

    <author>dmarkle@ashtech.net (Daniel E. Markle)</author>
    <content:encoded>
    &lt;a href=&quot;http://springsource.org/&quot;&gt;Spring&lt;/a&gt;, my favorite Java application framework, doesn&#039;t provide an easy way to bind Spring-managed session beans to JSP pages. I have had success doing this by binding the bean to the request at creation time. When doing it this way, be sure to call the session bean somewhere in your dispatch servlet configuration or it will never be initialized when individual requests are created.&lt;br /&gt;
&lt;br /&gt;
Note that for most applications, session beans are better left as plain objects managed independently of Spring for less overhead and to keep them as simple as possible. Each of these is going to take up space for each user. However, I have found some cases where accessing Spring objects from within a session bean is desirable; if you have as well or curiosity prevails, details are below. &lt;a class=&quot;block_level&quot; href=&quot;http://ashtech.net/~dmarkle/blog/archives/323-Spring-Session-Bind-to-JSP.html#extended&quot;&gt;Continue reading &quot;Spring Session Bind to JSP&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 04 Mar 2011 17:59:25 -0500</pubDate>
    <guid isPermaLink="false">http://ashtech.net/~dmarkle/blog/archives/323-guid.html</guid>
    
</item>
<item>
    <title>Perl Custom Date Parsing</title>
    <link>http://ashtech.net/~dmarkle/blog/archives/315-Perl-Custom-Date-Parsing.html</link>
            <category>Programming</category>
    
    <comments>http://ashtech.net/~dmarkle/blog/archives/315-Perl-Custom-Date-Parsing.html#comments</comments>
    <wfw:comment>http://ashtech.net/~dmarkle/blog/wfwcomment.php?cid=315</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://ashtech.net/~dmarkle/blog/rss.php?version=2.0&amp;type=comments&amp;cid=315</wfw:commentRss>
    

    <author>dmarkle@ashtech.net (Daniel E. Markle)</author>
    <content:encoded>
    I was recently asked how to do custom date parsing in &lt;a href=&quot;http://perl.org/&quot;&gt;Perl&lt;/a&gt;, specifically for a date in the format mmddyyyy. I work with dates frequently in Java, so I am familiar with &lt;a href=&quot;http://ashtech.net/~dmarkle/blog/archives/54-Java-Date-Manipulation-Annoyances.html#extended&quot;&gt;using SimpleDateFormat objects to parse dates&lt;/a&gt; in this manner. The Perl equivalent is Date::Manip::Date. &lt;a class=&quot;block_level&quot; href=&quot;http://ashtech.net/~dmarkle/blog/archives/315-Perl-Custom-Date-Parsing.html#extended&quot;&gt;Continue reading &quot;Perl Custom Date Parsing&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Mon, 25 Oct 2010 17:37:22 -0400</pubDate>
    <guid isPermaLink="false">http://ashtech.net/~dmarkle/blog/archives/315-guid.html</guid>
    
</item>
<item>
    <title>Substance Look and Feel Upgrade Exception</title>
    <link>http://ashtech.net/~dmarkle/blog/archives/245-Substance-Look-and-Feel-Upgrade-Exception.html</link>
            <category>Programming</category>
    
    <comments>http://ashtech.net/~dmarkle/blog/archives/245-Substance-Look-and-Feel-Upgrade-Exception.html#comments</comments>
    <wfw:comment>http://ashtech.net/~dmarkle/blog/wfwcomment.php?cid=245</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://ashtech.net/~dmarkle/blog/rss.php?version=2.0&amp;type=comments&amp;cid=245</wfw:commentRss>
    

    <author>dmarkle@ashtech.net (Daniel E. Markle)</author>
    <content:encoded>
    Upgrading an old Java Swing application using &lt;a href=&quot;https://substance.dev.java.net/&quot;&gt;Substance LAF&lt;/a&gt; to 5.3, the old method of instantiating org.jvnet.substance.SubstanceLookAndFeel fails as this class is now abstract. This is documented in the &lt;a href=&quot;https://substance.dev.java.net/release-info/5.0/release-info.html&quot;&gt;release notes&lt;/a&gt;; however instantiating a concrete skin using:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;UIManager.setLookAndFeel(new SubstanceBusinessBlueSteelLookAndFeel());&lt;/code&gt; &lt;br /&gt;
&lt;br /&gt;
Causes the following error for most of them on OS X:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;Exception in thread &quot;AWT-EventQueue-0&quot; java.lang.ClassCastException: com.apple.laf.AquaRootPaneUI cannot be cast to org.jvnet.substance.SubstanceRootPaneUI&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Use the third recommended option instead:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;SubstanceLookAndFeel.setSkin(new SubstanceBusinessBlueSteelSkin());&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
This usage resolves the issue for every skin I&#039;ve tested. 
    </content:encoded>

    <pubDate>Wed, 03 Mar 2010 16:37:00 -0500</pubDate>
    <guid isPermaLink="false">http://ashtech.net/~dmarkle/blog/archives/245-guid.html</guid>
    
</item>
<item>
    <title>Grails GORM Id Sequence Naming</title>
    <link>http://ashtech.net/~dmarkle/blog/archives/239-Grails-GORM-Id-Sequence-Naming.html</link>
            <category>Programming</category>
    
    <comments>http://ashtech.net/~dmarkle/blog/archives/239-Grails-GORM-Id-Sequence-Naming.html#comments</comments>
    <wfw:comment>http://ashtech.net/~dmarkle/blog/wfwcomment.php?cid=239</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://ashtech.net/~dmarkle/blog/rss.php?version=2.0&amp;type=comments&amp;cid=239</wfw:commentRss>
    

    <author>dmarkle@ashtech.net (Daniel E. Markle)</author>
    <content:encoded>
    When working with automatic id&#039;s in &lt;a href=&quot;http://grails.org&quot;&gt;Grails&lt;/a&gt;, sequence generation uses a less than useful default sequence name of &lt;code&gt;hibernate_sequence&lt;/code&gt;. Use the following syntax as part of the &lt;a href=&quot;http://www.grails.org/GORM&quot;&gt;GORM&lt;/a&gt; mapping to set the sequence name to something sane:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;static mapping = {&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;id generator:sequence,params:[name:&#039;mytable_id_seq&#039;]&lt;br /&gt;
}&lt;/code&gt; 
    </content:encoded>

    <pubDate>Tue, 17 Nov 2009 23:44:00 -0500</pubDate>
    <guid isPermaLink="false">http://ashtech.net/~dmarkle/blog/archives/239-guid.html</guid>
    
</item>
<item>
    <title>org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions</title>
    <link>http://ashtech.net/~dmarkle/blog/archives/206-org.hibernate.HibernateException-Illegal-attempt-to-associate-a-collection-with-two-open-sessions.html</link>
            <category>Programming</category>
    
    <comments>http://ashtech.net/~dmarkle/blog/archives/206-org.hibernate.HibernateException-Illegal-attempt-to-associate-a-collection-with-two-open-sessions.html#comments</comments>
    <wfw:comment>http://ashtech.net/~dmarkle/blog/wfwcomment.php?cid=206</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://ashtech.net/~dmarkle/blog/rss.php?version=2.0&amp;type=comments&amp;cid=206</wfw:commentRss>
    

    <author>dmarkle@ashtech.net (Daniel E. Markle)</author>
    <content:encoded>
    Working on a Spring application using Hibernate recently I encountered the dreaded &lt;code&gt;org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions&lt;/code&gt; error. Fixes for this vary widely; it can be caused by problems ranging from bad session handling in your framework configuration, bad cascade settings, incorrect persistence settings, to forgetting initialization of an array stored in a &lt;code&gt;@ManyToOne&lt;/code&gt; database relation.&lt;br /&gt;
&lt;br /&gt;
Make sure to check thoroughly for the latter before wasting hours changing the transaction handling, trying various cascade settings, or mucking with persistence annotations. 
    </content:encoded>

    <pubDate>Wed, 11 Nov 2009 17:40:37 -0500</pubDate>
    <guid isPermaLink="false">http://ashtech.net/~dmarkle/blog/archives/206-guid.html</guid>
    
</item>
<item>
    <title>Grails FCKeditor Gotcha</title>
    <link>http://ashtech.net/~dmarkle/blog/archives/174-Grails-FCKeditor-Gotcha.html</link>
            <category>Programming</category>
    
    <comments>http://ashtech.net/~dmarkle/blog/archives/174-Grails-FCKeditor-Gotcha.html#comments</comments>
    <wfw:comment>http://ashtech.net/~dmarkle/blog/wfwcomment.php?cid=174</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://ashtech.net/~dmarkle/blog/rss.php?version=2.0&amp;type=comments&amp;cid=174</wfw:commentRss>
    

    <author>dmarkle@ashtech.net (Daniel E. Markle)</author>
    <content:encoded>
    When using the &lt;a href=&quot;http://grails.org/plugin/fckeditor&quot;&gt;FCKeditor plugin for Grails&lt;/a&gt;, if the data is loaded into the view this way:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
&amp;lt;fckeditor:editor name=&quot;detail&quot;&amp;gt;&lt;br /&gt;
&amp;#160;&amp;#160;${fieldValue(bean:itemInstance,field:&#039;detail&#039;)}&lt;br /&gt;
&amp;lt;/fckeditor:editor&amp;gt;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
The raw html being retrieved from the data source will not be parsed as expected. This will display as html source in the editor, and if saved will result in the html tags being placed into the data source as escaped text. For correct handling, add &lt;code&gt;.decodeHTML()&lt;/code&gt; to the JSTL retrieval:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
&amp;lt;fckeditor:editor name=&quot;detail&quot;&amp;gt;&lt;br /&gt;
&amp;#160;&amp;#160;${fieldValue(bean:itemInstance,field:&#039;detail&#039;).decodeHTML()}&lt;br /&gt;
&amp;lt;/fckeditor:editor&amp;gt;&lt;br /&gt;
&lt;/code&gt; 
    </content:encoded>

    <pubDate>Wed, 28 Oct 2009 21:27:21 -0400</pubDate>
    <guid isPermaLink="false">http://ashtech.net/~dmarkle/blog/archives/174-guid.html</guid>
    
</item>
<item>
    <title>The C++ Lands</title>
    <link>http://ashtech.net/~dmarkle/blog/archives/165-The-C++-Lands.html</link>
            <category>Programming</category>
    
    <comments>http://ashtech.net/~dmarkle/blog/archives/165-The-C++-Lands.html#comments</comments>
    <wfw:comment>http://ashtech.net/~dmarkle/blog/wfwcomment.php?cid=165</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://ashtech.net/~dmarkle/blog/rss.php?version=2.0&amp;type=comments&amp;cid=165</wfw:commentRss>
    

    <author>dmarkle@ashtech.net (Daniel E. Markle)</author>
    <content:encoded>
    Every programmer I know has played Dungeons and Dragons at some point. &lt;a href=&quot;http://alenacpp.blogspot.com/2009/06/c.html&quot;&gt;The C++ Lands Map&lt;/a&gt; is a beautiful merging of the two worlds. There are some &lt;a href=&quot;http://www.boingboing.net/2009/06/04/dd-style-map-of-c.html&quot;&gt;amusing comments on the map at boing boing&lt;/a&gt; too.&lt;br /&gt;
&lt;br /&gt;
I would love to have a poster print of this on some good quality parchment-like stock. Perhaps the author will do a commercial printing of it in the future. 
    </content:encoded>

    <pubDate>Tue, 09 Jun 2009 23:33:51 -0400</pubDate>
    <guid isPermaLink="false">http://ashtech.net/~dmarkle/blog/archives/165-guid.html</guid>
    
</item>
<item>
    <title>Injecting DAO Objects Into Spring Controllers </title>
    <link>http://ashtech.net/~dmarkle/blog/archives/127-Injecting-DAO-Objects-Into-Spring-Controllers.html</link>
            <category>Programming</category>
    
    <comments>http://ashtech.net/~dmarkle/blog/archives/127-Injecting-DAO-Objects-Into-Spring-Controllers.html#comments</comments>
    <wfw:comment>http://ashtech.net/~dmarkle/blog/wfwcomment.php?cid=127</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://ashtech.net/~dmarkle/blog/rss.php?version=2.0&amp;type=comments&amp;cid=127</wfw:commentRss>
    

    <author>dmarkle@ashtech.net (Daniel E. Markle)</author>
    <content:encoded>
    When building &lt;a href=&quot;http://springframework.org&quot;&gt;Spring&lt;/a&gt; controllers, it is often useful to access a DAO instance which has been set up in &lt;code&gt;applicationContext.xml&lt;/code&gt;. To do so, add a variable in the controller for the DAO as well as a setter for it. Once this is done, wire it up by reference in &lt;code&gt;dispatcher-servlet.xml&lt;/code&gt;. &lt;a class=&quot;block_level&quot; href=&quot;http://ashtech.net/~dmarkle/blog/archives/127-Injecting-DAO-Objects-Into-Spring-Controllers.html#extended&quot;&gt;Continue reading &quot;Injecting DAO Objects Into Spring Controllers &quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 05 Feb 2009 21:27:42 -0500</pubDate>
    <guid isPermaLink="false">http://ashtech.net/~dmarkle/blog/archives/127-guid.html</guid>
    
</item>
<item>
    <title>Spring Generic URL Handling</title>
    <link>http://ashtech.net/~dmarkle/blog/archives/126-Spring-Generic-URL-Handling.html</link>
            <category>Programming</category>
    
    <comments>http://ashtech.net/~dmarkle/blog/archives/126-Spring-Generic-URL-Handling.html#comments</comments>
    <wfw:comment>http://ashtech.net/~dmarkle/blog/wfwcomment.php?cid=126</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://ashtech.net/~dmarkle/blog/rss.php?version=2.0&amp;type=comments&amp;cid=126</wfw:commentRss>
    

    <author>dmarkle@ashtech.net (Daniel E. Markle)</author>
    <content:encoded>
    Often when working with &lt;a href=&quot;http://www.springsource.org/&quot;&gt;Spring Web MVC&lt;/a&gt; mappings I want all calls to a certain extension handled by a generic resolver, i.e. mapping &quot;*.html&quot; to corresponding &quot;*.jsp&quot; entries in WEB-INF. This is easily done using &lt;a href=&quot;http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/web/servlet/mvc/UrlFilenameViewController.html&quot;&gt;UrlFilenameViewController&lt;/a&gt; which automatically passes the parsed filename to the view resolver. &lt;a class=&quot;block_level&quot; href=&quot;http://ashtech.net/~dmarkle/blog/archives/126-Spring-Generic-URL-Handling.html#extended&quot;&gt;Continue reading &quot;Spring Generic URL Handling&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 05 Feb 2009 17:29:34 -0500</pubDate>
    <guid isPermaLink="false">http://ashtech.net/~dmarkle/blog/archives/126-guid.html</guid>
    
</item>
<item>
    <title>JTableModel Implementation Null Gotchas</title>
    <link>http://ashtech.net/~dmarkle/blog/archives/123-JTableModel-Implementation-Null-Gotchas.html</link>
            <category>Programming</category>
    
    <comments>http://ashtech.net/~dmarkle/blog/archives/123-JTableModel-Implementation-Null-Gotchas.html#comments</comments>
    <wfw:comment>http://ashtech.net/~dmarkle/blog/wfwcomment.php?cid=123</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://ashtech.net/~dmarkle/blog/rss.php?version=2.0&amp;type=comments&amp;cid=123</wfw:commentRss>
    

    <author>dmarkle@ashtech.net (Daniel E. Markle)</author>
    <content:encoded>
    A Java Swing user interface I am working on which makes extensive use of a custom &lt;a href=&quot;http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/table/TableModel.html&quot;&gt;JTableModel&lt;/a&gt; implementation was failing. In certain instances when my data structure changes, it purges empty cells. If the cursor was left in these cells while this was taking place, the table would become unresponsive, often requiring an application restart to fix.&lt;br /&gt;
&lt;br /&gt;
Watch for issues with &lt;code&gt;setValueAt&lt;/code&gt;, which in some cases can be called with invalid values. In particular if the cursor is editing a field, the table is not refreshed until the edit focus leaves the widget even if you try to force it with &lt;code&gt;validate()&lt;/code&gt; calls. In my instance the ideal fix was to add checks and do nothing instead of throwing exceptions.&lt;br /&gt;
&lt;br /&gt;
With &lt;code&gt;getValueAt&lt;/code&gt;, some table widget types choked on my default of null, which I was returning for invalid cells. Using an empty string instead of null for these invalid cells fixed this problem. 
    </content:encoded>

    <pubDate>Mon, 20 Oct 2008 18:29:51 -0400</pubDate>
    <guid isPermaLink="false">http://ashtech.net/~dmarkle/blog/archives/123-guid.html</guid>
    
</item>
<item>
    <title>JSPX, Tag Minimization, and Firefox 3</title>
    <link>http://ashtech.net/~dmarkle/blog/archives/120-JSPX,-Tag-Minimization,-and-Firefox-3.html</link>
            <category>Programming</category>
    
    <comments>http://ashtech.net/~dmarkle/blog/archives/120-JSPX,-Tag-Minimization,-and-Firefox-3.html#comments</comments>
    <wfw:comment>http://ashtech.net/~dmarkle/blog/wfwcomment.php?cid=120</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://ashtech.net/~dmarkle/blog/rss.php?version=2.0&amp;type=comments&amp;cid=120</wfw:commentRss>
    

    <author>dmarkle@ashtech.net (Daniel E. Markle)</author>
    <content:encoded>
    Firefox 3 introduces a new behavior when your doctype is XHTML Strict; certain tags that do not allow minimization as per the spec no longer close anyway. For example, if you use a &lt;code&gt;&amp;lt;script src=&quot;blah.js&quot; /&amp;gt;&lt;/code&gt; tag in your heading, Firefox 3 will take the whole rest of the page as a script, which will result in a blank page. This is good as it enforces standards compliance, however jspx minimizes tags, so you may have &lt;code&gt;&amp;lt;script src=&quot;blah.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt; on your page, but the actual rendered page will minimize it.&lt;br /&gt;
&lt;br /&gt;
There are many ways to fix this issue by playing tricks on jspx, I recommend:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&amp;lt;script src=&quot;blah.js&quot;&amp;gt;&amp;lt;!-- //prevent jspx minimization --&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
This reminds me when I&#039;m working on the code why that comment is there. Hopefully this will be fixed in the jspx spec at some point. 
    </content:encoded>

    <pubDate>Wed, 17 Sep 2008 18:11:55 -0400</pubDate>
    <guid isPermaLink="false">http://ashtech.net/~dmarkle/blog/archives/120-guid.html</guid>
    
</item>
<item>
    <title>Spring Binary and Text Forms</title>
    <link>http://ashtech.net/~dmarkle/blog/archives/115-Spring-Binary-and-Text-Forms.html</link>
            <category>Programming</category>
    
    <comments>http://ashtech.net/~dmarkle/blog/archives/115-Spring-Binary-and-Text-Forms.html#comments</comments>
    <wfw:comment>http://ashtech.net/~dmarkle/blog/wfwcomment.php?cid=115</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://ashtech.net/~dmarkle/blog/rss.php?version=2.0&amp;type=comments&amp;cid=115</wfw:commentRss>
    

    <author>dmarkle@ashtech.net (Daniel E. Markle)</author>
    <content:encoded>
    A project I am working on requires binary image files and form data to be submitted simultaneously.  This is rather easy to do with &lt;a href=&quot;http://springframework.org/&quot;&gt;Spring&lt;a&gt;, following the directions available in the latest documentation to &lt;a href=&quot;http://static.springframework.org/spring/docs/2.5.x/reference/mvc.html#mvc-multipart-forms&quot;&gt;handle file uploads in a form&lt;/a&gt;.  It does not mention there that you can mix form fields as well as file upload fields when doing this, but it works as expected. &lt;a class=&quot;block_level&quot; href=&quot;http://ashtech.net/~dmarkle/blog/archives/115-Spring-Binary-and-Text-Forms.html#extended&quot;&gt;Continue reading &quot;Spring Binary and Text Forms&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Thu, 05 Jun 2008 18:52:40 -0400</pubDate>
    <guid isPermaLink="false">http://ashtech.net/~dmarkle/blog/archives/115-guid.html</guid>
    
</item>

</channel>
</rss>
