<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;AkEBR3o8fSp7ImA9WhVUEE8.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487</id><updated>2012-05-15T06:50:56.475+10:00</updated><category term="linux" /><category term="productive" /><category term="xml" /><category term="solr" /><category term="hibernate" /><category term="PrimeFaces" /><category term="jQuery" /><category term="sitemesh" /><category term="roo" /><category term="SpringMVC" /><category term="jsf" /><category term="SQL" /><category term="JSP" /><category term="javascript" /><category term="java" /><category term="jQuery Mobile" /><category term="gwt" /><category term="lucene" /><category term="jQuery UI" /><category term="Windows" /><category term="cloud" /><category term="pdf" /><category term="SpringSecurity" /><category term="life" /><category term="MYOB" /><category term="rcp" /><category term="SpringFramework" /><category term="Tomcat" /><category term="android" /><category term="iphone" /><category term="web2.0" /><category term="Database" /><category term="Maven" /><category term="tips" /><category term="jpa2.0" /><category term="JCR" /><category term="eclipse" /><category term="solrJ" /><category term="ubuntu" /><category term="subversion" /><title>Ke CAI</title><subtitle type="html">just don't want to be nobody.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.ke-cai.net/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://www.ke-cai.net/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>102</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/KeCai" /><feedburner:info uri="kecai" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CkEDSXo8fyp7ImA9WhRWF08.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-5149840607793509864</id><published>2012-01-05T10:44:00.000+11:00</published><updated>2012-01-05T10:44:38.477+11:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-05T10:44:38.477+11:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="xml" /><title>Pretty Format XML in Java</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/5149840607793509864/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=5149840607793509864&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/5149840607793509864?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/5149840607793509864?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/Km09l5DTyEQ/pretty-format-xml-in-java.html" title="Pretty Format XML in Java" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>1</thr:total><content type="html">I've been playing with Amazon Product Advertising API for a while. One of the pain is reading the xml response, it's all in one line and I have to scroll to find useful information. Then I began to create a xml file and copy the response string into this file, using Eclipse's auto format this xml file. It's still painful when there are a lot of request need to try. So I brought this pretty xml 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ltsQuZCYnJtgnMHkRYng_uAG8vo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ltsQuZCYnJtgnMHkRYng_uAG8vo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ltsQuZCYnJtgnMHkRYng_uAG8vo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ltsQuZCYnJtgnMHkRYng_uAG8vo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/Km09l5DTyEQ" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2012/01/pretty-format-xml-in-java.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck8HQHY4fSp7ImA9WhRWF08.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-8517698079459132083</id><published>2011-12-18T11:02:00.002+11:00</published><updated>2012-01-05T10:47:11.835+11:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-05T10:47:11.835+11:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><title>Extracting RAR Archives in Java using JUnrar</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/8517698079459132083/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=8517698079459132083&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/8517698079459132083?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/8517698079459132083?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/bgtsZ8-_COc/extracting-rar-archives-in-java-using.html" title="Extracting RAR Archives in Java using JUnrar" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>0</thr:total><content type="html">I just found a wonderful open source RAR Archives library in Java, jUnrar. It seems this project moved from sourceforge.net and document is still on the way. There is a JUnit test project comes with the source shows how to use it. I modified it a little bit to make is simpler. 

The following code will extract mytest.rar into the user home directory. 

1. construct rar Archive from File
File 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/OjR7NBhi8wEAc_Hk2ma1T-C3unE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OjR7NBhi8wEAc_Hk2ma1T-C3unE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/OjR7NBhi8wEAc_Hk2ma1T-C3unE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OjR7NBhi8wEAc_Hk2ma1T-C3unE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/bgtsZ8-_COc" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2011/12/extracting-rar-archives-in-java-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4MRXw-fSp7ImA9WhRXEU8.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-78371814988327873</id><published>2011-10-17T22:22:00.003+11:00</published><updated>2011-12-17T22:56:24.255+11:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-17T22:56:24.255+11:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="lucene" /><title>Simple Pagination with Lucene Search Results</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/78371814988327873/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=78371814988327873&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/78371814988327873?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/78371814988327873?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/pT09smrAi00/simple-pagination-with-lucene-search.html" title="Simple Pagination with Lucene Search Results" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>1</thr:total><content type="html">It is still not very straghtforward to do search result pagination in Lucene. The simplest way is still do the same search again and populate the next group of documents.

