<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Rajibul Islam Blog</title>
	<atom:link href="http://rajibinfo.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rajibinfo.wordpress.com</link>
	<description>Try to make first step...</description>
	<lastBuildDate>Wed, 18 Mar 2009 04:47:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='rajibinfo.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Rajibul Islam Blog</title>
		<link>http://rajibinfo.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://rajibinfo.wordpress.com/osd.xml" title="Rajibul Islam Blog" />
	<atom:link rel='hub' href='http://rajibinfo.wordpress.com/?pushpress=hub'/>
		<item>
		<title>iReport Pie Chart Report</title>
		<link>http://rajibinfo.wordpress.com/2009/03/17/ireport-pie-chart-report/</link>
		<comments>http://rajibinfo.wordpress.com/2009/03/17/ireport-pie-chart-report/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 04:42:36 +0000</pubDate>
		<dc:creator>rajibinfo</dc:creator>
				<category><![CDATA[iReport]]></category>
		<category><![CDATA[Jasper Report]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[pie]]></category>
		<category><![CDATA[pie chart]]></category>

		<guid isPermaLink="false">http://rajibinfo.com/?p=163</guid>
		<description><![CDATA[This blog i will show how to make a pie chart report. here i used very simple report. I have one table called category it has different categoryno with categroy name. Each category has subcategory. I want to show how many categories are there by pie chart.  Category table struc and data link will give [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rajibinfo.wordpress.com&amp;blog=5932016&amp;post=163&amp;subd=rajibinfo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This blog i will show how to make a pie chart report. here i used very simple report. I have one table called category it has different categoryno with categroy name. Each category has subcategory. I want to show how many categories are there by pie chart.  <a rel="attachment wp-att-164" href="http://rajibinfo.com/2009/03/17/ireport-pie-chart-report/category/">Category table struc and data</a> link will give you the table structure and some sample data. I used MySql database for this report.</p>
<ul>
<li>Create New document from iReport. use this band value title = 30, columnHeader = 15, detail = 15 and summary = 300 and others = 0.</li>
<li>Add Query:     select category &#8220;Cat No&#8221;, subcat_name &#8220;category Name&#8221;, count(category) total from category<br />
group by category order by 1</li>
<li>Add 3 fields &#8211; Cat No, Category Name, Total to Detail band.    <a rel="attachment wp-att-165" href="http://rajibinfo.com/2009/03/17/ireport-pie-chart-report/detail-band/"><img class="size-medium wp-image-165 aligncenter" title="detail-band" src="http://rajibinfo.files.wordpress.com/2009/03/detail-band.jpg?w=300&#038;h=108" alt="detail-band" width="300" height="108" /></a></li>
<li>Click the char button and select the Pie 3D. I put its width is 268 and height is 203.   <a rel="attachment wp-att-172" href="http://rajibinfo.com/2009/03/17/ireport-pie-chart-report/ui2/"><img class="aligncenter size-medium wp-image-172" title="ui2" src="http://rajibinfo.files.wordpress.com/2009/03/ui2.jpg?w=300&#038;h=150" alt="ui2" width="300" height="150" /></a></li>
<li>right click on chart and select cart properties. select cart data tab, select the Details tab. and put the value as follows -  for Key Expression = $F{category Name} ,  Value Expression = $F{total},  Label Expression = $F{category Name}</li>
<li>click close.</li>
<li>b4 execute you must select your database connection. now click Execute with data connection. the output file will looks like as follows</li>
</ul>
<p><a rel="attachment wp-att-173" href="http://rajibinfo.com/2009/03/17/ireport-pie-chart-report/output-pie-report/"><img class="aligncenter size-medium wp-image-173" title="output-pie-report" src="http://rajibinfo.files.wordpress.com/2009/03/output-pie-report.jpg?w=300&#038;h=187" alt="output-pie-report" width="300" height="187" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rajibinfo.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rajibinfo.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rajibinfo.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rajibinfo.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rajibinfo.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rajibinfo.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rajibinfo.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rajibinfo.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rajibinfo.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rajibinfo.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rajibinfo.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rajibinfo.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rajibinfo.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rajibinfo.wordpress.com/163/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rajibinfo.wordpress.com&amp;blog=5932016&amp;post=163&amp;subd=rajibinfo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rajibinfo.wordpress.com/2009/03/17/ireport-pie-chart-report/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8907817131aa8e4a6ee143a4f20c7b9d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rajibinfo</media:title>
		</media:content>

		<media:content url="http://rajibinfo.files.wordpress.com/2009/03/detail-band.jpg?w=300" medium="image">
			<media:title type="html">detail-band</media:title>
		</media:content>

		<media:content url="http://rajibinfo.files.wordpress.com/2009/03/ui2.jpg?w=300" medium="image">
			<media:title type="html">ui2</media:title>
		</media:content>

		<media:content url="http://rajibinfo.files.wordpress.com/2009/03/output-pie-report.jpg?w=300" medium="image">
			<media:title type="html">output-pie-report</media:title>
		</media:content>
	</item>
		<item>
		<title>Allow number only in TextField by javascript</title>
		<link>http://rajibinfo.wordpress.com/2009/03/12/allow-number-only-in-textfield-by-javascript/</link>
		<comments>http://rajibinfo.wordpress.com/2009/03/12/allow-number-only-in-textfield-by-javascript/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 02:58:45 +0000</pubDate>
		<dc:creator>rajibinfo</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[only nuber allow]]></category>
		<category><![CDATA[textfield number only]]></category>

		<guid isPermaLink="false">http://rajibinfo.com/?p=158</guid>
		<description><![CDATA[this example allow only number character in you text field. &#8212;- JavaScript code function numeralsOnly(thisComp,e,isDecimal) { var key; var keychar; if (window.event) { key = window.event.keyCode; } else if (e) { key = e.which; } else { return true; } // check double period/decimal/point if (  ((thisComp.value).indexOf(&#8216;.&#8217;) &#62; -1) &#38;&#38; key == 46){ alert(&#8220;Double period [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rajibinfo.wordpress.com&amp;blog=5932016&amp;post=158&amp;subd=rajibinfo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>this example allow only number character in you text field.</p>
<p>&#8212;- JavaScript code</p>
<p>function numeralsOnly(thisComp,e,isDecimal) {<br />
var key;<br />
var keychar;<br />
if (window.event) {<br />
key = window.event.keyCode;<br />
}<br />
else if (e) {<br />
key = e.which;<br />
}<br />
else {<br />
return true;<br />
}</p>
<p>// check double period/decimal/point<br />
if (  ((thisComp.value).indexOf(&#8216;.&#8217;) &gt; -1) &amp;&amp; key == 46){<br />
alert(&#8220;Double period is not allow for this field.&#8221;);<br />
return false;<br />
}</p>
<p>var str = &#8217;0123456789&#8242;;<br />
str +=isDecimal ? &#8216;.&#8217;:&#8221;;<br />
keychar = String.fromCharCode(key);<br />
if ((key==null) || (key==0) || (key==8) ||  (key==9) || (key==13) || (key==27) ) {<br />
return true;<br />
}<br />
else if (((str).indexOf(keychar) &gt; -1)) {<br />
return true;<br />
}</p>
<p>alert(&#8220;Enter numerals only in this field.&#8221;);<br />
thisComp.focus();<br />
//thisComp.select();<br />
return false;<br />
}</p>
<p>&#8212;&#8212;- html code</p>
<p>&lt;input type=&#8221;text&#8221; id=&#8221;txtSkuPrice&#8221;  onkeypress=&#8221;return numeralsOnly(this,event,true);&#8221;/&gt;</p>
<p>numeralsOnly(this,event,true) -&gt; for Double number use true and for integer number use false.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rajibinfo.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rajibinfo.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rajibinfo.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rajibinfo.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rajibinfo.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rajibinfo.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rajibinfo.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rajibinfo.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rajibinfo.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rajibinfo.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rajibinfo.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rajibinfo.wordpress.com/158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rajibinfo.wordpress.com/158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rajibinfo.wordpress.com/158/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rajibinfo.wordpress.com&amp;blog=5932016&amp;post=158&amp;subd=rajibinfo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rajibinfo.wordpress.com/2009/03/12/allow-number-only-in-textfield-by-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8907817131aa8e4a6ee143a4f20c7b9d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rajibinfo</media:title>
		</media:content>
	</item>
		<item>
		<title>Get Number value from Currency format String</title>
		<link>http://rajibinfo.wordpress.com/2009/03/12/get-number-value-from-currency-format-string/</link>
		<comments>http://rajibinfo.wordpress.com/2009/03/12/get-number-value-from-currency-format-string/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 02:27:03 +0000</pubDate>
		<dc:creator>rajibinfo</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[currency to number]]></category>
		<category><![CDATA[GetNumber]]></category>
		<category><![CDATA[regular expression]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[string to number]]></category>

		<guid isPermaLink="false">http://rajibinfo.com/?p=156</guid>
		<description><![CDATA[some time we need get the actual number value from a well formated string. this example shows how we get the exact number value. Lets consider we have a string its value like $1,221.22 So the actual number is 1221.22 after eliminate the Dollar sign and comma. The javascript code is - function getNumberFromCurrencyString(currencyString){ var [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rajibinfo.wordpress.com&amp;blog=5932016&amp;post=156&amp;subd=rajibinfo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>some time we need get the actual number value from a well formated string. this example shows how we get the exact number value.</p>
<p>Lets consider we have a string its value like</p>
<p>$1,221.22</p>
<p>So the actual number is 1221.22 after eliminate the Dollar sign and comma. The javascript code is -</p>
<p>function getNumberFromCurrencyString(currencyString){<br />
var result = currencyString.replace(&#8216;$&#8217;,&#8221;); //remove dollar<br />
result = result.replace(/\,/g,&#8221;); //remove comma<br />
return result;<br />
}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rajibinfo.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rajibinfo.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rajibinfo.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rajibinfo.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rajibinfo.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rajibinfo.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rajibinfo.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rajibinfo.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rajibinfo.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rajibinfo.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rajibinfo.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rajibinfo.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rajibinfo.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rajibinfo.wordpress.com/156/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rajibinfo.wordpress.com&amp;blog=5932016&amp;post=156&amp;subd=rajibinfo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rajibinfo.wordpress.com/2009/03/12/get-number-value-from-currency-format-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8907817131aa8e4a6ee143a4f20c7b9d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rajibinfo</media:title>
		</media:content>
	</item>
		<item>
		<title>Complete Spring IBatis project</title>
		<link>http://rajibinfo.wordpress.com/2009/01/24/complete-spring-ibatis-project/</link>
		<comments>http://rajibinfo.wordpress.com/2009/01/24/complete-spring-ibatis-project/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 06:10:15 +0000</pubDate>
		<dc:creator>rajibinfo</dc:creator>
				<category><![CDATA[IBATIS]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[display tag]]></category>
		<category><![CDATA[spring ibatis]]></category>

		<guid isPermaLink="false">http://rajibinfo.wordpress.com/?p=140</guid>
		<description><![CDATA[here i am describing a very simple Spring project with IBatis and Display tag. let me describe the working environment. my another blog shows how to set up your environment. note &#8211; this project is available at google code. project name - springibatis # Non-members may check out a read-only working copy anonymously over HTTP. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rajibinfo.wordpress.com&amp;blog=5932016&amp;post=140&amp;subd=rajibinfo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>here i am describing a very simple Spring project with IBatis and Display tag. let me describe the working environment. my another <a href="../category/tech/how-to/" target="_blank">blog</a> shows how to set up your environment.</p>
<p><strong>note &#8211; this project is available at google code. </strong></p>
<pre><strong>project name - springibatis</strong></pre>
<p><tt># Non-members may check out a read-only working copy </tt><tt>anonymously over HTTP.</tt></p>
<h3><strong>url(<tt><strong><tt>springibatis-read-only</tt></strong></tt></strong>)<strong>:     <tt>svn checkout <em>http</em>://springibatis.googlecode.com/svn/trunk/<br />
</tt></strong></h3>
<div class="bubble_wrapper"></div>
<p>Eclipse 3.4: Ganymede;</p>
<p>Plugs in: svn, Maven, spring-ide, tomcat lunher, ant.</p>
<p>Tomcat: 5.5</p>
<p>FireFox: 3</p>
<p>Create a new project in Eclipse;</p>
<div id="attachment_120" class="wp-caption aligncenter" style="width:309px;"><a rel="attachment wp-att-120" href="http://rajibinfo.wordpress.com/2009/01/17/spring-project-step-by-step/newproject/"><img class="size-medium wp-image-120" title="newproject" src="http://rajibinfo.files.wordpress.com/2009/01/newproject.jpg?w=299&#038;h=300&#038;h=300" alt="Eclipse create new project" width="299" height="300" /></a></p>
<p class="wp-caption-text">Eclipse create new project</p>
</div>
<p><a rel="attachment wp-att-141" href="http://rajibinfo.wordpress.com/2009/01/24/complete-spring-ibatis-project/newproject1/"><img class="aligncenter size-medium wp-image-141" title="newproject1" src="http://rajibinfo.files.wordpress.com/2009/01/newproject1.jpg?w=300&#038;h=300" alt="newproject1" width="300" height="300" /></a></p>
<p>create one package name:  click the right button on the src folder and select new -&gt; Package and put  com.rajib.spring.ibatis value.</p>
<p>create a class Person under the ibatis folder. similar way create some other files &#8211; Person.xml, PersonDao.java, PersonDaoImpl.java</p>
<p>create applicationContext-ibatis.xml under src folder. we will describe at web.xml that where the applicationContext file is located. it looks</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;  applicationContext-ibatis.xm</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;!DOCTYPE beans PUBLIC &#8220;-//SPRING//DTD BEAN//EN&#8221;<br />
&#8220;http://www.springframework.org/dtd/spring-beans.dtd&#8221;&gt;<br />
&lt;beans&gt;<br />
&lt;bean class=&#8221;org.apache.commons.dbcp.BasicDataSource&#8221;<br />
destroy-method=&#8221;close&#8221; id=&#8221;dataSource&#8221;&gt;<br />
&lt;!&#8211; property name=&#8221;driverClassName&#8221; value=&#8221;oracle.jdbc.driver.OracleDriver&#8221;/&#8211;&gt;<br />
&lt;property name=&#8221;driverClassName&#8221; value=&#8221;org.gjt.mm.mysql.Driver&#8221;/&gt;<br />
&lt;property name=&#8221;url&#8221; value=&#8221;jdbc:mysql://localhost/development&#8221;/&gt;<br />
&lt;property name=&#8221;username&#8221; value=&#8221;root&#8221;/&gt;<br />
&lt;property name=&#8221;password&#8221; value=&#8221;"/&gt;<br />
&lt;/bean&gt;</p>
<p>&lt;!&#8211; Transaction manager for a single JDBC DataSource &#8211;&gt;<br />
&lt;bean  class=&#8221;org.springframework.jdbc.datasource.DataSourceTransactionManager&#8221; id=&#8221;dataSourceTransactionManager&#8221;&gt;<br />
&lt;property name=&#8221;dataSource&#8221; ref=&#8221;dataSource&#8221;/&gt;<br />
&lt;/bean&gt;<br />
&lt;!&#8211; SqlMap setup for iBATIS Database Layer &#8211;&gt;<br />
&lt;bean class=&#8221;org.springframework.orm.ibatis.SqlMapClientFactoryBean&#8221; id=&#8221;sqlMapClient&#8221;&gt;<br />
&lt;property name=&#8221;configLocation&#8221;&gt;<br />
&lt;value&gt;classpath:SqlMapConfig.xml&lt;/value&gt;<br />
&lt;/property&gt;<br />
&lt;property name=&#8221;dataSource&#8221; ref=&#8221;dataSource&#8221;/&gt;<br />
&lt;/bean&gt;</p>
<p>&lt;bean id=&#8221;personDao&#8221; class=&#8221;com.rajib.spring.ibatis.PersonDaoImpl&#8221;&gt;<br />
&lt;property name=&#8221;dataSource&#8221; ref=&#8221;dataSource&#8221;&gt;&lt;/property&gt;<br />
&lt;property name=&#8221;sqlMapClient&#8221; ref=&#8221;sqlMapClient&#8221;&gt;&lt;/property&gt;<br />
&lt;/bean&gt;</p>
<p>&lt;/beans&gt;</p>
<p>here we create one bean &#8216;dataSource&#8217; that store database connnection. we create another bean sqlMapClient that will be use all ibatis query. we push datasource bean to sqlMapClient bean. these 2 bean will use personDao later.</p>
<p>I used a new <a href="http://displaytag.sourceforge.net" target="_blank">display tag</a> that  does column display, sorting, paging, cropping, grouping, exporting, smart linking and decoration of a table.</p>
<p>In index.jsp,</p>
<p>BeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource(<br />
&#8220;applicationContext-ibatis.xml&#8221;));<br />
PersonDao personDao = (PersonDao)beanFactory.getBean(&#8220;personDao&#8221;);<br />
List&lt;Person&gt; allPersons = personDao.getAllPersons();<br />
request.setAttribute( &#8220;persons&#8221;, allPersons );</p>
<p>this is used to collecting data from database. the persons list is put into request so that the display tag can used it easily.</p>
<p>&lt;display:table name=&#8221;persons&#8221;  class=&#8221;mars&#8221; pagesize=&#8221;25&#8243;&gt;<br />
&lt;display:column property=&#8221;id&#8221; title=&#8221;ID&#8221; /&gt;<br />
&lt;display:column property=&#8221;name&#8221; /&gt;<br />
&lt;/display:table&gt;<br />
the output looks-</p>
<p><a rel="attachment wp-att-142" href="http://rajibinfo.wordpress.com/2009/01/24/complete-spring-ibatis-project/output1/"><img class="aligncenter size-medium wp-image-142" title="output1" src="http://rajibinfo.files.wordpress.com/2009/01/output1.jpg?w=300&#038;h=261" alt="output1" width="300" height="261" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rajibinfo.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rajibinfo.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rajibinfo.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rajibinfo.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rajibinfo.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rajibinfo.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rajibinfo.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rajibinfo.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rajibinfo.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rajibinfo.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rajibinfo.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rajibinfo.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rajibinfo.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rajibinfo.wordpress.com/140/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rajibinfo.wordpress.com&amp;blog=5932016&amp;post=140&amp;subd=rajibinfo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rajibinfo.wordpress.com/2009/01/24/complete-spring-ibatis-project/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8907817131aa8e4a6ee143a4f20c7b9d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rajibinfo</media:title>
		</media:content>

		<media:content url="http://rajibinfo.files.wordpress.com/2009/01/newproject.jpg?w=299&#38;h=300" medium="image">
			<media:title type="html">newproject</media:title>
		</media:content>

		<media:content url="http://rajibinfo.files.wordpress.com/2009/01/newproject1.jpg?w=300" medium="image">
			<media:title type="html">newproject1</media:title>
		</media:content>

		<media:content url="http://rajibinfo.files.wordpress.com/2009/01/output1.jpg?w=300" medium="image">
			<media:title type="html">output1</media:title>
		</media:content>
	</item>
		<item>
		<title>Spring project step by step</title>
		<link>http://rajibinfo.wordpress.com/2009/01/17/spring-project-step-by-step/</link>
		<comments>http://rajibinfo.wordpress.com/2009/01/17/spring-project-step-by-step/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 04:36:05 +0000</pubDate>
		<dc:creator>rajibinfo</dc:creator>
				<category><![CDATA[Spring]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[build xml]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[simple spring]]></category>
		<category><![CDATA[spring step by step]]></category>
		<category><![CDATA[spring web]]></category>
		<category><![CDATA[Tomcat]]></category>

		<guid isPermaLink="false">http://rajibinfo.wordpress.com/?p=119</guid>
		<description><![CDATA[here i describe a very simple Spring project. let me describe the working environment. my another blog shows how to set up your environment. Eclipse 3.4: Ganymede; Plugs in: svn, Maven, spring-ide, tomcat lunher, ant. Tomcat: 5.5 FireFox: 3 Create a new project in Eclipse; create one package name:  click the right button on the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rajibinfo.wordpress.com&amp;blog=5932016&amp;post=119&amp;subd=rajibinfo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>here i describe a very simple Spring project. let me describe the working environment. my another <a href="http://rajibinfo.wordpress.com/category/tech/how-to/" target="_blank">blog</a> shows how to set up your environment.</p>
<p>Eclipse 3.4: Ganymede;</p>
<p>Plugs in: svn, Maven, spring-ide, tomcat lunher, ant.</p>
<p>Tomcat: 5.5</p>
<p>FireFox: 3</p>
<p>Create a new project in Eclipse;</p>
<div id="attachment_120" class="wp-caption aligncenter" style="width: 309px"><a rel="attachment wp-att-120" href="http://rajibinfo.wordpress.com/2009/01/17/spring-project-step-by-step/newproject/"><img class="size-medium wp-image-120" title="newproject" src="http://rajibinfo.files.wordpress.com/2009/01/newproject.jpg?w=299&#038;h=300" alt="Eclipse create new project" width="299" height="300" /></a><p class="wp-caption-text">Eclipse create new project</p></div>
<div id="attachment_121" class="wp-caption aligncenter" style="width: 298px"><a rel="attachment wp-att-121" href="http://rajibinfo.wordpress.com/2009/01/17/spring-project-step-by-step/newproject2/"><img class="size-medium wp-image-121" title="newproject2" src="http://rajibinfo.files.wordpress.com/2009/01/newproject2.jpg?w=288&#038;h=300" alt="set project name" width="288" height="300" /></a><p class="wp-caption-text">set project name</p></div>
<p>create one package name:  click the right button on the src folder and select new -&gt; Package and put  com.rajib.spring.samplespring.model value.</p>
<p>create a class Information under the model folder. this class looks</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;Information.java</p>
<p>package com.rajib.spring.samplespring.model;</p>
<p>public class Information {</p>
<p>private String projectName = &#8220;Spring demo1&#8243;;<br />
private String version = &#8221; 1.1&#8243;;</p>
<p>public String getProjectName() {<br />
return projectName;<br />
}<br />
public void setProjectName(String projectName) {<br />
this.projectName = projectName;<br />
}<br />
public String getVersion() {<br />
return version;<br />
}<br />
public void setVersion(String version) {<br />
this.version = version;<br />
}<br />
}</p>
<p>create an xml file  applicationContext.xml under the src file. by default spring is looking this under web-inf folder but we put his under class path intentionally thats why we will mention the conetx file location at the web.xml.</p>
<p>&#8212;&#8212;&#8212;&#8212;- applicationContext.xml</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;!DOCTYPE beans PUBLIC &#8220;-//SPRING//DTD BEAN//EN&#8221; &#8220;http://www.springframework.org/dtd/spring-beans.dtd&#8221;&gt;<br />
&lt;beans&gt;<br />
&lt;bean id=&#8221;information&#8221; class=&#8221;com.rajib.spring.samplespring.model.Information&#8221;/&gt;<br />
&lt;/beans&gt;</p>
<p>we will show infromation.project name and information.version at index.jsp page. we used the information class as bean.</p>
<p>Create WebContent folder under the project. create WEB-INF folder under the WebContent folder. Create lib folder under WEB-INF folder. I used lot of jar files as library file. My lib contains <a title="Rajib Blog -&gt; Jarlist" href="http://rajibinfo.files.wordpress.com/2009/01/jarlist.pdf" target="_blank">jarlist</a> jar files.</p>
<p>Create log4j.properties and web.xml file under WEB-INF folder.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8211;log4j.properties</p>
<p>log4j.logger.java.sql=DEBUG, STDOUT<br />
log4j.logger.com.ibatis=DEBUG, STDOUT<br />
log4j.logger.java.sql.Statement=INFO,STDOUT<br />
log4j.rootLogger=ERROR,STDOUT</p>
<p>log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender<br />
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout<br />
log4j.appender.STDOUT.layout.conversionPattern=%-5p &#8211; %-26.26c{1} &#8211; %m\n</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- web.xml</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;web-app version=&#8221;2.4&#8243; xmlns=&#8221;http://java.sun.com/xml/ns/j2ee&#8221;<br />
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 />
&lt;description&gt;Spring simple example&lt;/description&gt;<br />
&lt;display-name&gt;simplespring&lt;/display-name&gt;<br />
&lt;context-param&gt;<br />
&lt;param-name&gt;webAppRootKey&lt;/param-name&gt;<br />
&lt;param-value&gt;simplespring&lt;/param-value&gt;<br />
&lt;/context-param&gt;<br />
&lt;context-param&gt;<br />
&lt;param-name&gt;log4jConfigLocation&lt;/param-name&gt;<br />
&lt;param-value&gt;/WEB-INF/log4j.properties&lt;/param-value&gt;<br />
&lt;/context-param&gt;<br />
&lt;context-param&gt;<br />
&lt;param-name&gt;ADMIN_EMAIL_ADDRESS&lt;/param-name&gt;<br />
&lt;param-value&gt;rajib_info@yahoo.com&lt;/param-value&gt;<br />
&lt;/context-param&gt;</p>
<p>&lt;context-param&gt;<br />
&lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;<br />
&lt;param-value&gt;/WEB-INF/classes/applicationContext.xml&lt;/param-value&gt;<br />
&lt;/context-param&gt;</p>
<p>&lt;listener&gt;<br />
&lt;listener-class&gt;org.springframework.web.util.Log4jConfigListener&lt;/listener-class&gt;<br />
&lt;/listener&gt;</p>
<p>&lt;listener&gt;<br />
&lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;<br />
&lt;/listener&gt;</p>
<p>&lt;session-config&gt;<br />
&lt;session-timeout&gt;10&lt;/session-timeout&gt;<br />
&lt;/session-config&gt;<br />
&lt;welcome-file-list&gt;<br />
&lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;<br />
&lt;/welcome-file-list&gt;<br />
&lt;/web-app&gt;</p>
<p>Create index.jsp file under WebContent folder.</p>
<p>&#8212;&#8212;&#8212;&#8211; index.jsp</p>
<p>&lt;%@ page language=&#8221;java&#8221; contentType=&#8221;text/html; charset=ISO-8859-1&#8243; pageEncoding=&#8221;ISO-8859-1&#8243;%&gt;<br />
&lt;%@ page import=&#8221;org.springframework.beans.factory.BeanFactory,<br />
org.springframework.beans.factory.xml.XmlBeanFactory,<br />
org.springframework.core.io.ClassPathResource,<br />
com.rajib.spring.samplespring.model.Information&#8221;%&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Simple Spring example&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body bgcolor=&#8221;white&#8221;&gt;<br />
&lt;h2&gt;(Spring example by rajib_info@yahoo.com)&lt;/h2&gt;</p>
<p>&lt;%<br />
BeanFactory beanFactory = new XmlBeanFactory( new ClassPathResource(&#8220;applicationContext.xml&#8221;));<br />
Information info = (Information)beanFactory.getBean(&#8220;information&#8221;);<br />
%&gt;</p>
<p>Hello, this is sample spring project! &lt;br /&gt;<br />
Project Name is    : &lt;b&gt; &lt;%=info.getProjectName() %&gt; &lt;/b&gt;<br />
Project Version is : &lt;b&gt; &lt;%=info.getVersion() %&gt; &lt;/b&gt;<br />
&lt;/body&gt;</p>
<p>to make the build path to do the following</p>
<div id="attachment_123" class="wp-caption alignright" style="width: 310px"><a rel="attachment wp-att-123" href="http://rajibinfo.wordpress.com/2009/01/17/spring-project-step-by-step/buildpath/"><img class="size-medium wp-image-123" title="buildpath" src="http://rajibinfo.files.wordpress.com/2009/01/buildpath.jpg?w=300&#038;h=244" alt="eclipse build path" width="300" height="244" /></a><p class="wp-caption-text">eclipse build path</p></div>
<p>-click right button on the project and select properties select the Java Build Path from the left side. click &#8211; Library tab from right side , click Add jar select all jars of  (SimpleSpring-&gt;WebContent-&gt;lib all jars). click the Ordre and Ecports tab and click on  Select All button.</p>
<p>How to run this project:</p>
<p>for building this project we need buld.xml</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- build.xml</p>
<p>&lt;project name=&#8221;simplespring&#8221; basedir=&#8221;.&#8221; default=&#8221;deploy&#8221;&gt;<br />
&lt;!&#8211; Project settings &#8211;&gt;<br />
&lt;property name=&#8221;project.distname&#8221; value=&#8221;simplespring&#8221;/&gt;<br />
&lt;!&#8211; Local system paths &#8211;&gt;<br />
&lt;property file=&#8221;${basedir}/build.properties&#8221;/&gt;<br />
&lt;property name=&#8221;webroot.dir&#8221; value=&#8221;${basedir}/WebContent&#8221;/&gt;<br />
&lt;property name=&#8221;webinf.dir&#8221; value=&#8221;${webroot.dir}/WEB-INF&#8221;/&gt;<br />
&lt;property name=&#8221;build.dir&#8221; value=&#8221;target&#8221;/&gt;</p>
<p>&lt;!&#8211; classpath for WEB-INF/lib &#8211;&gt;<br />
&lt;path id=&#8221;compile.classpath&#8221;&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/acegi-security-1.0.3.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/activation.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/antlr-2.7.6.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/aopalliance.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/avalon-framework-4.2.0.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/barbecue-1.1.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/bsf-2.3.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/bsh-2.0b4.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/cglib-nodep-2.1_3.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/commons-annotations.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/commons-beanutils.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/commons-codec.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/commons-collections.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/commons-dbcp.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/commons-digester-1.8.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/commons-discovery-0.4.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/commons-fileupload.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/commons-io.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/commons-javaflow-20060411.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/commons-lang.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/commons-logging-1.1.1.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/commons-pool.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/commons-validator-1.3.1.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/dom4j-1.6.1.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/dwr.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/EasySI-0.9.0.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/ehcache-1.2.3.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/fop.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/ibatis-common-2.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/ibatis-sqlmap-2.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/iReport.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/itext-1.3.1.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/jakarta-oro-2.0.8.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/jaxen-1.1-beta-7.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/jazzy-core.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/jsf-facelets.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/jsf-impl.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/jstl.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/jta.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/log4j-1.2.14.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/mail.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/myfaces-api-1.2.5.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/myfaces-impl-1.2.5.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/myfaces-shared-impl-3.0.5.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/ojdbc14.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/poi-3.0.1-FINAL-20070705.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/quartz-all-1.6.1-RC1.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/serializer-2.7.0.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/spring-aop.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/spring-beans.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/spring-core.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/spring-context.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/spring-dao.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/spring-ibatis.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/spring-jdbc.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/spring-support.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/spring-web.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/spring-webmvc.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/standard.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/tomahawk12-1.1.8.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/xalan-2.7.0.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/xercesImpl-2.7.1.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/xml-apis-1.3.02.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/lib/xmlgraphics-commons-1.1.jar&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${webinf.dir}/classes&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${classpath.external}&#8221;/&gt;<br />
&lt;pathelement path =&#8221;${classpath}&#8221;/&gt;<br />
&lt;/path&gt;</p>
<p>&lt;!&#8211; define your folder for deployment &#8211;&gt;<br />
&lt;property name=&#8221;deploy.dir&#8221; value=&#8221;deploy&#8221;/&gt;</p>
<p>&lt;!&#8211; Check timestamp on files &#8211;&gt;<br />
&lt;target name=&#8221;prepare&#8221;&gt;<br />
&lt;tstamp/&gt;<br />
&lt;/target&gt;</p>
<p>&lt;!&#8211; Copy any resource or configuration files &#8211;&gt;<br />
&lt;target name=&#8221;resources&#8221;&gt;<br />
&lt;copy todir=&#8221;${webinf.dir}/classes&#8221; includeEmptyDirs=&#8221;no&#8221;&gt;<br />
&lt;fileset dir=&#8221;src&#8221;&gt;<br />
&lt;patternset&gt;<br />
&lt;include name=&#8221;**/*.conf&#8221;/&gt;<br />
&lt;include name=&#8221;**/*.properties&#8221;/&gt;<br />
&lt;include name=&#8221;**/*.xml&#8221;/&gt;<br />
&lt;/patternset&gt;<br />
&lt;/fileset&gt;<br />
&lt;/copy&gt;<br />
&lt;/target&gt;</p>
<p>&lt;!&#8211; Normal build of application &#8211;&gt;<br />
&lt;target name=&#8221;compile&#8221; depends=&#8221;prepare,resources&#8221;&gt;<br />
&lt;javac srcdir=&#8221;src&#8221; destdir=&#8221;${webinf.dir}/classes&#8221; encoding=&#8221;UTF-8&#8243;&gt;<br />
&lt;classpath refid=&#8221;compile.classpath&#8221;/&gt;<br />
&lt;/javac&gt;<br />
&lt;/target&gt;</p>
<p>&lt;!&#8211; Remove classes directory for clean build &#8211;&gt;<br />
&lt;target name=&#8221;clean&#8221;<br />
description=&#8221;Prepare for clean build&#8221;&gt;<br />
&lt;delete dir=&#8221;${webinf.dir}/classes&#8221;/&gt;<br />
&lt;mkdir  dir=&#8221;${webinf.dir}/classes&#8221;/&gt;<br />
&lt;/target&gt;</p>
<p>&lt;!&#8211; Build entire project &#8211;&gt;<br />
&lt;target name=&#8221;build&#8221; depends=&#8221;prepare,compile&#8221;/&gt;<br />
&lt;target name=&#8221;rebuild&#8221; depends=&#8221;clean,prepare,compile&#8221;/&gt;</p>
<p>&lt;!&#8211; Create binary distribution &#8211;&gt;<br />
&lt;target name=&#8221;war&#8221; depends=&#8221;build&#8221;&gt;<br />
&lt;mkdir dir=&#8221;${build.dir}&#8221;/&gt;<br />
&lt;war<br />
basedir=&#8221;${webroot.dir}&#8221;<br />
warfile=&#8221;${build.dir}/${project.distname}.war&#8221;<br />
webxml=&#8221;${webinf.dir}/web.xml&#8221;&gt;<br />
&lt;exclude name=&#8221;WEB-INF/${build.dir}/**&#8221;/&gt;<br />
&lt;exclude name=&#8221;WEB-INF/src/**&#8221;/&gt;<br />
&lt;exclude name=&#8221;WEB-INF/web.xml&#8221;/&gt;<br />
&lt;/war&gt;<br />
&lt;/target&gt;</p>
<p>&lt;target name=&#8221;deploy&#8221; depends=&#8221;war&#8221;&gt;<br />
&lt;delete file=&#8221;${deploy.dir}/${project.distname}.war&#8221;/&gt;<br />
&lt;delete dir=&#8221;${deploy.dir}/${project.distname}&#8221;/&gt;<br />
&lt;copy file=&#8221;${build.dir}/${project.distname}.war&#8221; todir=&#8221;${deploy.dir}&#8221;/&gt;<br />
&lt;/target&gt;</p>
<p>&lt;/project&gt;</p>
<p>there are some supporting file exist for this build.xml these are -</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- build.properties</p>
<p>classpath.external=external-lib/servlet-api.jar;external-lib/jsp-api.jar;</p>
<p>so we need to create another folder external-lib and put these 2 jar files.</p>
<p>to build this project <a rel="attachment wp-att-124" href="http://rajibinfo.wordpress.com/2009/01/17/spring-project-step-by-step/build/"><img class="alignright size-medium wp-image-124" title="build" src="http://rajibinfo.files.wordpress.com/2009/01/build.jpg?w=326&#038;h=250" alt="build" width="326" height="250" /></a>use these stepts &#8211; open build.xml. click &#8211; window-&gt;show view -&gt; outline . click the right button on rebuild select &#8211; Run As -&gt; 1 Ant Build.</p>
<p>set a context configaration file at {Tomcat folder}/conf/Catalina/localhost. lest assume this file name is &#8211; simplespring.xml and its looks -</p>
<p>&#8212;&#8212;&#8212;&#8212;-simplespring.xml</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;</p>
<p>&lt;Context docBase=&#8221;D:/workspace/simplespring/WebContent&#8221;<br />
privileged=&#8221;true&#8221; antiResourceLocking=&#8221;false&#8221; antiJARLocking=&#8221;false&#8221;&gt;<br />
&lt;/Context&gt;</p>
<p>if your eclipse has tomcat lunch plugs in so you can deploy from eclipse. click on as picture</p>
<p><a rel="attachment wp-att-125" href="http://rajibinfo.wordpress.com/2009/01/17/spring-project-step-by-step/run-tomcat/"><img class="alignright size-medium wp-image-125" title="run-tomcat" src="http://rajibinfo.files.wordpress.com/2009/01/run-tomcat.jpg?w=300&#038;h=135" alt="run-tomcat" width="300" height="135" /></a></p>
<p>The output looks &#8212;</p>
<p><a rel="attachment wp-att-132" href="http://rajibinfo.wordpress.com/2009/01/17/spring-project-step-by-step/output/"><img class="aligncenter size-medium wp-image-132" title="output" src="http://rajibinfo.files.wordpress.com/2009/01/output.jpg?w=300&#038;h=261" alt="output" width="300" height="261" /></a></p>
<p>the source code is located at -</p>
<p>http://code.google.com/p/simplespringproject/</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rajibinfo.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rajibinfo.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rajibinfo.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rajibinfo.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rajibinfo.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rajibinfo.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rajibinfo.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rajibinfo.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rajibinfo.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rajibinfo.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rajibinfo.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rajibinfo.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rajibinfo.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rajibinfo.wordpress.com/119/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rajibinfo.wordpress.com&amp;blog=5932016&amp;post=119&amp;subd=rajibinfo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rajibinfo.wordpress.com/2009/01/17/spring-project-step-by-step/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8907817131aa8e4a6ee143a4f20c7b9d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rajibinfo</media:title>
		</media:content>

		<media:content url="http://rajibinfo.files.wordpress.com/2009/01/newproject.jpg?w=299" medium="image">
			<media:title type="html">newproject</media:title>
		</media:content>

		<media:content url="http://rajibinfo.files.wordpress.com/2009/01/newproject2.jpg?w=288" medium="image">
			<media:title type="html">newproject2</media:title>
		</media:content>

		<media:content url="http://rajibinfo.files.wordpress.com/2009/01/buildpath.jpg?w=300" medium="image">
			<media:title type="html">buildpath</media:title>
		</media:content>

		<media:content url="http://rajibinfo.files.wordpress.com/2009/01/build.jpg?w=300" medium="image">
			<media:title type="html">build</media:title>
		</media:content>

		<media:content url="http://rajibinfo.files.wordpress.com/2009/01/run-tomcat.jpg?w=300" medium="image">
			<media:title type="html">run-tomcat</media:title>
		</media:content>

		<media:content url="http://rajibinfo.files.wordpress.com/2009/01/output.jpg?w=300" medium="image">
			<media:title type="html">output</media:title>
		</media:content>
	</item>
		<item>
		<title>Eclipse is running in a JRE, but a JDK is required</title>
		<link>http://rajibinfo.wordpress.com/2009/01/16/eclipse-is-running-in-a-jre-but-a-jdk-is-required/</link>
		<comments>http://rajibinfo.wordpress.com/2009/01/16/eclipse-is-running-in-a-jre-but-a-jdk-is-required/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 17:55:46 +0000</pubDate>
		<dc:creator>rajibinfo</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[but a JDK is required]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[Eclipse problem]]></category>
		<category><![CDATA[running in a JRE]]></category>

		<guid isPermaLink="false">http://rajibinfo.wordpress.com/?p=116</guid>
		<description><![CDATA[i got this problem - &#8220;Eclipse is running in a JRE, but a JDK is required Some Maven plugins may not work when importing projects or updating source folders.&#8221; I put the java home as C:\Program Files\Java\jdk1.5.0_05 and path &#8211; C:\Program Files\Java\jdk1.5.0_05\bin but i got this problem. let me say how i solve it - [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rajibinfo.wordpress.com&amp;blog=5932016&amp;post=116&amp;subd=rajibinfo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>i got this problem -</p>
<p><strong>&#8220;Eclipse is running in a JRE, but a JDK is required<br />
Some Maven plugins may not work when importing projects or updating source folders.&#8221;</strong></p>
<p>I put the java home as C:\Program Files\Java\jdk1.5.0_05</p>
<p>and path &#8211; C:\Program Files\Java\jdk1.5.0_05\bin</p>
<p>but i got this problem. let me say how i solve it -</p>
<p>open eclipse.ini from eclipse folder. put this line</p>
<p>-vm<br />
C:\Program Files\Java\jdk1.5.0_05\bin\javaw.exe</p>
<p>so the total file looks-</p>
<p>-showsplash<br />
org.eclipse.platform<br />
&#8211;launcher.XXMaxPermSize<br />
256M<br />
-framework<br />
plugins\org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar<br />
-vm<br />
C:\Program Files\Java\jdk1.5.0_05\bin\javaw.exe<br />
-vmargs<br />
-Dosgi.requiredJavaVersion=1.5<br />
-Xms40m<br />
-Xmx512m</p>
<p>2nd way solution -</p>
<p>create a bat file under the eclipse folder and put this line</p>
<p>eclipse.exe  -vm &#8220;C:\Program Files\Java\jdk1.5.0_05\bin\javaw.exe&#8221;</p>
<p>save this file.  use this file for opening eclipse.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rajibinfo.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rajibinfo.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rajibinfo.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rajibinfo.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rajibinfo.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rajibinfo.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rajibinfo.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rajibinfo.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rajibinfo.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rajibinfo.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rajibinfo.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rajibinfo.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rajibinfo.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rajibinfo.wordpress.com/116/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rajibinfo.wordpress.com&amp;blog=5932016&amp;post=116&amp;subd=rajibinfo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rajibinfo.wordpress.com/2009/01/16/eclipse-is-running-in-a-jre-but-a-jdk-is-required/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8907817131aa8e4a6ee143a4f20c7b9d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rajibinfo</media:title>
		</media:content>
	</item>
		<item>
		<title>Fast file copy and move by java</title>
		<link>http://rajibinfo.wordpress.com/2009/01/11/fast-file-copy-and-move-by-java/</link>
		<comments>http://rajibinfo.wordpress.com/2009/01/11/fast-file-copy-and-move-by-java/#comments</comments>
		<pubDate>Sun, 11 Jan 2009 06:13:10 +0000</pubDate>
		<dc:creator>rajibinfo</dc:creator>
				<category><![CDATA[Basic]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[fast file copy]]></category>
		<category><![CDATA[fast file move]]></category>
		<category><![CDATA[file copy]]></category>
		<category><![CDATA[file move]]></category>
		<category><![CDATA[file rename]]></category>
		<category><![CDATA[file write]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[java file util]]></category>
		<category><![CDATA[move]]></category>
		<category><![CDATA[rename]]></category>

		<guid isPermaLink="false">http://rajibinfo.wordpress.com/?p=109</guid>
		<description><![CDATA[The following method does very fast file copy from one location to another location. public boolean copyTo(File source, File destination) { try { FileInputStream fis = new FileInputStream(source); FileOutputStream fos = new FileOutputStream(destination); byte []buf = new byte[4096]; int loaded = 0; while ((loaded = fis.read(buf)) &#62; 0 ) { fos.write(buf, 0, loaded); } fis.close(); [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rajibinfo.wordpress.com&amp;blog=5932016&amp;post=109&amp;subd=rajibinfo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following method does very fast file copy from one location to another location.</p>
<p>public boolean copyTo(File source, File destination) {<br />
try {<br />
FileInputStream fis = new FileInputStream(source);<br />
FileOutputStream fos = new FileOutputStream(destination);</p>
<p>byte []buf = new byte[4096];<br />
int loaded = 0;<br />
while ((loaded = fis.read(buf)) &gt; 0 ) {<br />
fos.write(buf, 0, loaded);<br />
}<br />
fis.close();<br />
fos.close();<br />
} catch (IOException e) {<br />
e.printStackTrace();<br />
return false;<br />
}<br />
return true;<br />
}</p>
<p>Here i used 4096 byte buffer thats the key for fast copy.this value is optimize value from from different tested values.</p>
<p>The following method does very fast file move from one location to another location.</p>
<p>public boolean moveTo(File source, File destination) {<br />
boolean isRenamed;<br />
if(isPathExists(destination.getAbsolutePath())){<br />
destination.delete();<br />
}</p>
<p>isRenamed = source.renameTo(destination);<br />
if(!isRenamed){<br />
copyTo(source,destination);<br />
source.delete();<br />
}<br />
return isRenamed;</p>
<p>}</p>
<p>public boolean isPathExists(String path){<br />
File location = new File(path);<br />
return location.exists();<br />
}</p>
<p>The key of fast moving is the rename function.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rajibinfo.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rajibinfo.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rajibinfo.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rajibinfo.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rajibinfo.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rajibinfo.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rajibinfo.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rajibinfo.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rajibinfo.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rajibinfo.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rajibinfo.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rajibinfo.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rajibinfo.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rajibinfo.wordpress.com/109/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rajibinfo.wordpress.com&amp;blog=5932016&amp;post=109&amp;subd=rajibinfo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rajibinfo.wordpress.com/2009/01/11/fast-file-copy-and-move-by-java/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8907817131aa8e4a6ee143a4f20c7b9d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rajibinfo</media:title>
		</media:content>
	</item>
		<item>
		<title>remove &lt;p&gt; &lt;/p&gt; from TinyMCE editor content value</title>
		<link>http://rajibinfo.wordpress.com/2009/01/11/remove-from-tinymce-editor/</link>
		<comments>http://rajibinfo.wordpress.com/2009/01/11/remove-from-tinymce-editor/#comments</comments>
		<pubDate>Sun, 11 Jan 2009 05:44:52 +0000</pubDate>
		<dc:creator>rajibinfo</dc:creator>
				<category><![CDATA[TinyMCE]]></category>
		<category><![CDATA[TinyMCE editor]]></category>
		<category><![CDATA[remove tag]]></category>
		<category><![CDATA[Tin]]></category>
		<category><![CDATA[remove <p> </p>]]></category>

		<guid isPermaLink="false">http://rajibinfo.wordpress.com/?p=99</guid>
		<description><![CDATA[I have described at my another blog how to set up TinyMCE editor to any application. To get/set the content of editor use this function V3 or later : text = tinyMCE.activeEditor.getContent() // for get tinyMCE.activeEditor.setContent(text) // for set older version: text = tinyMCE.getInstanceById(’txtNote’).getBody().innerHTML // get tinyMCE.getInstanceById(’txtNote’).getBody().innerHTML = text //set but current version has one [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rajibinfo.wordpress.com&amp;blog=5932016&amp;post=99&amp;subd=rajibinfo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have described at my another <a title="Rajib Blog-&gt; Setup TInyMCE editor" href="../2009/01/10/setup-tinymce-editor/" target="_blank">blog</a> how to set up TinyMCE editor to any application. To get/set the content of editor use this function</p>
<p>V3 or later :</p>
<p>text = tinyMCE.activeEditor.getContent() // for get</p>
<p>tinyMCE.activeEditor.setContent(text) // for set</p>
<p>older version:</p>
<p>text = tinyMCE.getInstanceById(’txtNote’).getBody().innerHTML // get</p>
<p>tinyMCE.getInstanceById(’txtNote’).getBody().innerHTML = text //set</p>
<p>but current version has one problem that is every time it add &lt;p&gt; at beginning and &lt;/p&gt; at ending. thats why i have created one method that return the exact content.</p>
<p>function tinyMCE_getContent(txtAreaId) { //strips html tags leaving plain text<br />
var content = tinyMCE.get(txtAreaId).getContent();<br />
var re = /(&lt;([^&gt;]+)&gt;)/ig ; //strip all tags<br />
plaintext = content.replace(re, &#8220;&#8221;);<br />
return plaintext;<br />
}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rajibinfo.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rajibinfo.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rajibinfo.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rajibinfo.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rajibinfo.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rajibinfo.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rajibinfo.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rajibinfo.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rajibinfo.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rajibinfo.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rajibinfo.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rajibinfo.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rajibinfo.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rajibinfo.wordpress.com/99/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rajibinfo.wordpress.com&amp;blog=5932016&amp;post=99&amp;subd=rajibinfo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rajibinfo.wordpress.com/2009/01/11/remove-from-tinymce-editor/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8907817131aa8e4a6ee143a4f20c7b9d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rajibinfo</media:title>
		</media:content>
	</item>
		<item>
		<title>Show word count, remaining char, adding additional event&#8217;s function for TinyMCE editor</title>
		<link>http://rajibinfo.wordpress.com/2009/01/11/show-word-count-remaining-char-adding-additional-events-function-for-tinymce-editor/</link>
		<comments>http://rajibinfo.wordpress.com/2009/01/11/show-word-count-remaining-char-adding-additional-events-function-for-tinymce-editor/#comments</comments>
		<pubDate>Sun, 11 Jan 2009 05:22:07 +0000</pubDate>
		<dc:creator>rajibinfo</dc:creator>
				<category><![CDATA[TinyMCE]]></category>
		<category><![CDATA[TinyMCE editor]]></category>
		<category><![CDATA[word count]]></category>
		<category><![CDATA[remaining character]]></category>
		<category><![CDATA[TinyMCE editor event]]></category>

		<guid isPermaLink="false">http://rajibinfo.wordpress.com/?p=90</guid>
		<description><![CDATA[I have described at my another blog how to set up TinyMCE editor to any application. I added some functions that shows the char remaining values in the initTinyMCE.js file. if you want to add some other function you can do that the same way.the function is - setup :function(ed) { /*ed.onClick.add(function(ed, e){ alert(&#8216;click&#8217;);   });  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rajibinfo.wordpress.com&amp;blog=5932016&amp;post=90&amp;subd=rajibinfo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have described at my another <a title="Rajib Blog-&gt; Setup TInyMCE editor" href="http://rajibinfo.wordpress.com/2009/01/10/setup-tinymce-editor/" target="_blank">blog</a> how to set up TinyMCE editor to any application. <a rel="attachment wp-att-92" href="http://rajibinfo.wordpress.com/2009/01/11/show-word-count-remaining-char-adding-additional-events-function-for-tinymce-editor/charcount1/"><img class="alignright size-full wp-image-92" title="charcount1" src="http://rajibinfo.files.wordpress.com/2009/01/charcount1.jpg?w=408&#038;h=158" alt="charcount1" width="408" height="158" /></a>I added some functions that shows the char remaining values in the initTinyMCE.js file. if you want to add some other function you can do that the same way.the function is -</p>
<p>setup :function(ed) {<br />
/*ed.onClick.add(function(ed, e){ alert(&#8216;click&#8217;);   });  */<br />
ed.onBeforeSetContent.add(function(ed, o) {<br />
// o.content = o.content.replace(/&amp;lt;p&amp;gt;/i, &#8220;&#8221;);<br />
// o.content = o.content.replace(&#8216;&amp;lt;/p&amp;gt;&#8217;, &#8220;&#8221;);<br />
var strip = (tinyMCE.activeEditor.getContent()).replace(/(&lt;([^&gt;]+)&gt;)/ig,&#8221;"); ///remove &lt;p&gt; and &lt;/p&gt;<br />
var text = strip.split(&#8216; &#8216;).length + &#8221; Words, &#8221; +  strip.length + &#8221; Characters. You have &#8221; +(characterLimit-strip.length)+&#8221; Chracter remaining.&#8221;;<br />
tinymce.DOM.setHTML(tinymce.DOM.get(tinyMCE.activeEditor.id + &#8216;_path_row&#8217;), text); //_path_row is used for showing text at status bar of editor<br />
}<br />
);</p>
<p>ed.onKeyUp.add(function(ed, e) {<br />
var strip = (tinyMCE.activeEditor.getContent()).replace(/(&lt;([^&gt;]+)&gt;)/ig,&#8221;");<br />
var text = strip.split(&#8216; &#8216;).length + &#8221; Words, &#8221; +  strip.length + &#8221; Characters. You have &#8221; +(characterLimit-strip.length)+&#8221; Chracter remaining.&#8221;;<br />
tinymce.DOM.setHTML(tinymce.DOM.get(tinyMCE.activeEditor.id + &#8216;_path_row&#8217;), text);<br />
if(strip.length &gt; characterLimit){<br />
strip = strip.substring(0,characterLimit);<br />
tinyMCE.execCommand(&#8216;mceSetContent&#8217;,false,strip);<br />
alert(&#8220;The length of your message is &#8220;+strip.length +&#8221; the max num of characters \n allowed for this text Area is &#8220;+characterLimit);<br />
}<br />
});</p>
<p>}</p>
<p>This new version (3+) introduce tinyMCE.activeEditor.getContent() function for getting the content value. for old version use &#8211; tinyMCE.getInstanceById(&#8216;txaMainline&#8217;).getBody().innerHTML</p>
<p>tinymce.DOM.setHTML(tinymce.DOM.get(tinyMCE.activeEditor.id + &#8216;_path_row&#8217;), text); is used for setting message at the editor status bar.</p>
<p>tinyMCE.execCommand(&#8216;mceSetContent&#8217;,false,strip); is used for dynamically set the new value. when editor exceed the max value, the value from zero to max char is set to the content.</p>
<p>so the full text of initTinyMCE.js is</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212; initTinyMCE.js<br />
var characterLimit = 2000;<br />
tinyMCE.init({<br />
theme : &#8220;advanced&#8221;,<br />
mode : &#8220;textareas&#8221;,<br />
plugins : &#8220;searchreplace,print,paste&#8221;,<br />
entity_encoding:&#8221;named&#8221;,<br />
entities : &#8220;&amp;quot;,34,&amp;nbsp;,160,&amp;amp;,38,&amp;cent;,162,&amp;euro;,8364,&amp;pound;,163,&amp;yen;,165,&amp;copy;,169,&amp;reg;,174,&amp;trade;,8482,&amp;permil;,8240,&amp;lt;,60,&amp;gt;,62,&amp;le;,8804,&amp;ge;,8805,&amp;deg;,176,&amp;minus;,8722&#8243;,<br />
theme_advanced_buttons1 : &#8220;print,search,replace,separator,undo,redo&#8221;,<br />
theme_advanced_buttons2: &#8220;&#8221;,<br />
theme_advanced_buttons3 : &#8220;&#8221;,<br />
theme_advanced_toolbar_location : &#8220;top&#8221;,<br />
theme_advanced_toolbar_align : &#8220;left&#8221;,<br />
theme_advanced_path_location : &#8220;bottom&#8221;,<br />
extended_valid_elements : &#8220;a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]&#8220;,<br />
theme_advanced_resize_horizontal : true,<br />
theme_advanced_resizing : true,<br />
nonbreaking_force_tab : false,<br />
apply_source_formatting : false,<br />
width : 400,<br />
debug : false,<br />
//handle_event_callback : &#8220;myHandleEvent&#8221;,<br />
cleanup : true,<br />
theme_advanced_path : false,<br />
setup :function(ed) {<br />
/*ed.onClick.add(function(ed, e){ alert(&#8216;click&#8217;);   });  */<br />
ed.onBeforeSetContent.add(function(ed, o) {<br />
// o.content = o.content.replace(/&amp;lt;p&amp;gt;/i, &#8220;&#8221;);<br />
// o.content = o.content.replace(&#8216;&amp;lt;/p&amp;gt;&#8217;, &#8220;&#8221;);<br />
var strip = (tinyMCE.activeEditor.getContent()).replace(/(&lt;([^&gt;]+)&gt;)/ig,&#8221;");<br />
var text = strip.split(&#8216; &#8216;).length + &#8221; Words, &#8221; +  strip.length + &#8221; Characters. You have &#8221; +(characterLimit-strip.length)+&#8221; Chracter remaining.&#8221;;<br />
tinymce.DOM.setHTML(tinymce.DOM.get(tinyMCE.activeEditor.id + &#8216;_path_row&#8217;), text);<br />
}<br />
);</p>
<p>ed.onKeyUp.add(function(ed, e) {<br />
var strip = (tinyMCE.activeEditor.getContent()).replace(/(&lt;([^&gt;]+)&gt;)/ig,&#8221;");<br />
var text = strip.split(&#8216; &#8216;).length + &#8221; Words, &#8221; +  strip.length + &#8221; Characters. You have &#8221; +(characterLimit-strip.length)+&#8221; Chracter remaining.&#8221;;<br />
tinymce.DOM.setHTML(tinymce.DOM.get(tinyMCE.activeEditor.id + &#8216;_path_row&#8217;), text);<br />
if(strip.length &gt; characterLimit){<br />
strip = strip.substring(0,characterLimit);<br />
tinyMCE.execCommand(&#8216;mceSetContent&#8217;,false,strip);<br />
alert(&#8220;The length of your message is &#8220;+strip.length +&#8221; the max num of characters \n allowed for this text Area is &#8220;+characterLimit);<br />
}<br />
});<br />
}</p>
<p>});</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rajibinfo.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rajibinfo.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rajibinfo.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rajibinfo.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rajibinfo.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rajibinfo.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rajibinfo.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rajibinfo.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rajibinfo.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rajibinfo.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rajibinfo.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rajibinfo.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rajibinfo.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rajibinfo.wordpress.com/90/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rajibinfo.wordpress.com&amp;blog=5932016&amp;post=90&amp;subd=rajibinfo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rajibinfo.wordpress.com/2009/01/11/show-word-count-remaining-char-adding-additional-events-function-for-tinymce-editor/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8907817131aa8e4a6ee143a4f20c7b9d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rajibinfo</media:title>
		</media:content>

		<media:content url="http://rajibinfo.files.wordpress.com/2009/01/charcount1.jpg" medium="image">
			<media:title type="html">charcount1</media:title>
		</media:content>
	</item>
		<item>
		<title>Setup TinyMCE Editor</title>
		<link>http://rajibinfo.wordpress.com/2009/01/10/setup-tinymce-editor/</link>
		<comments>http://rajibinfo.wordpress.com/2009/01/10/setup-tinymce-editor/#comments</comments>
		<pubDate>Sun, 11 Jan 2009 03:54:27 +0000</pubDate>
		<dc:creator>rajibinfo</dc:creator>
				<category><![CDATA[TinyMCE]]></category>
		<category><![CDATA[setup TinyMCE]]></category>
		<category><![CDATA[TinyMCE editor]]></category>
		<category><![CDATA[Javascript HTML WYSIWYG]]></category>
		<category><![CDATA[WYSIWYG]]></category>

		<guid isPermaLink="false">http://rajibinfo.wordpress.com/?p=75</guid>
		<description><![CDATA[TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor. I used here 3.2.1.1 version.lets see how add this editor to an application. first download it and unzipped it and put it in your web application&#8217;s js folder. so the folder structure looks - I used one configaration file that initialize the TinyMCE editor. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rajibinfo.wordpress.com&amp;blog=5932016&amp;post=75&amp;subd=rajibinfo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a title="Rajib Blog-&gt; TinyMCE Editor download" href="http://tinymce.moxiecode.com/index.php" target="_blank">TinyMCE</a> is a platform independent web based Javascript HTML WYSIWYG editor. I used here 3.2.1.1 version.lets see how add this editor to an application. first download it and unzipped it and put it in your web application&#8217;s js folder. so the folder structure looks -</p>
<p><a rel="attachment wp-att-77" href="http://rajibinfo.wordpress.com/2009/01/10/setup-tinymce-editor/folderstruc1/"><img class="aligncenter size-full wp-image-77" title="folderstruc1" src="http://rajibinfo.files.wordpress.com/2009/01/folderstruc1.jpg?w=450&#038;h=96" alt="folderstruc1" width="450" height="96" /></a></p>
<p>I used one configaration file that initialize the TinyMCE editor. this file name is initTinyMCE.js. put this folder into \webapp\js\tiny_mce folder.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;  initTinyMCE.js</p>
<p>tinyMCE.init({<br />
theme : &#8220;advanced&#8221;,<br />
mode : &#8220;textareas&#8221;,<br />
plugins : &#8220;searchreplace,print,paste&#8221;,<br />
entity_encoding:&#8221;named&#8221;,<br />
entities : &#8220;&amp;quot;,34,&amp;nbsp;,160,&amp;amp;,38,&amp;cent;,162,&amp;euro;,8364,&amp;pound;,163,&amp;yen;,165,&amp;copy;,169,&amp;reg;,174,&amp;trade;,8482,&amp;permil;,8240,&amp;lt;,60,&amp;gt;,62,&amp;le;,8804,&amp;ge;,8805,&amp;deg;,176,&amp;minus;,8722&#8243;,<br />
theme_advanced_buttons1 : &#8220;print,search,replace,separator,undo,redo&#8221;,<br />
theme_advanced_buttons2: &#8220;&#8221;,<br />
theme_advanced_buttons3 : &#8220;&#8221;,<br />
theme_advanced_toolbar_location : &#8220;top&#8221;,<br />
theme_advanced_toolbar_align : &#8220;left&#8221;,<br />
theme_advanced_path_location : &#8220;bottom&#8221;,<br />
extended_valid_elements : &#8220;a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]&#8220;,<br />
theme_advanced_resize_horizontal : true,<br />
theme_advanced_resizing : true,<br />
nonbreaking_force_tab : false,<br />
apply_source_formatting : false,<br />
width : 300,<br />
debug : false,<br />
//handle_event_callback : &#8220;myHandleEvent&#8221;,<br />
cleanup : true,<br />
theme_advanced_path : false,<br />
});</p>
<p>here i used entities value so that it returns the actual character. there are so many plugins and button i used only some plugins of them. the &#8216;TinyMCE test.html&#8217; looks like -</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; TinyMCE Test.html</p>
<p>&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Strict//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&#8221;&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;meta content=&#8221;text/html; charset=ISO-8859-1&#8243; http-equiv=&#8221;content-type&#8221;&gt;<br />
&lt;title&gt;TinyMCE Test&lt;/title&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;<br />
&lt;script type=&#8221;text/javascript&#8221; src=&#8221;js/tiny_mce/tiny_mce.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script type=&#8221;text/javascript&#8221; src=&#8221;js/tiny_mce/initTinyMCE.js&#8221;&gt;&lt;/script&gt;</p>
<p>&lt;table width=&#8221;100%&#8221;&gt;<br />
&lt;tr&gt;<br />
&lt;td align=&#8221;center&#8221;&gt;<br />
&lt;textarea id=&#8221;txtNote1&#8243; name=&#8221;txtNote1&#8243; rows=&#8221;7&#8243; cols=&#8221;10&#8243; &gt;<br />
This is Text1.<br />
&lt;/textarea&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;<br />
&amp;nbsp;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td align=&#8221;center&#8221;&gt;<br />
&lt;textarea id=&#8221;txtNote2&#8243; name=&#8221;txtNote2&#8243; rows=&#8221;7&#8243; cols=&#8221;10&#8243; &gt;<br />
This is Text2.<br />
&lt;/textarea&gt;<br />
&lt;/td&gt;<br />
&lt;/tr&gt;</p>
<p>&lt;/table&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>the TinyMCE test.html page looks like -</p>
<p><a rel="attachment wp-att-78" href="http://rajibinfo.wordpress.com/?attachment_id=78"></a><a rel="attachment wp-att-81" href="http://rajibinfo.wordpress.com/2009/01/10/setup-tinymce-editor/tinymce-test1/"><img class="aligncenter size-full wp-image-81" title="tinymce-test1" src="http://rajibinfo.files.wordpress.com/2009/01/tinymce-test1.jpg?w=450&#038;h=394" alt="tinymce-test1" width="450" height="394" /></a><br />
Thanks</p>
<p>Rajib</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rajibinfo.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rajibinfo.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rajibinfo.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rajibinfo.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rajibinfo.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rajibinfo.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rajibinfo.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rajibinfo.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rajibinfo.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rajibinfo.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rajibinfo.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rajibinfo.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rajibinfo.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rajibinfo.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rajibinfo.wordpress.com&amp;blog=5932016&amp;post=75&amp;subd=rajibinfo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rajibinfo.wordpress.com/2009/01/10/setup-tinymce-editor/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8907817131aa8e4a6ee143a4f20c7b9d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rajibinfo</media:title>
		</media:content>

		<media:content url="http://rajibinfo.files.wordpress.com/2009/01/folderstruc1.jpg" medium="image">
			<media:title type="html">folderstruc1</media:title>
		</media:content>

		<media:content url="http://rajibinfo.files.wordpress.com/2009/01/tinymce-test1.jpg" medium="image">
			<media:title type="html">tinymce-test1</media:title>
		</media:content>
	</item>
	</channel>
</rss>
