<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Robin&#039;s Tech Tips</title>
	<atom:link href="http://robin.mytechtip.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://robin.mytechtip.com</link>
	<description>Just another My Tech Tip weblog</description>
	<lastBuildDate>Wed, 09 Jun 2010 05:46:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to Configure Spring beans.xml File: The Use of PropertyPlaceholderConfigurer</title>
		<link>http://robin.mytechtip.com/2010/06/09/spring-beans-xml-file-the-use-of-propertyplaceholderconfigurer/</link>
		<comments>http://robin.mytechtip.com/2010/06/09/spring-beans-xml-file-the-use-of-propertyplaceholderconfigurer/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 05:28:47 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[beans.xml]]></category>
		<category><![CDATA[properties]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://robin.mytechtip.com/?p=117</guid>
		<description><![CDATA[
The file &#8220;beans.xml&#8221; used for you application is already a kind of configuration file. However, this file is designed for the developer who can quickly customize the application with less coding changes. It is not recommended for an end user to change the file.
For example, you can, of course, define the database connection properties in [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<p>The file &#8220;beans.xml&#8221; used for you application is already a kind of configuration file. However, this file is designed for the developer who can quickly customize the application with less coding changes. It is not recommended for an end user to change the file.</p>
<p>For example, you can, of course, define the database connection properties in the beans.xml file straight away. This way, every time a user wants the application to connect to a database at a different location, the beans.xml file needs to be modified. For a complicated application, the file can grow very complicated as well. Therefore, making changes to the beans.xml file directly may not seem obvious to the end user.</p>
<p>Fortunately, Spring have already come up with a solution for this problem. You can define the properties in the &#8220;beans.xml&#8221; file with place holders and use the Spring provided bean <code><strong>PropertyPlaceholderConfigurer</strong></code> to replace the place holders with the value from a properties file. Here is <a href="http://static.springsource.org/spring/docs/2.5.x/reference/beans.html#beans-factory-extension-factory-postprocessors" onclick="javascript:pageTracker._trackPageview('/outbound/article/static.springsource.org');">an example of the use of PropertyPlaceholderConfigurer</a>.</p>
<p>In the example from the above link, it specifies one location for the properties file with a classpath: &#8220;classpath:com/foo/jdbc.properties&#8221;. In addition to that, you can also specify a file on your file system. When using a file on file system, remember to add &#8220;file:/&#8221; to an absolute path; otherwise, Spring will treat it as a relative path even the value starts with &#8220;/&#8221;.</p>
<p><code>PropertyPlaceholderConfigurer</code> also allows you to define some default values using the property &#8220;<strong>properties</strong>&#8220;. The following is an example of using the default values if the file defined by &#8220;<strong>locations</strong>&#8221; property does not exist. Please note setting &#8220;<strong>ignoreResourceNotFound</strong>&#8221; to <strong>true </strong>is necessary. If not set, the application will throw exception if the defined property does not exist even we&#8217;ve defined the default values.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.springframework.beans.factory.config.PropertyPlaceholderConfigurer&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ignoreResourceNotFound&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;locations&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>file:///etc/app/jdbc.properties<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;properties&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;props<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prop</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;jdbc.driverClassName&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>com.mysql.jdbc.Driver<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prop<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prop</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;jdbc.url&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>jdbc:mysql://localhost:3306/mytechtip<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prop<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prop</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;jdbc.username&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>jdbc_username<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prop<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prop</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;jdbc.password&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>xxx<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prop<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/props<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;dataSource&quot;</span> <span style="color: #000066;">destroy-method</span>=<span style="color: #ff0000;">&quot;close&quot;</span> </span>
<span style="color: #009900;">    <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.apache.commons.dbcp.BasicDataSource&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;driverClassName&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${jdbc.driverClassName}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;url&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${jdbc.url}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;username&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${jdbc.username}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;password&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${jdbc.password}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://robin.mytechtip.com/2010/06/09/spring-beans-xml-file-the-use-of-propertyplaceholderconfigurer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Configure Spring beans.xml File: Collection properties and EntityManagerFactory Examples</title>
		<link>http://robin.mytechtip.com/2010/06/07/configure-spring-beans-xml-collection-properties-and-entitymanagerfactory-examples/</link>
		<comments>http://robin.mytechtip.com/2010/06/07/configure-spring-beans-xml-collection-properties-and-entitymanagerfactory-examples/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 05:43:51 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[beans.xml]]></category>
		<category><![CDATA[EntityManager]]></category>
		<category><![CDATA[openjpa]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://robin.mytechtip.com/?p=106</guid>
		<description><![CDATA[
Java beans in Spring can also have their collection properties populated in the beans.xml file. The collection properties here mean things like List, Map and Array.
For example, if you want to create a JPA EntityManagerFactory with a set of connection properties, these properties can be configured in beans.xml like this:

&#60;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&#62;
&#60;beans xmlns=&#34;http://www.springframework.org/schema/beans&#34;
  xmlns:xsi=&#34;http://www.w3.org/2001/XMLSchema-instance&#34; [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<p>Java beans in Spring can also have their collection properties populated in the beans.xml file. The collection properties here mean things like List, Map and Array.</p>
<p>For example, if you want to create a JPA EntityManagerFactory with a set of connection properties, these properties can be configured in beans.xml like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;beans</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.springframework.org/schema/beans&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span> </span>
<span style="color: #009900;">  <span style="color: #000066;">xmlns:p</span>=<span style="color: #ff0000;">&quot;http://www.springframework.org/schema/p&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">xsi:schemaLocation</span>=<span style="color: #ff0000;">&quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;entityManagerFactoryCreator&quot;</span> </span>
<span style="color: #009900;">    <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;com.mytechtip.example.EntityManagerFactoryCreator&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;persistenceUnitName&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;HRMN_Repository&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;jpaProperties&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;props<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prop</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;openjpa.ConnectionURL&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>the_url<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prop<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prop</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;openjpa.ConnectionDriverName&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>the_driver_class_name<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prop<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prop</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;openjpa.ConnectionUserName&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>the_user_name<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prop<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prop</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;openjpa.ConnectionPassword&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>the_password<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prop<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/props<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/beans<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Here, jpaProperties in the actual java class &#8220;<code>EntityManagerFactoryCreator</code>&#8221; is an instance of <code>Properties</code>. And you can just use this properties to create EntityManagerFactory.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">    <span style="color: #666666; font-style: italic;">// ...</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">Properties</span> jpaProperties<span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">//...</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setJpaProperties<span style="color: #009900;">&#40;</span><span style="color: #003399;">Properties</span> prop<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">jpaProperties</span> <span style="color: #339933;">=</span> prop<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #666666; font-style: italic;">// ...</span>
    <span style="color: #000000; font-weight: bold;">public</span> EntityManagerFactory create<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> Persistence.<span style="color: #006633;">createEntityManagerFactory</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;myPersistenceUnit&quot;</span>, prop<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Actually, Spring already have something similar for you to access EntityManagerFactory with ease. The beans used for the task are: </p>
<ul>
<li><code>org.springframework.orm.jpa.LocalEntityManagerFactoryBean</code></li>
<li><code>org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean</code></li>
</ul>
<p>More information / examples can be found <a href="http://static.springsource.org/spring/docs/2.5.x/reference/orm.html#orm-jpa-setup" onclick="javascript:pageTracker._trackPageview('/outbound/article/static.springsource.org');">here about the support of JPA entity manager factory creatation in Spring</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://robin.mytechtip.com/2010/06/07/configure-spring-beans-xml-collection-properties-and-entitymanagerfactory-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Configure Spring beans.xml File: Basic Usage</title>
		<link>http://robin.mytechtip.com/2010/05/18/how-to-configure-spring-beans-xml-file-basic-usage/</link>
		<comments>http://robin.mytechtip.com/2010/05/18/how-to-configure-spring-beans-xml-file-basic-usage/#comments</comments>
		<pubDate>Tue, 18 May 2010 03:55:42 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[beans.xml]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://robin.mytechtip.com/?p=76</guid>
		<description><![CDATA[how to configure spring beans.xml file with more flexibility
Spring is a very flexible java framework. In spring, beans are the main building bricks of an application while the bean configuration file (mostly beans.xml) acts as cement that glues the beans together.

The file beans.xml also allows beans to be initialized with particular values. For example, you [...]]]></description>
			<content:encoded><![CDATA[<p>how to configure spring beans.xml file with more flexibility</p>
<p>Spring is a very flexible java framework. In spring, beans are the main building bricks of an application while the bean configuration file (mostly beans.xml) acts as cement that glues the beans together.</p>
<p></p>
<p>The file beans.xml also allows beans to be initialized with particular values. For example, you can set the JDBC driver, user name, password for a java bean that is in charge of database connection in the beans.xml file as the following example.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;beans</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.springframework.org/schema/beans&quot;</span></span>
<span style="color: #009900;">	<span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span></span>
<span style="color: #009900;">	<span style="color: #000066;">xmlns:p</span>=<span style="color: #ff0000;">&quot;http://www.springframework.org/schema/p&quot;</span></span>
<span style="color: #009900;">	<span style="color: #000066;">xsi:schemaLocation</span>=<span style="color: #ff0000;">&quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;dbManager&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;com.mytechtip.example.DbManager&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;jdbcDriver&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;com.mysql.jdbc.Driver&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;jdbcUrl&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;jdbc:mysql://localhost/app&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;jdbcUser&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;app&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;jdbcPassword&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;app&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/beans<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>So in the java class &#8220;com.example.app.DbManager&#8221;, you can make JDBC connections with the fields/properties value set as in the beans.xml file. The DbManager class may look as simple as the following:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.mytechtip.example</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.sql.Connection</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.sql.DriverManager</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> DbManager <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> jdbcDriver<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> jdbcUrl<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> jdbcUser<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> jdbcPassword<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getJdbcDriver<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> jdbcDriver<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setJdbcDriver<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> jdbcDriver<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">jdbcDriver</span> <span style="color: #339933;">=</span> jdbcDriver<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// more getters and setters ...</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Connection</span> getConnection<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span> <span style="color: #009900;">&#123;</span>
             <span style="color: #000000; font-weight: bold;">Class</span>.<span style="color: #006633;">forName</span> <span style="color: #009900;">&#40;</span>getJdbcDriver<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">newInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
             <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #003399;">DriverManager</span>.<span style="color: #006633;">getConnection</span><span style="color: #009900;">&#40;</span>
                   getJdbcUrl<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, getJdbcUser<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, getJdbcPassword<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>There is one note: </strong>These properties are set after the constructor of the bean is called. So if you try to make a JDBC connection in the constructor with the fields, you will mostly get exceptions.</p>
<p>Anyway, this is a very simple example of the bean configuration. We will show more examples to learn the flexibility of the bean configuration in Spring.</pre>
]]></content:encoded>
			<wfw:commentRss>http://robin.mytechtip.com/2010/05/18/how-to-configure-spring-beans-xml-file-basic-usage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remember to Clear Entity Manager if Entities No Longer Used</title>
		<link>http://robin.mytechtip.com/2010/03/24/remember-to-clear-entity-manager-if-entities-no-longer-used/</link>
		<comments>http://robin.mytechtip.com/2010/03/24/remember-to-clear-entity-manager-if-entities-no-longer-used/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 05:04:55 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[EntityManager]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[load]]></category>

		<guid isPermaLink="false">http://robin.mytechtip.com/?p=67</guid>
		<description><![CDATA[Recently  a lesson was learned about the proper use of Java JPA to persist a large number of records into database in a batch process.

Some times it is necessary to load the records line by line from a large file and insert into the database table. There can be several ways to do this:

Use the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently  a lesson was learned about the proper use of Java JPA to persist a large number of records into database in a batch process.</p>
<p></p>
<p>Some times it is necessary to load the records line by line from a large file and insert into the database table. There can be several ways to do this:</p>
<ul>
<li>Use the database provided tool to load the data into table. It can be a special sql command or a special stored procedure. This method is quite database specific and not portable.</li>
<li>Write the program to load the data into the database table (Using JDBC if the program is written in Java).  This method can be applied to different databases if the insert SQL statement conforms to a level of standard.</li>
<li>Use JPA to persist the object one by one. This allows for changing database more easily (under the condition that the JPA provider supports the database.</li>
</ul>
<p>We used the third options to load the records into the database as we want to support multiple databases without  low level tweaking. However, the first implementation seemed very slow compared with the second option. And it became slower and slower when process of persisting records  progressed.</p>
<p>After a few checking, we realized that we didn&#8217;t call the method &#8220;clear&#8221; of the class EntityManager each time we persisted the object.  The EntityManager kept managing these objects so the resource was not released immediately, making it become slower and slower.</p>
<p>Once we add the &#8220;clear&#8221; method call, the performance became acceptable. So lesson learned about the use of JPA.</p>
]]></content:encoded>
			<wfw:commentRss>http://robin.mytechtip.com/2010/03/24/remember-to-clear-entity-manager-if-entities-no-longer-used/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bad Request Error with apache mod_rewrite</title>
		<link>http://robin.mytechtip.com/2009/11/05/bad-request-error-with-apache-mod_rewrite/</link>
		<comments>http://robin.mytechtip.com/2009/11/05/bad-request-error-with-apache-mod_rewrite/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 04:09:30 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[clean url]]></category>
		<category><![CDATA[mod_rewrite]]></category>

		<guid isPermaLink="false">http://robin.mytechtip.com/?p=56</guid>
		<description><![CDATA[If you use apache module mod_alias together with module mod_rewrite, you probably encounter &#8220;Bad Request&#8221; error if the settings are not correctly configured.

For example, if you want to make the folder &#8220;/opt/mysite_v1.2&#8243; have the alias as &#8220;/mysite&#8221; so it can be accessed as http://www.mydomain.com/mysite. And you want to have clean url &#8220;/mysite/page1&#8243; mapped to &#8220;/mysite/index.php?p=page1&#8243;.
To [...]]]></description>
			<content:encoded><![CDATA[<p>If you use apache module mod_alias together with module mod_rewrite, you probably encounter &#8220;Bad Request&#8221; error if the settings are not correctly configured.</p>
<p><br />
For example, if you want to make the folder &#8220;/opt/mysite_v1.2&#8243; have the alias as &#8220;/mysite&#8221; so it can be accessed as http://www.mydomain.com/mysite. And you want to have clean url &#8220;/mysite/page1&#8243; mapped to &#8220;/mysite/index.php?p=page1&#8243;.</p>
<p>To define the alias, just add the following in the httpd.conf file:</p>
<blockquote><p><span style="font-family: Courier New">Alias /mysite/ &#8220;/opt/mysite_v1.2/&#8221; </span><br />
<span style="font-family: Courier New">&lt;Directory &#8220;/opt/mysite_v1.2/&#8221;&gt;</span><br />
<span style="font-family: Courier New"> Options Indexes FollowSymLinks MultiViews</span><br />
<span style="font-family: Courier New"> AllowOverride all</span><br />
<span style="font-family: Courier New"> Order allow,deny</span><br />
<span style="font-family: Courier New"> Allow from all</span><br />
<span style="font-family: Courier New">&lt;/Directory&gt;</span></p></blockquote>
<p>To allow clean URL. you need to have the following in the &#8220;.htaccess&#8221; file in the folder &#8220;/opt/mysite_v1.2&#8243;</p>
<blockquote><p><span style="font-family: Courier New">RewriteEngine On</span><br />
<span style="font-family: Courier New"># Rewrite base</span><br />
<strong>RewriteBase   /mysite</strong></p>
<p><span style="font-family: Courier New">#  now the rewriting rules</span><br />
<span style="font-family: Courier New">RewriteRule   ^([0-9a-zA-Z_]+)$  index.php?p=$1 </span></p></blockquote>
<p>Please NOTE that &#8220;<strong>RewriteBase</strong>&#8221; Directive is very essential. Without it, you will get the well known &#8220;Bad Request&#8221; Error.</p>
<p>More information can be found in <a id="m-3l" title="Apache mod_rewrite document" href="http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritebase" onclick="javascript:pageTracker._trackPageview('/outbound/article/httpd.apache.org');">Apache mod_rewrite documentation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://robin.mytechtip.com/2009/11/05/bad-request-error-with-apache-mod_rewrite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use OpenJPA with MySQL: Some Tips</title>
		<link>http://robin.mytechtip.com/2009/10/14/use-openjpa-with-mysql-some-tips/</link>
		<comments>http://robin.mytechtip.com/2009/10/14/use-openjpa-with-mysql-some-tips/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 03:02:01 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[javadb]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[openjpa]]></category>

		<guid isPermaLink="false">http://robin.mytechtip.com/?p=51</guid>
		<description><![CDATA[
OpenJPA is an implementation of the JPA (Java Persistence API) standards. Initially, I used OpenJPA with Derby which is also known as JavaDB. It works well. However, when i tried to use MySQL as the backend database, I encountered a few issues. Here are a few small tips i would like to share when using [...]]]></description>
			<content:encoded><![CDATA[<p><br />
OpenJPA is an implementation of the JPA (Java Persistence API) standards. Initially, I used OpenJPA with Derby which is also known as JavaDB. It works well. However, when i tried to use MySQL as the backend database, I encountered a few issues. Here are a few small tips i would like to share when using OpenJPA with MySQL:</p>
<p><strong>Change the default storage engine</strong></p>
<p>By default, OpenJPA uses innodb as the storage engine. While my application does not need to support transactions and other fancy db features, i&#8217;d like to use more plain and &#8220;traditional&#8221; myisam storage engine. To do so, I just need to set the property &#8220;openjpa.jdbc.DBDictionary&#8221; with the value &#8220;TableType=myisam&#8221;. This property object is the one passed to the method &#8220;Persistence.createEntityManagerFactory(String, Properties)&#8221;.</p>
<p><strong>Allow to store bigger objects (blobs)</strong><br />
By default, OpenJPA maps the java object to mysql data type &#8220;blob&#8221;. However, as you may be aware of, blob type in mysql only can store up to 65536(2<sup>16</sup>) bytes of data (check http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html), which is quite smaller than the blob in JavaDB or Derby (2G).</p>
<p>Mysql does provide other data types which supports larger storage. mediumblob supports up to 16M while longblob up to 4G. So if I want to store objects other than 64K, I need to change the mapping in OpenJPA. To change the mapping, just set the same property &#8220;openjpa.jdbc.DBDictionary&#8221;, but with value &#8220;blobTypeName=mediumblob&#8221;.</p>
<p>If I want both myisam as storage engine and mediumblob as mapped blob type, the property should be set as: &#8220;TableType=myisam,blobTypeName=mediumblob&#8221;.</p>
<p><strong>Avoid the error &#8220;Packet too large&#8221;</strong><br />
Now i can save objects up to 16M in size to the database. I run my program, only to find another exception popped up. It says something like &#8220;Packet too large&#8221;.</p>
<p>This requires the change of mysql server setting as indicated in <a id="h6su" title="mysql documentation" href="http://dev.mysql.com/doc/refman/5.0/en/packet-too-large.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/dev.mysql.com');">mysql documentation</a>. The setting &#8220;<a href="http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_max_allowed_packet" onclick="javascript:pageTracker._trackPageview('/outbound/article/dev.mysql.com');"><span style="font-family: Courier New">max_allowed_packet</span></a>&#8220;, default to 1M bytes, is too small in my case.</p>
]]></content:encoded>
			<wfw:commentRss>http://robin.mytechtip.com/2009/10/14/use-openjpa-with-mysql-some-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Methods/Software to convert RMVB to AVI</title>
		<link>http://robin.mytechtip.com/2009/09/10/methods-software-to-convert-rmvb-to-avi/</link>
		<comments>http://robin.mytechtip.com/2009/09/10/methods-software-to-convert-rmvb-to-avi/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 07:25:16 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[multimedia]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[avi]]></category>
		<category><![CDATA[divx]]></category>
		<category><![CDATA[rmvb]]></category>
		<category><![CDATA[xvid]]></category>

		<guid isPermaLink="false">http://robin.mytechtip.com/?p=46</guid>
		<description><![CDATA[Most current DVD players support playback of Divx or Xvid (usually files with .avi extention) encoded files, but few supports RMVB files which are in real media format.
If you have some RMVB files and want to play them on the DVD player, Then you need to convert the RMVB format to AVI.
Currently, I found out [...]]]></description>
			<content:encoded><![CDATA[<p>Most current DVD players support playback of Divx or Xvid (usually files with .avi extention) encoded files, but few supports RMVB files which are in real media format.</p>
<p>If you have some RMVB files and want to play them on the DVD player, Then you need to convert the RMVB format to AVI.</p>
<p>Currently, I found out two methods to do this.</p>
<p>The first method is from this article: &#8220;<a id="qf7s" title="How to Convert RMVB" href="http://www.jakeludington.com/dv_hacks/20051210_how_to_convert_rmvb.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.jakeludington.com');">How to Convert RMVB</a>&#8220;. This method requires you install/download several pieces of software to do this. It&#8217;s a bit troublesome, but the article provides very detailed step-by-step instructions and it works.</p>
<p>The other method is to use the open source software <a id="xbhd" title="alltoavi" href="http://alltoavi.sourceforge.net/" onclick="javascript:pageTracker._trackPageview('/outbound/article/alltoavi.sourceforge.net');">alltoavi</a>. It&#8217;s quite straight forward to use this software to convert RMVB. And it seems that this method takes less time to do the conversion compared with the first method.</p>
<p>The above two methods both use free software to accomplish the task. There are of course other software that can do this task and they may allow you to have better control for the conversion. Well, you have to pay for it.</p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://robin.mytechtip.com/2009/09/10/methods-software-to-convert-rmvb-to-avi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use Ant to Generate ChangeLogs From CVS ang Group by Date</title>
		<link>http://robin.mytechtip.com/2009/09/02/use-ant-to-generate-changelogs-from-cvs-ang-group-by-date/</link>
		<comments>http://robin.mytechtip.com/2009/09/02/use-ant-to-generate-changelogs-from-cvs-ang-group-by-date/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 05:58:44 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[changelog]]></category>
		<category><![CDATA[cvs]]></category>

		<guid isPermaLink="false">http://robin.mytechtip.com/?p=43</guid>
		<description><![CDATA[
Since version 1.6.1, Ant, the java build tool, has a core task called &#8220;cvschangelog&#8220;. It is quite useful to use this task to grab a list of recent changes committed to the CVS repository. The output of this task is in XML format. Something like the following:

&#60;changelog&#62;
 &#60;entry&#62;
 &#60;date&#62;2009-09-02&#60;/date&#62;
 &#60;time&#62;12:00&#60;/time&#62;
 &#60;author&#62;robin&#60;/author&#62;
 &#60;file&#62;
 &#60;name&#62;test/ant/task/ChangeLog.txt&#60;/name&#62;
 &#60;revision&#62;1.2&#60;/revision&#62;
 &#60;prevrevision&#62;1.1&#60;/prevrevision&#62;
 [...]]]></description>
			<content:encoded><![CDATA[<p></p>
<p>Since version 1.6.1, Ant, the java build tool, has a core task called &#8220;<a id="ylcq" title="cvschangelog" href="http://ant.apache.org/manual/CoreTasks/changelog.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/ant.apache.org');">cvschangelog</a>&#8220;. It is quite useful to use this task to grab a list of recent changes committed to the CVS repository. The output of this task is in XML format. Something like the following:</p>
<blockquote>
<div><span style="font-family: Courier New">&lt;changelog&gt;</span><br />
<span style="font-family: Courier New"> &lt;entry&gt;</span><br />
<span style="font-family: Courier New"> &lt;date&gt;2009-09-02&lt;/date&gt;</span><br />
<span style="font-family: Courier New"> &lt;time&gt;12:00&lt;/time&gt;</span><br />
<span style="font-family: Courier New"> &lt;author&gt;robin&lt;/author&gt;</span><br />
<span style="font-family: Courier New"> &lt;file&gt;</span><br />
<span style="font-family: Courier New"> &lt;name&gt;test/ant/task/ChangeLog.txt&lt;/name&gt;</span><br />
<span style="font-family: Courier New"> &lt;revision&gt;1.2&lt;/revision&gt;</span><br />
<span style="font-family: Courier New"> &lt;prevrevision&gt;1.1&lt;/prevrevision&gt;</span><br />
<span style="font-family: Courier New"> &lt;/file&gt;</span><br />
<span style="font-family: Courier New"> &lt;msg&gt;&lt;![CDATA[</span>A commit message<span style="font-family: Courier New">]]&gt;&lt;/msg&gt;</span><br />
<span style="font-family: Courier New"> &lt;/entry&gt;</span><br />
&lt;entry&gt;<br />
&#8230;<br />
&lt;/entry&gt;<br />
&#8230;<br />
<span style="font-family: Courier New">&lt;/changelog&gt;</span></div>
</blockquote>
<p>To transform the xml formatted changelog into a human friendly html, you can do an XSL transformation with a XSL file. There is a default one in the Ant distribution, so you can use the following task to get a change log in html format.</p>
<blockquote><p><span style="font-family: Courier New"> &lt;style in=&#8221;changelog.xml&#8221; </span><br />
<span style="font-family: Courier New"> out=&#8221;changelog.html&#8221; </span><br />
<span style="font-family: Courier New"> style=&#8221;${ant.home}/etc/changelog.xsl&#8221;&gt;</span><br />
<span style="font-family: Courier New"> &lt;param name=&#8221;title&#8221; expression=&#8221;Ant ChangeLog&#8221;/&gt;</span><br />
<span style="font-family: Courier New"> &lt;param name=&#8221;module&#8221; expression=&#8221;the_module&#8221;/&gt;</span><br />
<span style="font-family: Courier New"> &lt;param name=&#8221;cvsweb&#8221; expression=&#8221;the_url&#8221;/&gt;</span><br />
<span style="font-family: Courier New"> &lt;/style&gt;</span></p></blockquote>
<p>The default generated html lists each commit change one by one. In some cases, we want to group the commit changes by dates. To do so, we have to change the default xsl file.</p>
<p>It seems that the new <a id="dwod" title="XSLT version 2.0 has specified a group functionality" href="http://www.xml.com/pub/a/2003/11/05/tr.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.xml.com');">XSLT version 2.0 has specified a group functionality</a>. However, it turns out only a few XSLT tools support this new feature. Fortunately, There is a way that <a id="mxme" title="allows us to do the grouping using XSLT version 1.0" href="http://www.jenitennison.com/xslt/grouping/muenchian.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/www.jenitennison.com');">allows us to do the grouping using XSLT version 1.0</a>. By applying this method, we have the following looking xsl code for the HTML &lt;BODY&gt; part.</p>
<blockquote><p><span> &lt;body&gt;</span><br />
<span> &lt;h1&gt;</span><br />
<span> &lt;a name=&#8221;top&#8221;&gt;&lt;xsl:value-of select=&#8221;$title&#8221;/&gt;&lt;/a&gt;</span><br />
<span> &lt;/h1&gt;</span><br />
<span> &lt;p style=&#8221;text-align: right&#8221;&gt;Designed for use with &lt;a href=&#8221;http://ant.apache.org/&#8221;&gt;Apache Ant&lt;/a&gt;.&lt;/p&gt;</span><br />
<span> &lt;hr/&gt;</span><br />
<span> </span><br />
<span> &lt;xsl:key name=&#8221;log-by-date&#8221; match=&#8221;entry&#8221; use=&#8221;date&#8221; /&gt;</span><br />
<span> </span><br />
<span> &lt;xsl:template match=&#8221;changelog&#8221;&gt;</span><br />
<span> &lt;xsl:for-each select=&#8221;entry[count(. | key('log-by-date', date)[1]) = 1]&#8221;&gt;</span><br />
<span> &lt;xsl:sort select=&#8221;date&#8221; order=&#8221;descending&#8221; /&gt;</span><br />
<span> &lt;h2&gt;&lt;xsl:value-of select=&#8221;date&#8221;/&gt;&lt;xsl:text&gt;&lt;/xsl:text&gt;&lt;/h2&gt;</span><br />
<span> &lt;xsl:for-each select=&#8221;key(&#8217;log-by-date&#8217;, date)&#8221;&gt;</span><br />
<span> </span><br />
<span> &lt;xsl:sort select=&#8221;time&#8221; order=&#8221;descending&#8221; /&gt;</span><br />
<span> </span><br />
<span> &lt;table border=&#8221;0&#8243; width=&#8221;100%&#8221; cellspacing=&#8221;1&#8243;&gt;</span><br />
<span> &lt;tr&gt;</span><br />
<span> &lt;td class=&#8221;dateAndAuthor&#8221;&gt;</span><br />
<span> &lt;!&#8211; &lt;xsl:value-of select=&#8221;date&#8221;/&gt;&lt;xsl:text&gt; &lt;/xsl:text&gt; &#8211;&gt;</span><br />
<span> &lt;xsl:value-of select=&#8221;time&#8221;/&gt;&lt;xsl:text&gt; &lt;/xsl:text&gt;&lt;xsl:value-of select=&#8221;author&#8221;/&gt;</span><br />
<span> &lt;/td&gt;</span><br />
<span> &lt;/tr&gt;</span><br />
<span> &lt;tr&gt;</span><br />
<span> &lt;td&gt;</span><br />
<span> &lt;pre&gt;&lt;xsl:apply-templates select=&#8221;msg&#8221;/&gt;&lt;/pre&gt;</span><br />
<span> &lt;ul&gt;</span><br />
<span> &lt;xsl:apply-templates select=&#8221;file&#8221;/&gt;</span><br />
<span> &lt;/ul&gt;</span><br />
<span> &lt;/td&gt;</span><br />
<span> &lt;/tr&gt;</span><br />
<span> &lt;/table&gt;</span><br />
<span> &lt;/xsl:for-each&gt;</span><br />
<span> &lt;/xsl:for-each&gt;</span><br />
<span> &lt;/xsl:template&gt;</span><br />
<span> </span><br />
<span> &lt;/body&gt;</span></p></blockquote>
<p>Use the above code to replace the &lt;body&gt; part in the original changelog.xsl file, then it  will allow you to group the change logs by date.</p>
]]></content:encoded>
			<wfw:commentRss>http://robin.mytechtip.com/2009/09/02/use-ant-to-generate-changelogs-from-cvs-ang-group-by-date/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSP Expression Language in GWT&#8217;s embedded Jetty</title>
		<link>http://robin.mytechtip.com/2009/07/23/jsp-expression-language-in-gwts-embedded-jetty/</link>
		<comments>http://robin.mytechtip.com/2009/07/23/jsp-expression-language-in-gwts-embedded-jetty/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 07:13:04 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[el]]></category>
		<category><![CDATA[expression language]]></category>
		<category><![CDATA[gwt]]></category>
		<category><![CDATA[jetty]]></category>
		<category><![CDATA[jsp]]></category>

		<guid isPermaLink="false">http://robin.mytechtip.com/?p=39</guid>
		<description><![CDATA[JSP expression language (EL) is quite handy. but it only works when you indicate your web application is using version 2.4 or higher. That means you have the following in your &#60;Your-Web-App&#62;/WEB-INF/web.xml:
&#60;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&#62;
&#60;web-app id=&#8221;WebApp_ID&#8221; version=&#8221;2.4&#8243; xmlns=&#8221;http://java.sun.com/xml/ns/j2ee&#8221; xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221; xsi:schemaLocation=&#8221;http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd&#8221;&#62;
&#8230;

Google Web Toolkit (GWT) is a handy Ajax Web application development tool. Since version 1.6.4, GWT [...]]]></description>
			<content:encoded><![CDATA[<p>JSP expression language (EL) is quite handy. but it only works when you indicate your web application is using version 2.4 or higher. That means you have the following in your &lt;Your-Web-App&gt;/WEB-INF/web.xml:</p>
<div style="margin-left: 40px">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;web-app id=&#8221;WebApp_ID&#8221; version=&#8221;2.4&#8243; xmlns=&#8221;http://java.sun.com/xml/ns/j2ee&#8221; xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221; xsi:schemaLocation=&#8221;http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd&#8221;&gt;<br />
&#8230;</div>
<p></p>
<p>Google Web Toolkit (GWT) is a handy Ajax Web application development tool. Since version 1.6.4, GWT uses Jetty instead of Tomcat as the embedded Web application container.</p>
<p>However, when I installed GWT plugin (version 1.6.4) for Eclipse, the default generated web application used the version 2.3. So when i used expression language in the jsp pages, it didn&#8217;t evaluate. Something like &#8220;${title}&#8221; as the output in the hosted mode running on jetty. It should also be the same result even i deployed to a tomcat container, as the web app version is still 2.3. This is understandable, as Expression Language is part of JSP version 2.0 standard, which is bound with Servlet (Web App) version 2.4. So if you want to make the expression language work, make sure your web app is using 2.4 or higher.</p>
<p>However, while using version 2.4 works fine, i&#8217;ve got the same problem when i use version 2.5, which is hard to understand why. This problem seems only in Jetty, not in Tomcat. I don&#8217;t know if anyone else have encountered the same problem as I did, but the following link seems to explain the reason behind: <a id="y4rx" title="http://docs.codehaus.org/display/JETTY/JSP+expression+do+not+evaluate" href="http://docs.codehaus.org/display/JETTY/JSP+expression+do+not+evaluate" onclick="javascript:pageTracker._trackPageview('/outbound/article/docs.codehaus.org');">http://docs.codehaus.org/display/JETTY/JSP+expression+do+not+evaluate</a></p>
<p>Apart from this problem (which can be worked around), the use of GWT plugin seems more convenient than the traditional web app development in eclipse. <img src='http://robin.mytechtip.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://robin.mytechtip.com/2009/07/23/jsp-expression-language-in-gwts-embedded-jetty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>List of Personal Finance Software / Websites for Money Management</title>
		<link>http://robin.mytechtip.com/2009/04/03/list-of-personal-finance-software-websites-for-money-management/</link>
		<comments>http://robin.mytechtip.com/2009/04/03/list-of-personal-finance-software-websites-for-money-management/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 05:31:42 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[book keeping]]></category>
		<category><![CDATA[money]]></category>
		<category><![CDATA[personal finance]]></category>

		<guid isPermaLink="false">http://robin.mytechtip.com/?p=33</guid>
		<description><![CDATA[It&#8217;s a good habit to keep an eye on your money and know how much you have spent in the past and how much you can spend in the future.
Although bank statements, credit card statement or online bank accounts provide all such information, these pieces of information scatter here and there and you lose track [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s a good habit to keep an eye on your money and know how much you have spent in the past and how much you can spend in the future.</p>
<p>Although bank statements, credit card statement or online bank accounts provide all such information, these pieces of information scatter here and there and you lose track quickly and don&#8217;t have a whole picture to see where you are going. It gets worse when there are several bank / credit card accounts. So having a software or web sites to consolidate all such information seems a good idea.</p>
<p>Other than using a spread sheet to keep all the information together, there are quite a few sophisticated software or web site to do this job, some cost your money, some just free. The following lists some choices.</p>
<p></p>
<p><span style="font-size: small"><strong>Desktop Financial Software &#8211; not free</strong></span><br />
<em>Quicken</em>, <em>Microsoft Money</em>. They are traditional desktop applications. That means you have to install them one your computer before you want to use them to manage your money. I haven&#8217;t used them but it should be easy to get started for a normal person.<br />
It seems that quicken has a free online version for money management. However, don&#8217;t know how &#8220;free&#8221; it is and how many features it has.</p>
<p><span style="font-size: small"><strong>Desktop Financial Software &#8211; free</strong></span><br />
<em>GnuCash</em>, <em>jGnash</em>. Both of them are free and probably open source software. GnuCash is actually beyond the personal level and can be used for catering small business (seems equivalent to Microsoft office accounting software). To use them, you may probably need to have a little bit of financial knowledge. For example, what is double entry?<br />
<span style="font-size: small"><strong><br />
Websites / online services / personal finance 2.0?</strong></span><br />
If you are confident enough to allow third party websites to handle your financial information, then you may embrace such so-called personal finance 2.0 websites. Among them are <em>greensherpa.com</em>, j<em>ustthrive.com</em>, <em>rudder.com</em>, <em>mint.com</em> and etc.</p>
<p>Most of them can retrieve your transactions from your nominated financial institutions or banks and aggregate them automatically for you and provide basic financial advice based on the data. Some of them charge you subscribe fee to use the online service, while some of them have free versions. However, it seems most of them are US version, i.e., they can only retrieve data from US banks.</p>
<p>Finally, a few words on the financial data formats and standards.<br />
<span style="text-decoration: underline">Quicken Interchange Format</span> (<strong>QIF</strong>) is an open specification for reading and writing financial data to media.<br />
<span style="text-decoration: underline">Open Financial Exchange</span> (<strong>OFX</strong>) comes from Microsoft and Intuit (the maker of Quicken) and it is a data-stream format for exchanging financial information.</p>
<p>The above two formats are quite popular and most of the financial software support the importation and exportation of the files in such formats. And most of the online banking system support them as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://robin.mytechtip.com/2009/04/03/list-of-personal-finance-software-websites-for-money-management/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