Firstly, create a Page object to calculate start and end index for certain page number. for example, page 3's record start from 20 to 29 if we show 10 records for each page.


public class Page implements Serializable {
 
 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/SFPPoJz_kInWyXTDUuGDWChklPM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SFPPoJz_kInWyXTDUuGDWChklPM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/SFPPoJz_kInWyXTDUuGDWChklPM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SFPPoJz_kInWyXTDUuGDWChklPM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/pT09smrAi00" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2011/10/simple-pagination-with-lucene-search.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck8HSXk9fCp7ImA9WhRQGEk.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-6668280969650540978</id><published>2011-08-14T12:09:00.012+10:00</published><updated>2011-12-14T16:33:58.764+11:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-14T16:33:58.764+11:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="eclipse" /><title>Escape Pasted Text into String in Eclipse</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/6668280969650540978/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=6668280969650540978&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/6668280969650540978?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/6668280969650540978?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/7ZHcHB_K6bo/escape-pasted-text-into-string-in.html" title="Escape Pasted Text into String in Eclipse" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>1</thr:total><content type="html">I often copy &amp;amp; paste text into Java Class file when I use Eclipse, especially when writing unit testing. It bothered when the text is long, when I need to add " and /n by hand to make it legally String.

Finally, I found Eclipse is smart enough to do this escape automatically. But you need to enable it via:

Windows --&amp;gt; Preferences --&amp;gt; Java --&amp;gt; Editor --&amp;gt; Typing --&amp;gt; In string literals --&amp;gt; Escape 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0j5AlhWlV1ISaKEdm3OF_3xXqCs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0j5AlhWlV1ISaKEdm3OF_3xXqCs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0j5AlhWlV1ISaKEdm3OF_3xXqCs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0j5AlhWlV1ISaKEdm3OF_3xXqCs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/7ZHcHB_K6bo" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2011/08/escape-pasted-text-into-string-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMGR30-eip7ImA9WhdaEkk.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-4251272039862078846</id><published>2011-07-12T10:39:00.000+10:00</published><updated>2011-10-22T10:40:26.352+11:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-22T10:40:26.352+11:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="PrimeFaces" /><category scheme="http://www.blogger.com/atom/ns#" term="jsf" /><title>Pagination with LazyDataModel loading from Spring Service in Primefaces</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/4251272039862078846/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=4251272039862078846&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/4251272039862078846?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/4251272039862078846?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/C8vxZ2M-Zp8/pagination-with-lazydatamodel-loading.html" title="Pagination with LazyDataModel loading from Spring Service in Primefaces" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>0</thr:total><content type="html">DataTable component in Primefaces is very powerful and flexible. It provides LazyDataModel mechanism to load pagination data. Here is my note about how to invoke injected Spring service to load data from database.

1. Integrate Spring and JSF
&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;


 
  org.springframework.web.jsf.el.SpringBeanFacesELResolver

&amp;lt;!-- other settings--&amp;gt;
 


2. Inject Spring Service 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NNs0cXir85w8IO-K-cSTCSTXmNU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NNs0cXir85w8IO-K-cSTCSTXmNU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/NNs0cXir85w8IO-K-cSTCSTXmNU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NNs0cXir85w8IO-K-cSTCSTXmNU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/C8vxZ2M-Zp8" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2011/10/pagination-with-lazydatamodel-loading.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQMQ345eSp7ImA9WhdaEEo.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-7220128116662068013</id><published>2011-06-20T11:37:00.002+10:00</published><updated>2011-10-20T11:59:42.021+11:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-20T11:59:42.021+11:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="PrimeFaces" /><category scheme="http://www.blogger.com/atom/ns#" term="jsf" /><title>Removing border from layout unit in PrimeFaces 3.0</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/7220128116662068013/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=7220128116662068013&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/7220128116662068013?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/7220128116662068013?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/IjmbSWjsrJM/removing-border-from-layout-unit-in.html" title="Removing border from layout unit in PrimeFaces 3.0" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>0</thr:total><content type="html">jQuery UI is my favorite JavaScript widget library. I tried create JSP tag library to reuse it in my web applications. Then I switched to JSF and found the wonderful PrimeFaces implemented via jQuery UI. What a  smart combination! 

But, as always, we need a little hack to make it works as we want. My first hacking is to hide the border in layout unit. After examined with firebug, I found the 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/biSdEskoF2l50OXx_fO0ZgCqEUg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/biSdEskoF2l50OXx_fO0ZgCqEUg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/biSdEskoF2l50OXx_fO0ZgCqEUg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/biSdEskoF2l50OXx_fO0ZgCqEUg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/IjmbSWjsrJM" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2011/06/removing-border-from-layout-unit-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4ARH8zeip7ImA9WhdaEEo.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-3611405035094982120</id><published>2011-06-10T12:08:00.001+10:00</published><updated>2011-10-20T12:25:45.182+11:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-20T12:25:45.182+11:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="eclipse" /><category scheme="http://www.blogger.com/atom/ns#" term="android" /><title>Eclipse Tips for Android Development</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/3611405035094982120/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=3611405035094982120&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/3611405035094982120?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/3611405035094982120?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/pl5TRGg-h68/eclipse-tips-for-android-development.html" title="Eclipse Tips for Android Development" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>0</thr:total><content type="html">Honestly, developing android applications in Eclipse is not as pleasure as building iOS applications in Xcode. But the complication has to be, since android is addressed ao many vendors with variety of screen sizes and other differences. I will organize some productive tips to use Eclipse in android development.

iOS application don't have to worry about different screen size, there is no layout 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MBWZC8Ovs9oTcZp5iUC2yMKsNHk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MBWZC8Ovs9oTcZp5iUC2yMKsNHk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MBWZC8Ovs9oTcZp5iUC2yMKsNHk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MBWZC8Ovs9oTcZp5iUC2yMKsNHk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/pl5TRGg-h68" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2011/06/eclipse-tips-for-android-development.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcHQXY6fip7ImA9WhZVGE0.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-9205084418760478121</id><published>2011-05-31T11:39:00.002+10:00</published><updated>2011-05-31T11:40:30.816+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-31T11:40:30.816+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="iphone" /><title>Build iOS Universal App without nib/xib</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/9205084418760478121/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=9205084418760478121&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/9205084418760478121?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/9205084418760478121?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/iU0_vZAoKJU/create-ios-universal-app-without-nibxib.html" title="Build iOS Universal App without nib/xib" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>1</thr:total><content type="html">I just upgraded my universal app, iDiff, with a few features. Since I draw and layout everything by hand, it is a waste to keep the appDegelate_iPhone, appDelegate_iPad, and their xibs file, MainWindow_iPhone.xib, MainWindow_iPad.xib. Here is my note about this modification.

1. Delete all files in iPhone and iPad folder.
Those folders contain .h and .m file for iDiffAppDelegate_iPhone, 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QcWx4i1UtnM3E88KS099E9h5n0g/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QcWx4i1UtnM3E88KS099E9h5n0g/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QcWx4i1UtnM3E88KS099E9h5n0g/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QcWx4i1UtnM3E88KS099E9h5n0g/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/iU0_vZAoKJU" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2011/05/create-ios-universal-app-without-nibxib.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0cHRXo_eip7ImA9WhZWE0w.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-6073108602123378006</id><published>2011-05-12T20:08:00.000+10:00</published><updated>2011-05-14T06:37:14.442+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-14T06:37:14.442+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="iphone" /><title>Tap Background to Dismiss Keyboard for UITextViews</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/6073108602123378006/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=6073108602123378006&amp;isPopup=true" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/6073108602123378006?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/6073108602123378006?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/a7yWpKwwcx4/tap-background-to-dismiss-keyboard-for.html" title="Tap Background to Dismiss Keyboard for UITextViews" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>2</thr:total><content type="html">I found Apple didn't treat UITextView very well, they didn't provide "done" button in its keyboard. There are a lot of tutorials taught to listen "return" key stroke to dismiss the keyboard. However, I think this is very unwise since UITextView is supposed to carry multiply lines. Therefore, I will show you a better way to dismiss keyboard.

Basically, what I'm going to do is add an invisible 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/rRt66eOKfoAm4H0SwFEoSPDgyOE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rRt66eOKfoAm4H0SwFEoSPDgyOE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/rRt66eOKfoAm4H0SwFEoSPDgyOE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rRt66eOKfoAm4H0SwFEoSPDgyOE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/a7yWpKwwcx4" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2011/05/tap-background-to-dismiss-keyboard-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A08FRHgyfip7ImA9WhZWEEo.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-8370374746411390034</id><published>2011-05-11T12:10:00.000+10:00</published><updated>2011-05-11T12:10:15.696+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-11T12:10:15.696+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="web2.0" /><title>Create favicon in Photoshop</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/8370374746411390034/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=8370374746411390034&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/8370374746411390034?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/8370374746411390034?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/pD0XWdXjBLA/create-favicon-in-photoshop.html" title="Create favicon in Photoshop" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>0</thr:total><content type="html">Although there are plenty of tutorials about favicon, I still provide a quick note for myself.

Add ico format support for Photoshop 
download ico format file support, choose the right platform version, for me, is Windows (64 bit) – CS4 

extract and copy ICOFormat64.8bi to C:\Program Files\Adobe\Adobe Photoshop CS4 (64 Bit)\Plug-ins\File Formats



Create favicon in Photoshop
I will recommend 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/i-cPEDCpSOL-LiPhxP5Rbmlt5ts/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/i-cPEDCpSOL-LiPhxP5Rbmlt5ts/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/i-cPEDCpSOL-LiPhxP5Rbmlt5ts/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/i-cPEDCpSOL-LiPhxP5Rbmlt5ts/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/pD0XWdXjBLA" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2011/05/create-favicon-in-photoshop.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkQHRH4-fSp7ImA9WhZXGU0.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-5320019584398366661</id><published>2011-05-09T12:32:00.000+10:00</published><updated>2011-05-09T12:32:15.055+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-09T12:32:15.055+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="iphone" /><title>iOpenSource</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/5320019584398366661/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=5320019584398366661&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/5320019584398366661?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/5320019584398366661?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/RdPo8exQmKo/iopensource.html" title="iOpenSource" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>0</thr:total><content type="html">I just submitted my first iPhone app. 
It's still waiting for review.
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Ej6L2ku2ywxCwK44nlhx-4t-B0Y/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ej6L2ku2ywxCwK44nlhx-4t-B0Y/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Ej6L2ku2ywxCwK44nlhx-4t-B0Y/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ej6L2ku2ywxCwK44nlhx-4t-B0Y/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/RdPo8exQmKo" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2011/05/iopensource.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkIERHc8cCp7ImA9WhZXGEw.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-4491184127534591419</id><published>2011-04-14T20:46:00.002+10:00</published><updated>2011-05-08T11:35:05.978+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-08T11:35:05.978+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="iphone" /><title>Pagination with UITableView in IOS Development[updated]</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/4491184127534591419/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=4491184127534591419&amp;isPopup=true" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/4491184127534591419?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/4491184127534591419?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/5eWAyH1XrSE/pagination-with-uitableview-in-ios.html" title="Pagination with UITableView in IOS Development[updated]" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>3</thr:total><content type="html">Drag to refresh and click to load more is very popular in iOS apps, however, I'm still favor the "Pre", "Next" old style. This post will show you how to implement it in UITableView.



 

As you can see from the screenshot, we're going to add the pagination bar in the UITableView's footer. In the pagination bar, we're going to add a text label to show current page number, a Previous button and a 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8GhIaRbZq5CErt7B3SiHdezgtEs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8GhIaRbZq5CErt7B3SiHdezgtEs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8GhIaRbZq5CErt7B3SiHdezgtEs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8GhIaRbZq5CErt7B3SiHdezgtEs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/5eWAyH1XrSE" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2011/04/pagination-with-uitableview-in-ios.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUYCQHY_fyp7ImA9WhZREUo.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-8926305969899333458</id><published>2011-04-07T21:52:00.000+10:00</published><updated>2011-04-07T21:52:41.847+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-07T21:52:41.847+10:00</app:edited><title>Connect to 3G network from iPad 2 with TPG Mobile</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/8926305969899333458/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=8926305969899333458&amp;isPopup=true" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/8926305969899333458?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/8926305969899333458?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/2S3gL1xM9Yg/connect-to-3g-network-from-ipad-2-with.html" title="Connect to 3G network from iPad 2 with TPG Mobile" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>2</thr:total><content type="html">Lining up for 5 hours finally I got my 32G Black wifi and 3G model iPad2 on the launch day in Sydney. At first I'm not sure if I should buy another SIM card since my iPhone 4's 1G data is too much for me. But I found TPG's Pay-As-You-Go Plan, $1 per month for 150M data. It's so cheap and I cannot resist to buy one.

However, it's not easy to setup because the poor documentation of TPG. I got the 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0CK13BzCb1kUydbYxp4Zwr4UPS8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0CK13BzCb1kUydbYxp4Zwr4UPS8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0CK13BzCb1kUydbYxp4Zwr4UPS8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0CK13BzCb1kUydbYxp4Zwr4UPS8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/2S3gL1xM9Yg" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2011/04/connect-to-3g-network-from-ipad-2-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMBRXs7fip7ImA9WhZSFks.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-6507491839548072293</id><published>2011-04-01T23:54:00.000+11:00</published><updated>2011-04-01T23:54:14.506+11:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-01T23:54:14.506+11:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="iphone" /><title>Add libXML2 into iPhone Project in Xcode 4</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/6507491839548072293/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=6507491839548072293&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/6507491839548072293?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/6507491839548072293?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/RSDVI8_sQHM/add-libxml2-into-iphone-project-in.html" title="Add libXML2 into iPhone Project in Xcode 4" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>1</thr:total><content type="html">XCode 4 changed a lot, I'm kind of blind in its new UI. I cannot find where to add framework, even cannot figure out how to change newly added group's name. After some google, finally find the way.

Step 1: add libxml2.dylib 

1. Click your project (XmlTest) in the left navigator bar.
2. Select the target (XmlTest), then select "Build Phases" tab.
3. Expand "Link Binaries With Libraries"
4. Click
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/bLzkv1DStTZJx_UQEEUWleMyRBI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bLzkv1DStTZJx_UQEEUWleMyRBI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/bLzkv1DStTZJx_UQEEUWleMyRBI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bLzkv1DStTZJx_UQEEUWleMyRBI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/RSDVI8_sQHM" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2011/04/add-libxml2-into-iphone-project-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0IFRX86eip7ImA9WhZTFE8.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-8027758958835770028</id><published>2011-03-18T17:25:00.000+11:00</published><updated>2011-03-18T17:25:14.112+11:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-18T17:25:14.112+11:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jQuery UI" /><category scheme="http://www.blogger.com/atom/ns#" term="jQuery" /><title>Create a Calendar View with JQuery UI Datepicker</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/8027758958835770028/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=8027758958835770028&amp;isPopup=true" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/8027758958835770028?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/8027758958835770028?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/6F-EwTEBycw/create-calendar-view-with-jquery-ui.html" title="Create a Calendar View with JQuery UI Datepicker" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>5</thr:total><content type="html">jQuery UI's Datepicker widget is widely used in form to select a date. Today I'm going to show you how to use Datepicker to create a calendar month view.


Demo can be found here
1. Let's begin with those two sample appointments
//sample appointments
var appointment2= new Object;
appointment2.date=new Date(2010, 2, 25);//25th March (month start from 0)
appointment2.note="iPad2 goes Australia";


&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/tVVRtMa-24uQgDdjNseZdxteuZg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tVVRtMa-24uQgDdjNseZdxteuZg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/tVVRtMa-24uQgDdjNseZdxteuZg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tVVRtMa-24uQgDdjNseZdxteuZg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/6F-EwTEBycw" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2011/03/create-calendar-view-with-jquery-ui.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkAAQX0-eSp7ImA9WhZRFUw.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-2670675627157696756</id><published>2011-03-15T13:40:00.001+11:00</published><updated>2011-04-11T20:45:40.351+10:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-11T20:45:40.351+10:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="gwt" /><category scheme="http://www.blogger.com/atom/ns#" term="Maven" /><title>Kick Start GWT Poject with gwt-maven-plugin</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/2670675627157696756/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=2670675627157696756&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/2670675627157696756?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/2670675627157696756?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/EbNt624Oj_I/kick-start-gwt-poject-with-gwt-maven.html" title="Kick Start GWT Poject with gwt-maven-plugin" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>1</thr:total><content type="html">It's easy to start a GWT project in Eclipse with GWT Plugin for Eclipse. However, it's getting harder to manage the project while the dependencies growing, such as introducing Spring, Hibernate, JPA into your project. Therefore, I will show you how to kick start GWT Maven sample project.

1. create GWT project using mojo's gwt-maven-plugin archetype

mvn archetype:generate -DarchetypeRepository=
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/VzaxKOxqfwETCK2vBn8by7ZjgeA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VzaxKOxqfwETCK2vBn8by7ZjgeA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/VzaxKOxqfwETCK2vBn8by7ZjgeA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VzaxKOxqfwETCK2vBn8by7ZjgeA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/EbNt624Oj_I" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2011/03/kick-start-gwt-poject-with-gwt-maven.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkACQXgzfCp7ImA9Wx9bFko.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-2185370092236618625</id><published>2011-02-26T11:06:00.013+11:00</published><updated>2011-02-26T11:06:00.684+11:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-26T11:06:00.684+11:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="solr" /><category scheme="http://www.blogger.com/atom/ns#" term="solrJ" /><title>SolrJ cookbook - Indexing</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/2185370092236618625/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=2185370092236618625&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/2185370092236618625?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/2185370092236618625?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/CpmotKr3Ais/solrj-cookbook-indexing.html" title="SolrJ cookbook - Indexing" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>0</thr:total><content type="html">In SolrJ, there are two approaches to index your document, either manually populate your SolrInputDocument, or add SolJ annotation Field in your POJO domain object.

1. indexing with annotated POJO Bean.
This approach is easy when you start project from scratch, or at least you can access the source code.

1.1 The POJO 
import org.apache.solr.client.solrj.beans.Field;

public class Post {

&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/aym853wlyTvjjg1WS8qa2u3GNZs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aym853wlyTvjjg1WS8qa2u3GNZs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/aym853wlyTvjjg1WS8qa2u3GNZs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aym853wlyTvjjg1WS8qa2u3GNZs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/CpmotKr3Ais" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2011/02/solrj-cookbook-indexing.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQDRnwzcSp7ImA9Wx9bFUQ.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-2488873115972910291</id><published>2011-02-25T11:06:00.000+11:00</published><updated>2011-02-25T11:06:17.289+11:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-25T11:06:17.289+11:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="solr" /><category scheme="http://www.blogger.com/atom/ns#" term="solrJ" /><title>SolrJ cookbook - Setup</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/2488873115972910291/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=2488873115972910291&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/2488873115972910291?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/2488873115972910291?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/IB11kSjiK2U/solrj-cookbook-setup.html" title="SolrJ cookbook - Setup" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>0</thr:total><content type="html">Solr makes searching much easier for your web applications in any programming languages. I will write a series of posts about how to use its Java client, solrJ.

Here is the first part, all about how to setup solrJ in your project. I'm using Maven and Spring framework.

1. Add solrJ dependency in your pom.xml:
  
   org.apache.solr
   solr-solrj
   ${solr.version}
  

2. Define Solr Server in 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Tds3SpwX1H1B3mxRhdRfEadvpF4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Tds3SpwX1H1B3mxRhdRfEadvpF4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Tds3SpwX1H1B3mxRhdRfEadvpF4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Tds3SpwX1H1B3mxRhdRfEadvpF4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/IB11kSjiK2U" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2011/02/solrj-cookbook-setup.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0YFSXcyfip7ImA9Wx9UE0U.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-2293825634823790245</id><published>2011-02-11T10:38:00.000+11:00</published><updated>2011-02-11T10:38:38.996+11:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-11T10:38:38.996+11:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jQuery Mobile" /><title>Dynamically create elements in jQuery Mobile</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/2293825634823790245/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=2293825634823790245&amp;isPopup=true" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/2293825634823790245?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/2293825634823790245?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/CLeTQKgKuM4/dynamically-create-elements-in-jquery.html" title="Dynamically create elements in jQuery Mobile" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>1</thr:total><content type="html">jQuery Mobile is excellent to build mobile website. That is, you generate the html page using server side script, PHP, ASP or JSP. Then jQuery render the page in client side's browser.

However, if you try to use it like traditional AJAX web apps, such as loading JSON result and append them in DOM, you will be in trouble, at least now (jQuery Mobile 1.0a2). I summarized some solutions to force 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/CUs4qvoi-jCvbCPvFkjaOC-Kzgk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CUs4qvoi-jCvbCPvFkjaOC-Kzgk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/CUs4qvoi-jCvbCPvFkjaOC-Kzgk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CUs4qvoi-jCvbCPvFkjaOC-Kzgk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/CLeTQKgKuM4" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2011/02/dynamically-create-elements-in-jquery.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcGQH09eyp7ImA9Wx9RE0Q.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-3498345330437396072</id><published>2010-12-15T16:13:00.000+11:00</published><updated>2010-12-15T16:13:41.363+11:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-15T16:13:41.363+11:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JSP" /><category scheme="http://www.blogger.com/atom/ns#" term="jQuery" /><title>jQuery Template Markup and JSP Expression Language (EL)</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/3498345330437396072/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=3498345330437396072&amp;isPopup=true" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/3498345330437396072?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/3498345330437396072?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/LnYxy-_VddQ/jquery-template-markup-and-jsp.html" title="jQuery Template Markup and JSP Expression Language (EL)" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>5</thr:total><content type="html">Maybe it is "great minds think alike"; both JSP Expression Language (EL) and jQuery Template use the 
${}
as variable placeholders and evaluate it. Since JSP will be complied at server side first, any ${} in JSP file will be evaluated first, even it means for jQuery template. When your result page return to user's browser and jQuery template energy try to complie the template, you will find your 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nifFN4gNENWIb7jrHsYOC_dHMJ0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nifFN4gNENWIb7jrHsYOC_dHMJ0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nifFN4gNENWIb7jrHsYOC_dHMJ0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nifFN4gNENWIb7jrHsYOC_dHMJ0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/LnYxy-_VddQ" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2010/12/jquery-template-markup-and-jsp.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEIBQnoycSp7ImA9Wx9RE00.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-4039805809767546399</id><published>2010-12-14T15:55:00.000+11:00</published><updated>2010-12-14T15:55:53.499+11:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-14T15:55:53.499+11:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><title>Find and Kill Running Windows Processes in Java</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/4039805809767546399/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=4039805809767546399&amp;isPopup=true" title="9 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/4039805809767546399?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/4039805809767546399?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/1UYA6hc0EUw/find-and-kill-running-windows-processes.html" title="Find and Kill Running Windows Processes in Java" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>9</thr:total><content type="html">One of my friends asked me if it is possible to check a programming is running or not in Windows using Java. And close it if it is running. After a little bit research, I found the Java solution for his requirement.

The key is Runtime.getRuntime().exec(), you can run commands available in this platform. In Windows, the "tasklist" command will show you all the processes running (In Linux, you 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BtiYuDy4ld1HuJDPos9Lnj4CVws/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BtiYuDy4ld1HuJDPos9Lnj4CVws/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BtiYuDy4ld1HuJDPos9Lnj4CVws/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BtiYuDy4ld1HuJDPos9Lnj4CVws/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/1UYA6hc0EUw" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2010/12/find-and-kill-running-windows-processes.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQEQXwzcCp7ImA9Wx9SGUs.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-6636480669567558519</id><published>2010-12-10T17:25:00.001+11:00</published><updated>2010-12-10T17:25:00.288+11:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-10T17:25:00.288+11:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="sitemesh" /><title>Dynamically Load Sidebar for Different Page in SiteMesh</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/6636480669567558519/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=6636480669567558519&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/6636480669567558519?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/6636480669567558519?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/9EfvMacS22k/dynamically-load-sidebar-for-different.html" title="Dynamically Load Sidebar for Different Page in SiteMesh" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>0</thr:total><content type="html">It is often the case that your page need to load different sidebar, according to its content. After few tries, I finally figure it out in Sitemesh through "meta" tag.

1. In my project, I prepare two side bars, sidebar.jsp and postsidebar.jsp and place them in the "decorator" directory.




2. In the decorator, default.jsp, get decorator property meta.sidebar and set it to "sidebar" variable. 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/CjdM_TwUmiQk8pGcEZdafjioJ7A/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CjdM_TwUmiQk8pGcEZdafjioJ7A/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/CjdM_TwUmiQk8pGcEZdafjioJ7A/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CjdM_TwUmiQk8pGcEZdafjioJ7A/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/9EfvMacS22k" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2010/12/dynamically-load-sidebar-for-different.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEADR34-eCp7ImA9Wx9SF0s.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-3592330422755519608</id><published>2010-12-08T11:03:00.001+11:00</published><updated>2010-12-08T11:06:16.050+11:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-08T11:06:16.050+11:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SpringMVC" /><category scheme="http://www.blogger.com/atom/ns#" term="jQuery" /><title>File Upload with Uplodify and Spring MVC</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/3592330422755519608/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=3592330422755519608&amp;isPopup=true" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/3592330422755519608?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/3592330422755519608?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/vdlmEmkp6W8/file-upload-with-uplodify-and-spring.html" title="File Upload with Uplodify and Spring MVC" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>2</thr:total><content type="html">It provides user better experience if you can provide a progress indicator when they upload file to server. But this leave you not too many choices but flash in the client. Here is a quick note when I use Uplodify , a jQuery plugin that employ flash to upload file to the server powered by Spring MVC.

Client Side
1. include necessary library
&amp;lt;script type="text/javascript" src="&amp;lt;c:url value='/
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8CF2M2PdMfQrG1ryL2bDTPfmjWA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8CF2M2PdMfQrG1ryL2bDTPfmjWA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8CF2M2PdMfQrG1ryL2bDTPfmjWA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8CF2M2PdMfQrG1ryL2bDTPfmjWA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/vdlmEmkp6W8" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2010/12/file-upload-with-uplodify-and-spring.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0MDQHYyeip7ImA9Wx9SFkw.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-7562691754420933807</id><published>2010-12-06T17:01:00.001+11:00</published><updated>2010-12-06T17:04:31.892+11:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-06T17:04:31.892+11:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jQuery Mobile" /><category scheme="http://www.blogger.com/atom/ns#" term="sitemesh" /><title>Create Mobile Decorator with Sitemesh and jQuery Mobile</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/7562691754420933807/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=7562691754420933807&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/7562691754420933807?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/7562691754420933807?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/oJhM_MkORv4/create-mobile-decorator-with-sitemesh.html" title="Create Mobile Decorator with Sitemesh and jQuery Mobile" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>0</thr:total><content type="html">In my previous post,Mobilize Your Java Web Application, I mentioned to provide a separate decorator for mobile user. In this post I will demonstrate how to achieve this:

1. automatically apply mobile decorator if the request came from mobile browser

2. leave it to user, if user choose the mobile version in their request parameter, such as "document/list?version=mobile".




First of all, let me
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/F3z-PQYAzLkOz_LyS5XfLA5Ol_Q/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/F3z-PQYAzLkOz_LyS5XfLA5Ol_Q/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/F3z-PQYAzLkOz_LyS5XfLA5Ol_Q/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/F3z-PQYAzLkOz_LyS5XfLA5Ol_Q/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/oJhM_MkORv4" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2010/12/create-mobile-decorator-with-sitemesh.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0MGR386cCp7ImA9Wx9SFkw.&quot;"><id>tag:blogger.com,1999:blog-6270710391678397487.post-8993161345236285298</id><published>2010-12-06T16:26:00.002+11:00</published><updated>2010-12-06T17:03:46.118+11:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-06T17:03:46.118+11:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="iphone" /><title>Mobilize Your Java Web Application</title><link rel="replies" type="application/atom+xml" href="http://www.ke-cai.net/feeds/8993161345236285298/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6270710391678397487&amp;postID=8993161345236285298&amp;isPopup=true" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/8993161345236285298?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6270710391678397487/posts/default/8993161345236285298?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/KeCai/~3/IyoiGuji8-U/mobilize-your-java-web-application.html" title="Mobilize Your Java Web Application" /><author><name>Ke Cai</name><uri>http://www.blogger.com/profile/04686894395024117708</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="29" height="32" src="http://1.bp.blogspot.com/_tkhEgj4TEWY/S0ZzmW-LTSI/AAAAAAAAADQ/awitFOAa-bI/S220/ke-cai.png" /></author><thr:total>0</thr:total><content type="html">Mobile web access is growing by 30% every year, so do consider to make your Java web application work well on a small screen. In this post, I'm going to analyze a typical java web application and make it mobile access ready.

Usually, a Java web application consist two parts:

1. the layout template framework, such as Tiles, or Sitemesh. 


2. a web framework to handle request and return JSP 
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/bK7yZ-Q-cxJWF0y9PCpYZF0AhHs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bK7yZ-Q-cxJWF0y9PCpYZF0AhHs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/bK7yZ-Q-cxJWF0y9PCpYZF0AhHs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bK7yZ-Q-cxJWF0y9PCpYZF0AhHs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/KeCai/~4/IyoiGuji8-U" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.ke-cai.net/2010/12/mobilize-your-java-web-application.html</feedburner:origLink></entry></feed>

