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

<channel>
	<title>JSP, Tomcat, JDBC, Projects, Example, Program</title>
	<atom:link href="http://www.easywayserver.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.easywayserver.com/blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 02 Sep 2010 13:23:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>jQuery Sorting Example</title>
		<link>http://www.easywayserver.com/blog/jquery-sorting-example/</link>
		<comments>http://www.easywayserver.com/blog/jquery-sorting-example/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 13:14:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=564</guid>
		<description><![CDATA[jQuery sorting in table is most easiest way to sort data in html table. jQuery table sorting work with tbody tag and thead tags. It does not need to refresh whole page to load data from database.
The most usable jquery sorting plugins are 

1. tablesorter
2. DataTables

1. Table Sorter
Demo
Download
http://tablesorter.com/docs/#Download
2. DataTables
Demo
Download Source Code
http://www.datatables.net/download
Related Posts:Top 10 jQuery Examples [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjquery-sorting-example%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjquery-sorting-example%2F" height="61" width="51" /></a></div><p>jQuery sorting in table is most easiest way to sort data in html table. jQuery table sorting work with tbody tag and thead tags. It does not need to refresh whole page to load data from database.<br />
The most usable jquery sorting plugins are </p>
<ul>
<li>1. <a href="http://tablesorter.com/">tablesorter</a></li>
<li>2. <a href="http://www.datatables.net/">DataTables</a></li>
</ul>
<p><strong>1. Table Sorter</strong><br />
<a href="http://tablesorter.com/docs/#Demo">Demo</a><br />
<div class="wp-caption aligncenter" style="width: 610px"><img alt="jQuery Table sorting" src="http://www.easywayserver.com/images/jquerysort/tablesort.jpg" title="jQuery Table sorting" width="600" height="198" /><p class="wp-caption-text">jQuery Table sorting</p></div></p>
<p>Download<br />
<a href="http://tablesorter.com/docs/#Download">http://tablesorter.com/docs/#Download</a><br />
<div class="wp-caption aligncenter" style="width: 610px"><img alt="Data Sorting in jQuery" src="http://www.easywayserver.com/images/jquerysort/datasort.jpg" title="Data Sorting in jQuery" width="600" height="254" /><p class="wp-caption-text">Data Sorting in jQuery</p></div></p>
<p><strong>2. DataTables</strong><br />
<a href="http://www.datatables.net/examples/basic_init/zero_config.html">Demo</a></p>
<p>Download Source Code<br />
<a href="http://www.datatables.net/download">http://www.datatables.net/download</a></p>
<div id="crp_related"><h3>Related Posts:</h3><ul style="list-style:disc;padding-left:20px"><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/top-10-jquery-examples-for-website/" rel="bookmark" class="crp_title">Top 10 jQuery Examples for Website</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-collections-framework/" rel="bookmark" class="crp_title">Java &#8211; Collections Framework</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/jquery-getting-more-power-over-ajax/" rel="bookmark" class="crp_title">jQuery getting more power over Ajax</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/sql-select-order-by-clause-keyword/" rel="bookmark" class="crp_title">SQL &#8211; Select Order by clause keyword</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-format-date-object-to-string/" rel="bookmark" class="crp_title">Java &#8211; Format Date Object to String</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/free-real-estate-source-code/" rel="bookmark" class="crp_title">Free Real Estate Source Code</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/jquery-sorting-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top 10 jQuery Examples for Website</title>
		<link>http://www.easywayserver.com/blog/top-10-jquery-examples-for-website/</link>
		<comments>http://www.easywayserver.com/blog/top-10-jquery-examples-for-website/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 08:59:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=538</guid>
		<description><![CDATA[jQuery is api which solve almost all problems which a programmer face to develop the application. jQuery comes with lot of ready to use example and plugins which can be used in application and get quick output with amazing effects.
I am giving you some of top example of jQuery which are most common use in [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Ftop-10-jquery-examples-for-website%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Ftop-10-jquery-examples-for-website%2F" height="61" width="51" /></a></div><p>jQuery is api which solve almost all problems which a programmer face to develop the application. jQuery comes with lot of ready to use example and plugins which can be used in application and get quick output with amazing effects.<br />
I am giving you some of top example of jQuery which are most common use in our applications.</p>
<p><strong>1. Tab </strong><br />
This is simple tab option with menu navigation in jQuery<br />
<div class="wp-caption aligncenter" style="width: 528px"><img alt="Tab Example" src="http://www.easywayserver.com/images/jquery/tab.jpg" title="Tab Example" width="518" height="282" /><p class="wp-caption-text">Tab Example</p></div><br />
Demo<br />
<a href="http://www.stilbuero.de/jquery/tabs_3/">http://www.stilbuero.de/jquery/tabs_3/</a><br />
<div class="wp-caption aligncenter" style="width: 636px"><img alt="Tab jQuery" src="http://www.easywayserver.com/images/jquery/tab2.jpg" title="Tab jQuery" width="626" height="162" /><p class="wp-caption-text">Tab jQuery</p></div><br />
Another tab example<br />
<a href="http://www.sunsean.com/idTabs/#t1">http://www.sunsean.com/idTabs/#t1</a></p>
<p>Browse Site Select a Tab<br />
<a href="http://nettuts.s3.amazonaws.com/001_Tabbed/site/jQuery.html#">http://nettuts.s3.amazonaws.com/001_Tabbed/site/jQuery.html#</a><br />
<img alt="" src="http://www.easywayserver.com/images/jquery/tab3.jpg" title="tab jquery example" class="aligncenter" width="319" height="365" /><br />
<a href="http://net.tutsplus.com/tutorials/html-css-techniques/how-to-create-a-slick-tabbed-content-area/">http://net.tutsplus.com/tutorials/html-css-techniques/how-to-create-a-slick-tabbed-content-area/</a></p>
<p>jQuery Tabbed Side Menu<br />
<img alt="" src="http://www.easywayserver.com/images/jquery/tab4.jpg" title="tab in jquery" class="aligncenter" width="250" height="231" /><br />
Demo<br />
<a href="http://www.queness.com/resources/html/tabmenu/jquery-tabbed-menu-queness.html">http://www.queness.com/resources/html/tabmenu/jquery-tabbed-menu-queness.html</a></p>
<p>download source code<br />
<a href="http://www.queness.com/post/106/jquery-tabbed-interfacetabbed-structure-menu-tutorial">http://www.queness.com/post/106/jquery-tabbed-interfacetabbed-structure-menu-tutorial</a></p>
<p>Menu navigation<br />
Drop down menu<br />
<div class="wp-caption aligncenter" style="width: 512px"><img alt="Drop Down menu" src="http://www.easywayserver.com/images/jquery/dropdown.jpg" title="Drop Down menu" width="502" height="168" /><p class="wp-caption-text">Drop Down menu</p></div><br />
<a href="http://designreviver.com/tutorials/jquery-css-example-dropdown-menu/">http://designreviver.com/tutorials/jquery-css-example-dropdown-menu/</a></p>
<p>Top navigation through jQuery<br />
<a href="http://www.jankoatwarpspeed.com/post/2009/01/19/Create-Vimeo-like-top-navigation.aspx">http://www.jankoatwarpspeed.com/post/2009/01/19/Create-Vimeo-like-top-navigation.aspx</a></p>
<p>Demo<br />
<div class="wp-caption aligncenter" style="width: 628px"><img alt="Menu navigation drop down" src="http://www.easywayserver.com/images/jquery/menudrop.jpg" title="Menu navigation drop down" width="618" height="190" /><p class="wp-caption-text">Menu navigation drop down</p></div><br />
<a href="http://www.jankoatwarpspeed.com/examples/vimeo_navigation/">http://www.jankoatwarpspeed.com/examples/vimeo_navigation/</a></p>
<p>Other menu bar<br />
<div class="wp-caption aligncenter" style="width: 506px"><img alt="Fancy jQuery Dropdown Menu" src="http://www.easywayserver.com/images/jquery/menudrop1.jpg" title="Fancy Drop Menu" width="496" height="233" /><p class="wp-caption-text">Fancy jQuery Dropdown Menu</p></div><br />
<a href="http://apycom.com/">http://apycom.com/</a></p>
<p>Floating menu jQuery &#038; CSS<br />
<a href="https://nettuts.s3.amazonaws.com/018_Floating_Menu/demo/dhtml_float_menu_final_nettut.html">https://nettuts.s3.amazonaws.com/018_Floating_Menu/demo/dhtml_float_menu_final_nettut.html</a></p>
<p>Drop down menu<br />
<div class="wp-caption aligncenter" style="width: 651px"><img alt="Sexy jQuery Dropdown menu" src="http://www.easywayserver.com/images/jquery/menudrop2.jpg" title="Sexy Dropdown menu" width="641" height="222" /><p class="wp-caption-text">Sexy jQuery Dropdown menu</p></div><br />
<a href="http://www.sohtanaka.com/web-design/examples/drop-down-menu/#">http://www.sohtanaka.com/web-design/examples/drop-down-menu/#</a></p>
<p><strong>2. jQuery Cycle Plugin</strong><br />
This example scroll images in cycle and move image next to next.<br />
<div class="wp-caption aligncenter" style="width: 538px"><img alt="jQuery Image cycle" src="http://www.easywayserver.com/images/jquery/cycle1.jpg" title="jQuery Image cycle" width="528" height="256" /><p class="wp-caption-text">jQuery Image cycle</p></div><br />
<a href="http://www.malsup.com/jquery/cycle/int2.html">http://www.malsup.com/jquery/cycle/int2.html</a></p>
<p><strong>3. Riding carousels with jQuery</strong><br />
This jQuery plugin for controlling a list of items in horizontal or vertical order, and move images in horizontal side.<br />
<div class="wp-caption aligncenter" style="width: 366px"><img alt="Slider Cycle in jQuery" src="http://www.easywayserver.com/images/jquery/sliderimage.jpg" title="Slider Cycle in jQuery" width="356" height="137" /><p class="wp-caption-text">Slider Cycle in jQuery</p></div><br />
<a href="http://sorgalla.com/jcarousel/">http://sorgalla.com/jcarousel/</a></p>
<p><strong>4. Zooming images</strong><br />
JQZoom allows you to realize a small magnifier window close to the image or images on your web page easily.<br />
<a href="http://www.mind-projects.it/jqzoom_v10">http://www.mind-projects.it/jqzoom_v10</a><br />
<div class="wp-caption aligncenter" style="width: 518px"><img alt="Zooming effect in jQuery" src="http://www.easywayserver.com/images/jquery/zooming.jpg" title="Zooming effect in jQuery" width="508" height="218" /><p class="wp-caption-text">Zooming effect in jQuery</p></div><br />
<a href="http://www.mind-projects.it/projects/jqzoom/">http://www.mind-projects.it/projects/jqzoom/</a></p>
<p><strong>5. jQuery Autocomplete</strong><br />
This example of jQuery is used to complete autocomplete in form field.<br />
<div class="wp-caption aligncenter" style="width: 224px"><img alt="Autocomplete jQuery Script" src="http://www.easywayserver.com/images/jquery/autocomplete1.jpg" title="Auto complete jQuery Script" width="214" height="196" /><p class="wp-caption-text">Autocomplete jQuery Script</p></div><br />
<a href="http://www.ajaxdaddy.com/demo-jquery-autocomplete.html">http://www.ajaxdaddy.com/demo-jquery-autocomplete.html</a></p>
<p>Another example<br />
<div class="wp-caption aligncenter" style="width: 379px"><img alt="jQuery Example of Autocomplete" src="http://www.easywayserver.com/images/jquery/autocomplete.jpg" title="jQuery Example of Autocomplete" width="369" height="77" /><p class="wp-caption-text">jQuery Example of Autocomplete</p></div><br />
<a href="http://docs.jquery.com/Plugins/Autocomplete">http://docs.jquery.com/Plugins/Autocomplete</a></p>
<p><strong>6. jQuery Form Example </strong><br />
This jQuery example field form field with predefined value in text field.<br />
<div class="wp-caption aligncenter" style="width: 340px"><img alt="Prefilled Value in form field by jQuery" src="http://www.easywayserver.com/images/jquery/prefilledvalue.jpg" title="Prefilled Value in form field" width="330" height="77" /><p class="wp-caption-text">Prefilled Value in form field by jQuery</p></div><br />
<a href="http://mucur.name/system/jquery_example/">http://mucur.name/system/jquery_example/</a></p>
<p><strong>7. Visual Lightbox &#8211; Create lightbox-style galleries and slideshows. jQuery LightBox Plugin.</strong><br />
<a href="http://plugins.jquery.com/project/VisualLightbox">http://plugins.jquery.com/project/VisualLightbox</a></p>
<p>Demo<br />
<img alt="Light box in jQuery" src="http://www.easywayserver.com/images/jquery/lightbox.jpg" title="Light box in jQuery"  /><br />
<a href="http://visuallightbox.com/demo/">http://visuallightbox.com/demo/</a></p>
<p>Lightbox gallery sample<br />
<a href="http://lightbox2.com/jquery-thickbox.html">http://lightbox2.com/jquery-thickbox.html</a></p>
<p><strong>8. Thick box jQuery Example</strong><br />
<img alt="jQuery thickbox example" src="http://www.easywayserver.com/images/jquery/thickbox.jpg" title="jQuery thickbox example"  /><br />
<a href="http://jquery.com/demo/thickbox/">http://jquery.com/demo/thickbox/</a></p>
<p>Colorbox example<br />
Demo<br />
<a href="http://colorpowered.com/colorbox/core/example1/index.html">http://colorpowered.com/colorbox/core/example1/index.html</a></p>
<p>Code<br />
<a href="http://colorpowered.com/colorbox/">http://colorpowered.com/colorbox/</a></p>
<p>Dialog box<br />
Demo<br />
<div class="wp-caption aligncenter" style="width: 491px"><img alt="jQuery dialogbox example" src="http://www.easywayserver.com/images/jquery/dialogbox.jpg" title="jQuery dialogbox example" width="481" height="259" /><p class="wp-caption-text">jQuery dialogbox example</p></div><br />
<a href="http://jqueryui.com/demos/dialog/">http://jqueryui.com/demos/dialog/</a></p>
<p><strong>9. Tooltip  jQuery example</strong><br />
<div class="wp-caption aligncenter" style="width: 302px"><img alt="jQuery tooltips Example" src="http://www.easywayserver.com/images/jquery/tooltips.jpg" title="jQuery tooltips Example" width="292" height="189" /><p class="wp-caption-text">jQuery tooltips Example</p></div><br />
<a href="http://3nhanced.com/examples/tooltip/">http://3nhanced.com/examples/tooltip/</a></p>
<p><a href="http://net.tutsplus.com/tutorials/javascript-ajax/build-a-better-tooltip-with-jquery-awesomeness/">http://net.tutsplus.com/tutorials/javascript-ajax/build-a-better-tooltip-with-jquery-awesomeness/</a></p>
<p>Another example<br />
<div class="wp-caption aligncenter" style="width: 365px"><img alt="jQuery Fancy tooltip Example" src="http://www.easywayserver.com/images/jquery/tooltips1.jpg" title="jQuery Fancy tooltip Example" width="355" height="288" /><p class="wp-caption-text">jQuery Fancy tooltip Example</p></div><br />
<a href="http://flowplayer.org/tools/tooltip/index.html">http://flowplayer.org/tools/tooltip/index.html</a></p>
<p><strong>10. Datepicker</strong><br />
<div class="wp-caption aligncenter" style="width: 268px"><img alt="Datepicker jQuery Example" src="http://www.easywayserver.com/images/jquery/date.jpg" title="Datepicker jQuery Example" width="258" height="227" /><p class="wp-caption-text">Datepicker jQuery Example</p></div><br />
Demo<br />
<a href="http://jqueryui.com/demos/datepicker/">http://jqueryui.com/demos/datepicker/</a></p>
<div id="crp_related"><h3>Related Posts:</h3><ul style="list-style:disc;padding-left:20px"><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/jquery-sorting-example/" rel="bookmark" class="crp_title">jQuery Sorting Example</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/jquery-getting-more-power-over-ajax/" rel="bookmark" class="crp_title">jQuery getting more power over Ajax</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-collections-framework/" rel="bookmark" class="crp_title">Java &#8211; Collections Framework</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/how-to-find-out-font/" rel="bookmark" class="crp_title">How to find out font</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/include-file-in-html/" rel="bookmark" class="crp_title">Include File in HTML</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/make-your-own-website/" rel="bookmark" class="crp_title">Make Your Own Website</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/top-10-jquery-examples-for-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java &#8211; Substring Example</title>
		<link>http://www.easywayserver.com/blog/java-substring-example/</link>
		<comments>http://www.easywayserver.com/blog/java-substring-example/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 17:06:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[String]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=535</guid>
		<description><![CDATA[Example of  substring() in java 

public class SubStringJavaExample {

    public static void main(String[] args) {

        String string = &#34;Java Substring&#34;;

        // simple
        String string1 = string.substring(2);

     [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-substring-example%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-substring-example%2F" height="61" width="51" /></a></div><p>Example of  substring() in java </p>
<div class="cde">
<pre><span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>class</span> SubStringJavaExample <span style='color:#800080; '>{</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>static</span> <span style='color:#bb7977; '>void</span> main<span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>[</span><span style='color:#808030; '>]</span> args<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>

        <span style='color:#bb7977; font-weight:bold; '>String</span> string <span style='color:#808030; '>=</span> <span style='color:#0000e6; '>&quot;Java Substring&quot;</span><span style='color:#800080; '>;</span>

        <span style='color:#696969; '>// simple</span>
        <span style='color:#bb7977; font-weight:bold; '>String</span> string1 <span style='color:#808030; '>=</span> string<span style='color:#808030; '>.</span>substring<span style='color:#808030; '>(</span><span style='color:#008c00; '>2</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

        <span style='color:#bb7977; font-weight:bold; '>System</span><span style='color:#808030; '>.</span>out<span style='color:#808030; '>.</span>println<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;Output1 :&quot;</span><span style='color:#808030; '>+</span>string1<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

        <span style='color:#696969; '>// advance</span>
        <span style='color:#bb7977; font-weight:bold; '>String</span> string2 <span style='color:#808030; '>=</span> string<span style='color:#808030; '>.</span>substring<span style='color:#808030; '>(</span><span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span><span style='color:#008c00; '>8</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

        <span style='color:#bb7977; font-weight:bold; '>System</span><span style='color:#808030; '>.</span>out<span style='color:#808030; '>.</span>println<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;Output2 :&quot;</span><span style='color:#808030; '>+</span>string2<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
Output1 :va Substring<br />
Output2 :va Sub
</p>
</div>
<div id="crp_related"><h3>Related Posts:</h3><ul style="list-style:disc;padding-left:20px"><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-%e2%80%93-string-substring-example-strings-substring-program/" rel="bookmark" class="crp_title">Java – String substring() Example, Strings substring() program</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-substring-function/" rel="bookmark" class="crp_title">JavaScript &#8211; substring function</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-stringbuffer-substring-example-stringbuffer-substring-program/" rel="bookmark" class="crp_title">Java &#8211; StringBuffer substring() Example, StringBuffer substring() program</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-stringbuffer-append-example-stringbuffer-append-program/" rel="bookmark" class="crp_title">Java &#8211; StringBuffer Append() Example, StringBuffer Append() program</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-string-intern-example-strings-intern-program/" rel="bookmark" class="crp_title">Java &#8211; String intern() Example, Strings intern() program</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-how-to-combine-two-strings/" rel="bookmark" class="crp_title">Java &#8211; How to combine two Strings, add Strings</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/java-substring-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java &#8211; Default Capacity of Vector</title>
		<link>http://www.easywayserver.com/blog/java-default-capacity-of-vector/</link>
		<comments>http://www.easywayserver.com/blog/java-default-capacity-of-vector/#comments</comments>
		<pubDate>Mon, 31 May 2010 04:18:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=533</guid>
		<description><![CDATA[Find default capacity of Vector in JAVA
In this example, We will find default capacity of vector in collections in java. 


import java.util.Vector;
public class VectorSize {

	public static void main(String[] args) {

		Vector vc=new Vector();

		System.out.println("Default Capacity of Vector is :"+vc.capacity());

		vc.add("first element");

		System.out.println("Default Capacity of Vector after one element :"+vc.capacity());

		vc.add("second element");

		System.out.println("Default Capacity of Vector after two elements :"+vc.capacity());
	}
}


Output


Default Capacity of [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-default-capacity-of-vector%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-default-capacity-of-vector%2F" height="61" width="51" /></a></div><p><strong>Find default capacity of Vector in JAVA</strong></p>
<p>In this example, We will find default capacity of vector in collections in java. </p>
<div class="cde cdesize">
<pre>
import java.util.Vector;
public class VectorSize {

	public static void main(String[] args) {

		Vector<String> vc=new Vector<String>();

		System.out.println("Default Capacity of Vector is :"+vc.capacity());

		vc.add("first element");

		System.out.println("Default Capacity of Vector after one element :"+vc.capacity());

		vc.add("second element");

		System.out.println("Default Capacity of Vector after two elements :"+vc.capacity());
	}
}
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
Default Capacity of Vector is :10<br />
Default Capacity of Vector after one element :10<br />
Default Capacity of Vector after two elements :10
</p>
</div>
<div id="crp_related"><h3>Related Posts:</h3><ul style="list-style:disc;padding-left:20px"><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-stringbuffer-capacity-example-stringbuffer-capacity-program/" rel="bookmark" class="crp_title">Java &#8211; StringBuffer capacity() Example, StringBuffer capacity() program</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-remove-elements-in-vector/" rel="bookmark" class="crp_title">Java &#8211; Remove elements in Vector</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-how-to-get-size-of-vector/" rel="bookmark" class="crp_title">Java &#8211; How to get size of Vector</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-vector-example/" rel="bookmark" class="crp_title">Java &#8211; Vector Example</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-how-to-clear-vector/" rel="bookmark" class="crp_title">Java &#8211; How to Clear Vector</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-how-to-convert-array-to-string/" rel="bookmark" class="crp_title">Java &#8211; How to convert Array to String</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/java-default-capacity-of-vector/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java &#8211; Remove Duplicate Object in Collection</title>
		<link>http://www.easywayserver.com/blog/java-remove-duplicate-object-in-collection/</link>
		<comments>http://www.easywayserver.com/blog/java-remove-duplicate-object-in-collection/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 03:21:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=531</guid>
		<description><![CDATA[Removing Duplicate Object from Array through collection framework
In this example, We will find and search duplicate elements in array and remove that object from collections in java. 
Duplicate object in array will explain how to remove in java J2EE program and application.

import java.util.*;

public class RemoveDuplicate {

    public static void main(String[] args) {
 [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-remove-duplicate-object-in-collection%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-remove-duplicate-object-in-collection%2F" height="61" width="51" /></a></div><p><strong>Removing Duplicate Object from Array through collection framework</strong></p>
<p>In this example, We will find and search duplicate elements in array and remove that object from collections in java. </p>
<p>Duplicate object in array will explain how to remove in java J2EE program and application.</p>
<div class="cde cdesize">
<pre><span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> java</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>util</span><span style='color:#808030; '>.</span><span style='color:#800000; font-weight:bold; '>*</span><span style='color:#800080; '>;</span>

<span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>class</span> RemoveDuplicate <span style='color:#800080; '>{</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>static</span> <span style='color:#bb7977; '>void</span> main<span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>[</span><span style='color:#808030; '>]</span> args<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
          ArrayList<span style='color:#808030; '>&lt;</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>></span> arrayList1 <span style='color:#808030; '>=</span> <span style='color:#800000; font-weight:bold; '>new</span> ArrayList<span style='color:#808030; '>&lt;</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>></span><span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

          arrayList1<span style='color:#808030; '>.</span>add<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;A&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
          arrayList1<span style='color:#808030; '>.</span>add<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;A&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
          arrayList1<span style='color:#808030; '>.</span>add<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;B&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
          arrayList1<span style='color:#808030; '>.</span>add<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;B&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
          arrayList1<span style='color:#808030; '>.</span>add<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;B&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
          arrayList1<span style='color:#808030; '>.</span>add<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;C&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

          <span style='color:#800000; font-weight:bold; '>for</span> <span style='color:#808030; '>(</span><span style='color:#bb7977; '>int</span> i<span style='color:#808030; '>=</span><span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span> i<span style='color:#808030; '>&lt;</span> arrayList1<span style='color:#808030; '>.</span>size<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span> i<span style='color:#808030; '>+</span><span style='color:#808030; '>+</span><span style='color:#808030; '>)</span>
          <span style='color:#800080; '>{</span>
            <span style='color:#bb7977; font-weight:bold; '>System</span><span style='color:#808030; '>.</span>out<span style='color:#808030; '>.</span>println<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;Having Duplicate Objects :&quot;</span><span style='color:#808030; '>+</span>arrayList1<span style='color:#808030; '>.</span>get<span style='color:#808030; '>(</span>i<span style='color:#808030; '>)</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
          <span style='color:#800080; '>}</span> 

          Set<span style='color:#808030; '>&lt;</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>></span> s<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> TreeSet<span style='color:#808030; '>&lt;</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>></span><span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
          s<span style='color:#808030; '>.</span>addAll<span style='color:#808030; '>(</span>arrayList1<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

          Iterator it<span style='color:#808030; '>=</span>s<span style='color:#808030; '>.</span>iterator<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
          <span style='color:#800000; font-weight:bold; '>while</span> <span style='color:#808030; '>(</span>it<span style='color:#808030; '>.</span>hasNext<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span>
          <span style='color:#800080; '>{</span>
            <span style='color:#bb7977; font-weight:bold; '>System</span><span style='color:#808030; '>.</span>out<span style='color:#808030; '>.</span>println<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;No Duplicate :&quot;</span><span style='color:#808030; '>+</span><span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>)</span>it<span style='color:#808030; '>.</span>next<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
          <span style='color:#800080; '>}</span> 

    <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
Having Duplicate Objects :A<br />
Having Duplicate Objects :A<br />
Having Duplicate Objects :B<br />
Having Duplicate Objects :B<br />
Having Duplicate Objects :B<br />
Having Duplicate Objects :C<br />
No Duplicate :A<br />
No Duplicate :B<br />
No Duplicate :C
</p>
</div>
<div id="crp_related"><h3>Related Posts:</h3><ul style="list-style:disc;padding-left:20px"><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/sql-select-distinct-example-distinct-clause/" rel="bookmark" class="crp_title">SQL &#8211; Select distinct Example, distinct statement</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-hashset-example/" rel="bookmark" class="crp_title">Java &#8211; HashSet Example</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/how-to-serializable-object-in-java/" rel="bookmark" class="crp_title">How to serializable object in java</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-remove-element-in-arraylist/" rel="bookmark" class="crp_title">Java &#8211; Remove Element in ArrayList</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-remove-elements-in-list/" rel="bookmark" class="crp_title">Java &#8211; Remove elements in List</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-remove-elements-in-treeset/" rel="bookmark" class="crp_title">Java &#8211; Remove elements in TreeSet</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/java-remove-duplicate-object-in-collection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multithreading in Java</title>
		<link>http://www.easywayserver.com/blog/multithreading-in-java/</link>
		<comments>http://www.easywayserver.com/blog/multithreading-in-java/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 16:56:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/multithreading-in-java/</guid>
		<description><![CDATA[Multithreading in Java
In this multithreading programming example, We will use Runnable interface to implements in main class to run multithreading in java. 
Multi threading programming will explain how to use Runnable Interface in java J2EE program and application.
1. MainThreadClass.java

public class MainThreadClass {

    public static void main(String[] args) {

     [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fmultithreading-in-java%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fmultithreading-in-java%2F" height="61" width="51" /></a></div><h1>Multithreading in Java</h1>
<p>In this multithreading programming example, We will use Runnable interface to implements in main class to run multithreading in java. </p>
<p>Multi threading programming will explain how to use Runnable Interface in java J2EE program and application.</p>
<p>1. <strong>MainThreadClass.java</strong></p>
<div class="cde cdesize">
<pre><span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>class</span> MainThreadClass <span style='color:#800080; '>{</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>static</span> <span style='color:#bb7977; '>void</span> main<span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>[</span><span style='color:#808030; '>]</span> args<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>

        ThreadClass tc1<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> ThreadClass<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;Run&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        ThreadClass tc2<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> ThreadClass<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;Thread&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

        <span style='color:#bb7977; font-weight:bold; '>Thread</span> t1<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>Thread</span><span style='color:#808030; '>(</span>tc1<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        <span style='color:#bb7977; font-weight:bold; '>Thread</span> t2<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> <span style='color:#bb7977; font-weight:bold; '>Thread</span><span style='color:#808030; '>(</span>tc2<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

        t1<span style='color:#808030; '>.</span>start<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        t2<span style='color:#808030; '>.</span>start<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
</div>
<p>2. <strong>ThreadClass.java</strong></p>
<div class="cde cdesize">
<pre><span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>class</span> ThreadClass <span style='color:#800000; font-weight:bold; '>implements</span> Runnable<span style='color:#800080; '>{</span>

    <span style='color:#bb7977; font-weight:bold; '>String</span> msg<span style='color:#800080; '>;</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#bb7977; '>void</span> run<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
    <span style='color:#800080; '>{</span>
        <span style='color:#800000; font-weight:bold; '>for</span><span style='color:#808030; '>(</span><span style='color:#bb7977; '>int</span> i<span style='color:#808030; '>=</span><span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>i<span style='color:#808030; '>&lt;</span><span style='color:#808030; '>=</span><span style='color:#008c00; '>5</span><span style='color:#800080; '>;</span>i<span style='color:#808030; '>+</span><span style='color:#808030; '>+</span><span style='color:#808030; '>)</span>
        <span style='color:#800080; '>{</span>
            <span style='color:#bb7977; font-weight:bold; '>System</span><span style='color:#808030; '>.</span>out<span style='color:#808030; '>.</span>println<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;Run method: &quot;</span><span style='color:#808030; '>+</span>msg<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        <span style='color:#800080; '>}</span>
    <span style='color:#800080; '>}</span>

    ThreadClass<span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span> mg<span style='color:#808030; '>)</span>
    <span style='color:#800080; '>{</span>
        msg<span style='color:#808030; '>=</span>mg<span style='color:#800080; '>;</span>
    <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
Run method: Run<br />
Run method: Run<br />
Run method: Run<br />
Run method: Thread<br />
Run method: Thread<br />
Run method: Thread<br />
Run method: Run<br />
Run method: Run<br />
Run method: Thread<br />
Run method: Thread<br />
Run method: Run<br />
Run method: Thread
</p>
</div>
<div id="crp_related"><h3>Related Posts:</h3><ul style="list-style:disc;padding-left:20px"><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-multithreading-example-with-thread-class/" rel="bookmark" class="crp_title">Java &#8211; Multithreading Example with Thread Class</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/how-to-make-jsp-thread-safe/" rel="bookmark" class="crp_title">How to make JSP Thread Safe</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/singlethreadmodel-in-servlet/" rel="bookmark" class="crp_title">SingleThreadModel in Servlet</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-stringbuilder-example-stringbuilder-program/" rel="bookmark" class="crp_title">Java &#8211; StringBuilder Example, StringBuilder Program</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-stringbuffer-example-stringbuffer-program/" rel="bookmark" class="crp_title">Java &#8211; StringBuffer Example, StringBuffer program</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/way-to-start-java-programming/" rel="bookmark" class="crp_title">Way to start Java Programming</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/multithreading-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java &#8211; Multithreading Example with Thread Class</title>
		<link>http://www.easywayserver.com/blog/java-multithreading-example-with-thread-class/</link>
		<comments>http://www.easywayserver.com/blog/java-multithreading-example-with-thread-class/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 16:32:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=528</guid>
		<description><![CDATA[Java MultiThreading Example 
In this multithreading example, We will use Thread class to extends in main class to run multithreading in java. 
Multi threading will explain how to use Thread class in java J2EE program and code.
1. MainThreadClass.java

public class MainThreadClass {

    public static void main(String[] args) {

      [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-multithreading-example-with-thread-class%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fjava-multithreading-example-with-thread-class%2F" height="61" width="51" /></a></div><p><strong>Java MultiThreading Example</strong> </p>
<p>In this multithreading example, We will use Thread class to extends in main class to run multithreading in java. </p>
<p>Multi threading will explain how to use Thread class in java J2EE program and code.</p>
<p>1. <strong>MainThreadClass.java</strong></p>
<div class="cde cdesize">
<pre><span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>class</span> MainThreadClass <span style='color:#800080; '>{</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>static</span> <span style='color:#bb7977; '>void</span> main<span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span><span style='color:#808030; '>[</span><span style='color:#808030; '>]</span> args<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>

        ThreadClass dt1<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> ThreadClass<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;Run&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        ThreadClass dt2<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> ThreadClass<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;Thread&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

        dt1<span style='color:#808030; '>.</span>start<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span> <span style='color:#696969; '>// this will start thread of object 1</span>
        dt2<span style='color:#808030; '>.</span>start<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span> <span style='color:#696969; '>// this will start thread of object 2</span>
    <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
</div>
<p>2. <strong>ThreadClass.java</strong></p>
<div class="cde cdesize">
<pre><span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>class</span> ThreadClass <span style='color:#800000; font-weight:bold; '>extends</span> Thread<span style='color:#800080; '>{</span>

    <span style='color:#bb7977; font-weight:bold; '>String</span> msg<span style='color:#800080; '>;</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#bb7977; '>void</span> run<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
    <span style='color:#800080; '>{</span>
        <span style='color:#800000; font-weight:bold; '>for</span><span style='color:#808030; '>(</span><span style='color:#bb7977; '>int</span> i<span style='color:#808030; '>=</span><span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>i<span style='color:#808030; '>&lt;</span><span style='color:#808030; '>=</span><span style='color:#008c00; '>5</span><span style='color:#800080; '>;</span>i<span style='color:#808030; '>+</span><span style='color:#808030; '>+</span><span style='color:#808030; '>)</span>
        <span style='color:#800080; '>{</span>
            <span style='color:#bb7977; font-weight:bold; '>System</span><span style='color:#808030; '>.</span>out<span style='color:#808030; '>.</span>println<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;Run method: &quot;</span><span style='color:#808030; '>+</span>msg<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        <span style='color:#800080; '>}</span>
    <span style='color:#800080; '>}</span>

    ThreadClass<span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span> mg<span style='color:#808030; '>)</span>
    <span style='color:#800080; '>{</span>
        msg<span style='color:#808030; '>=</span>mg<span style='color:#800080; '>;</span>
    <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
</div>
<p><strong>Output</strong></p>
<div class="cde">
<p class="op">
Run method: Run<br />
Run method: Run<br />
Run method: Run<br />
Run method: Thread<br />
Run method: Run<br />
Run method: Run<br />
Run method: Thread<br />
Run method: Thread<br />
Run method: Thread<br />
Run method: Thread<br />
Run method: Run<br />
Run method: Thread
</p>
</div>
<p>Multithreading can be used in print commands</p>
<div id="crp_related"><h3>Related Posts:</h3><ul style="list-style:disc;padding-left:20px"><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/multithreading-in-java/" rel="bookmark" class="crp_title">Multithreading in Java</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/how-to-make-jsp-thread-safe/" rel="bookmark" class="crp_title">How to make JSP Thread Safe</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/singlethreadmodel-in-servlet/" rel="bookmark" class="crp_title">SingleThreadModel in Servlet</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-stringbuilder-example-stringbuilder-program/" rel="bookmark" class="crp_title">Java &#8211; StringBuilder Example, StringBuilder Program</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-stringbuffer-example-stringbuffer-program/" rel="bookmark" class="crp_title">Java &#8211; StringBuffer Example, StringBuffer program</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/way-to-start-java-programming/" rel="bookmark" class="crp_title">Way to start Java Programming</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/java-multithreading-example-with-thread-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Struts iterator database fetching example</title>
		<link>http://www.easywayserver.com/blog/struts-iterator-database-fetching-example/</link>
		<comments>http://www.easywayserver.com/blog/struts-iterator-database-fetching-example/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 06:55:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Struts]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=526</guid>
		<description><![CDATA[Struts Iterator database fetching Example 
In this struts example, we have to fetch and retrieve records from database and show on JSP page and submit to action class. 
Struts tutorials will explain how to use struts in logic Iterator tag in JSP to get data from database.
1. index.jsp

&#60;%@ page language=&#34;java&#34; pageEncoding=&#34;ISO-8859-1&#34;%>
&#60;%@ taglib uri=&#34;http://struts.apache.org/tags-bean&#34; prefix=&#34;bean&#34; %>
&#60;%@ [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fstruts-iterator-database-fetching-example%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fstruts-iterator-database-fetching-example%2F" height="61" width="51" /></a></div><p><strong>Struts Iterator database fetching Example</strong> </p>
<p>In this struts example, we have to fetch and retrieve records from database and show on JSP page and submit to action class. </p>
<p>Struts tutorials will explain how to use struts in logic Iterator tag in JSP to get data from database.</p>
<p>1. <strong>index.jsp</strong></p>
<div class="cde cdesize">
<pre><span style='color:#a65700;'>&lt;%@</span><span style='color:#000000;'> page language=</span><span style='color:#0000e6;'>&quot;java&quot;</span><span style='color:#000000;'> pageEncoding=</span><span style='color:#0000e6;'>&quot;ISO-8859-1&quot;</span><span style='color:#a65700;'>%></span>
<span style='color:#a65700;'>&lt;%@</span><span style='color:#000000;'> taglib uri=</span><span style='color:#0000e6;'>&quot;</span><span style='color:#5555dd;'>http://struts.apache.org/tags-bean</span><span style='color:#0000e6;'>&quot;</span><span style='color:#000000;'> prefix=</span><span style='color:#0000e6;'>&quot;bean&quot;</span><span style='color:#000000;'> </span><span style='color:#a65700;'>%></span>
<span style='color:#a65700;'>&lt;%@</span><span style='color:#000000;'> taglib uri=</span><span style='color:#0000e6;'>&quot;</span><span style='color:#5555dd;'>http://struts.apache.org/tags-html</span><span style='color:#0000e6;'>&quot;</span><span style='color:#000000;'> prefix=</span><span style='color:#0000e6;'>&quot;html&quot;</span><span style='color:#000000;'> </span><span style='color:#a65700;'>%></span>
<span style='color:#a65700;'>&lt;%@</span><span style='color:#000000;'> taglib uri=</span><span style='color:#0000e6;'>&quot;</span><span style='color:#5555dd;'>http://struts.apache.org/tags-logic</span><span style='color:#0000e6;'>&quot;</span><span style='color:#000000;'> prefix=</span><span style='color:#0000e6;'>&quot;logic&quot;</span><span style='color:#000000;'> </span><span style='color:#a65700;'>%></span>
<span style='color:#a65700;'>&lt;%@</span><span style='color:#000000;'> taglib uri=</span><span style='color:#0000e6;'>&quot;</span><span style='color:#5555dd;'>http://struts.apache.org/tags-tiles</span><span style='color:#0000e6;'>&quot;</span><span style='color:#000000;'> prefix=</span><span style='color:#0000e6;'>&quot;tiles&quot;</span><span style='color:#000000;'> </span><span style='color:#a65700;'>%></span>

<span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#5f5035; '>:</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
  <span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>
    <span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>Struts<span style='color:#008c00; '>.</span>jsp<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>title</span><span style='color:#a65700; '>></span>
  <span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>head</span><span style='color:#a65700; '>></span>

  <span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
  <span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#5f5035; '>:</span><span style='color:#800000; font-weight:bold; '>form</span><span style='color:#274796; '> </span><span style='color:#074726; '>action</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;/searchUser&quot;</span><span style='color:#a65700; '>></span>

   <span style='color:#a65700; '>&lt;</span><span style='color:#5f5035; '>logic:iterate</span><span style='color:#274796; '> </span><span style='color:#074726; '>id</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;loop&quot;</span><span style='color:#274796; '>  </span><span style='color:#074726; '>name</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;UserForm&quot;</span><span style='color:#274796; '> property</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;ListUser&quot;</span><span style='color:#274796; '> </span><span style='color:#a65700; '>></span>
       <span style='color:#a65700; '>&lt;</span><span style='color:#5f5035; '>bean:write</span><span style='color:#274796; '> </span><span style='color:#074726; '>name</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;loop&quot;</span><span style='color:#274796; '> property</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;userName&quot;</span><span style='color:#a65700; '>/></span><span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>br</span><span style='color:#a65700; '>></span>
       <span style='color:#a65700; '>&lt;</span><span style='color:#5f5035; '>bean:write</span><span style='color:#274796; '> </span><span style='color:#074726; '>name</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;loop&quot;</span><span style='color:#274796; '> property</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;deptName&quot;</span><span style='color:#a65700; '>/></span><span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>br</span><span style='color:#a65700; '>></span><span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>br</span><span style='color:#a65700; '>></span>
   <span style='color:#a65700; '>&lt;/</span><span style='color:#5f5035; '>logic:iterate</span><span style='color:#a65700; '>></span>

   <span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#5f5035; '>:</span><span style='color:#800000; font-weight:bold; '>form</span><span style='color:#a65700; '>></span>
  <span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>body</span><span style='color:#a65700; '>></span>
<span style='color:#a65700; '>&lt;/</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#5f5035; '>:</span><span style='color:#800000; font-weight:bold; '>html</span><span style='color:#a65700; '>></span>
</pre>
</div>
<p>2. <strong>struts-config.xml</strong></p>
<div class="cde cdesize">
<pre><span style='color:#a65700; '>&lt;</span><span style='color:#5f5035; '>form-beans</span><span style='color:#a65700; '>></span>
     <span style='color:#a65700; '>&lt;</span><span style='color:#5f5035; '>form-bean</span> <span style='color:#274796; '>name</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;</span><span style='color:#0000e6; '>UserForm</span><span style='color:#0000e6; '>&quot;</span> <span style='color:#274796; '>type</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;</span><span style='color:#0000e6; '>org.apache.struts.validator.DynaValidatorForm</span><span style='color:#0000e6; '>&quot;</span><span style='color:#a65700; '>></span>
         <span style='color:#a65700; '>&lt;</span><span style='color:#5f5035; '>form-property</span> <span style='color:#274796; '>name</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;</span><span style='color:#0000e6; '>userId</span><span style='color:#0000e6; '>&quot;</span> <span style='color:#274796; '>type</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;</span><span style='color:#0000e6; '>java.lang.Integer</span><span style='color:#0000e6; '>&quot;</span> <span style='color:#a65700; '>/></span>
         <span style='color:#a65700; '>&lt;</span><span style='color:#5f5035; '>form-property</span> <span style='color:#274796; '>name</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;</span><span style='color:#0000e6; '>userName</span><span style='color:#0000e6; '>&quot;</span> <span style='color:#274796; '>type</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;</span><span style='color:#0000e6; '>java.lang.String</span><span style='color:#0000e6; '>&quot;</span> <span style='color:#a65700; '>/></span>
         <span style='color:#a65700; '>&lt;</span><span style='color:#5f5035; '>form-property</span> <span style='color:#274796; '>name</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;</span><span style='color:#0000e6; '>deptName</span><span style='color:#0000e6; '>&quot;</span> <span style='color:#274796; '>type</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;</span><span style='color:#0000e6; '>java.lang.String</span><span style='color:#0000e6; '>&quot;</span> <span style='color:#a65700; '>/></span>
         <span style='color:#a65700; '>&lt;</span><span style='color:#5f5035; '>form-property</span> <span style='color:#274796; '>name</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;</span><span style='color:#0000e6; '>ListUser</span><span style='color:#0000e6; '>&quot;</span> <span style='color:#274796; '>type</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;</span><span style='color:#0000e6; '>java.util.ArrayList</span><span style='color:#0000e6; '>&quot;</span> <span style='color:#a65700; '>/></span>
    <span style='color:#a65700; '>&lt;/</span><span style='color:#5f5035; '>form-bean</span><span style='color:#a65700; '>></span>
  <span style='color:#a65700; '>&lt;/</span><span style='color:#5f5035; '>form-beans</span><span style='color:#a65700; '>></span>

  <span style='color:#a65700; '>&lt;</span><span style='color:#5f5035; '>action-mappings</span><span style='color:#a65700; '>></span>
        <span style='color:#a65700; '>&lt;</span><span style='color:#5f5035; '>action</span>
            <span style='color:#274796; '>path</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;</span><span style='color:#0000e6; '>/searchUser</span><span style='color:#0000e6; '>&quot;</span>
            <span style='color:#274796; '>type</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;</span><span style='color:#0000e6; '>com.UserSearchAction</span><span style='color:#0000e6; '>&quot;</span>
            <span style='color:#274796; '>name</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;</span><span style='color:#0000e6; '>UserForm</span><span style='color:#0000e6; '>&quot;</span>
            <span style='color:#274796; '>scope</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;</span><span style='color:#0000e6; '>request</span><span style='color:#0000e6; '>&quot;</span>
            <span style='color:#274796; '>validate</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;</span><span style='color:#0000e6; '>false</span><span style='color:#0000e6; '>&quot;</span>
            <span style='color:#274796; '>input</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;</span><span style='color:#0000e6; '>/index.jsp</span><span style='color:#0000e6; '>&quot;</span><span style='color:#a65700; '>></span>
            <span style='color:#a65700; '>&lt;</span><span style='color:#5f5035; '>forward</span> <span style='color:#274796; '>name</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;</span><span style='color:#0000e6; '>success</span><span style='color:#0000e6; '>&quot;</span> <span style='color:#274796; '>path</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;</span><span style='color:#0000e6; '>/index.jsp</span><span style='color:#0000e6; '>&quot;</span><span style='color:#a65700; '>/></span>
           <span style='color:#a65700; '>&lt;/</span><span style='color:#5f5035; '>action</span><span style='color:#a65700; '>></span>
  <span style='color:#a65700; '>&lt;/</span><span style='color:#5f5035; '>action-mappings</span><span style='color:#a65700; '>></span>
</pre>
</div>
<p>3. <strong>UserSearchAction.java</strong></p>
<div class="cde cdesize">
<pre><span style='color:#800000; font-weight:bold; '>package</span><span style='color:#004a43; '> com</span><span style='color:#800080; '>;</span>

<span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> java</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>util</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>ArrayList</span><span style='color:#800080; '>;</span>

<span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> javax</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>servlet</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>http</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>HttpServletRequest</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> javax</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>servlet</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>http</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>HttpServletResponse</span><span style='color:#800080; '>;</span>

<span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> org</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>apache</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>struts</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>action</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>Action</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> org</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>apache</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>struts</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>action</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>ActionForm</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> org</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>apache</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>struts</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>action</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>ActionForward</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> org</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>apache</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>struts</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>action</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>ActionMapping</span><span style='color:#800080; '>;</span>
<span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> org</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>apache</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>struts</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>action</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>DynaActionForm</span><span style='color:#800080; '>;</span>

<span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>class</span> UserSearchAction <span style='color:#800000; font-weight:bold; '>extends</span> Action<span style='color:#800080; '>{</span>

     <span style='color:#800000; font-weight:bold; '>public</span> ActionForward execute<span style='color:#808030; '>(</span>
            ActionMapping mapping<span style='color:#808030; '>,</span>
            ActionForm form<span style='color:#808030; '>,</span>
            HttpServletRequest request<span style='color:#808030; '>,</span>
            HttpServletResponse response<span style='color:#808030; '>)</span> <span style='color:#800000; font-weight:bold; '>throws</span> <span style='color:#bb7977; font-weight:bold; '>Exception</span><span style='color:#800080; '>{</span>

         DynaActionForm userForm <span style='color:#808030; '>=</span> <span style='color:#808030; '>(</span>DynaActionForm<span style='color:#808030; '>)</span>form<span style='color:#800080; '>;</span>

         UserList ul<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> UserList<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
         ArrayList ar<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> ArrayList<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
         ar<span style='color:#808030; '>=</span>ul<span style='color:#808030; '>.</span>getUser<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

         userForm<span style='color:#808030; '>.</span>set<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;ListUser&quot;</span><span style='color:#808030; '>,</span> ar<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

         <span style='color:#800000; font-weight:bold; '>return</span> mapping<span style='color:#808030; '>.</span>findForward<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;success&quot;</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
     <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
</div>
<p>4. <strong>UserList.java</strong></p>
<div class="cde cdesize">
<pre><span style='color:#800000; font-weight:bold; '>package</span><span style='color:#004a43; '> com</span><span style='color:#800080; '>;</span>

<span style='color:#800000; font-weight:bold; '>import</span><span style='color:#004a43; '> java</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>util</span><span style='color:#808030; '>.</span><span style='color:#004a43; '>ArrayList</span><span style='color:#800080; '>;</span>

<span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>class</span> UserList <span style='color:#800000; font-weight:bold; '>extends</span> User<span style='color:#800080; '>{</span>
     <span style='color:#800000; font-weight:bold; '>public</span> ArrayList getUser<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>
     <span style='color:#800080; '>{</span>
        ArrayList<span style='color:#808030; '>&lt;</span>UserList<span style='color:#808030; '>></span> ar<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> ArrayList<span style='color:#808030; '>&lt;</span>UserList<span style='color:#808030; '>></span><span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span> 

        UserList ul<span style='color:#800080; '>;</span>

        <span style='color:#800000; font-weight:bold; '>for</span><span style='color:#808030; '>(</span><span style='color:#bb7977; '>int</span> i<span style='color:#808030; '>=</span><span style='color:#008c00; '>0</span><span style='color:#800080; '>;</span>i<span style='color:#808030; '>&lt;</span><span style='color:#808030; '>=</span><span style='color:#008c00; '>20</span><span style='color:#800080; '>;</span>i<span style='color:#808030; '>+</span><span style='color:#808030; '>+</span><span style='color:#808030; '>)</span>
        <span style='color:#800080; '>{</span>
            ul<span style='color:#808030; '>=</span><span style='color:#800000; font-weight:bold; '>new</span> UserList<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
            ul<span style='color:#808030; '>.</span>setUserId<span style='color:#808030; '>(</span>i<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
            ul<span style='color:#808030; '>.</span>setUserName<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;userName&quot;</span><span style='color:#808030; '>+</span>i<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
            ul<span style='color:#808030; '>.</span>setDeptName<span style='color:#808030; '>(</span><span style='color:#0000e6; '>&quot;Dept&quot;</span><span style='color:#808030; '>+</span>i<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
            ar<span style='color:#808030; '>.</span>add<span style='color:#808030; '>(</span>ul<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
        <span style='color:#800080; '>}</span>
        <span style='color:#800000; font-weight:bold; '>return</span> ar<span style='color:#800080; '>;</span>
     <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
</div>
<p>5. <strong>User.java</strong></p>
<div class="cde cdesize">
<pre><span style='color:#800000; font-weight:bold; '>package</span><span style='color:#004a43; '> com</span><span style='color:#800080; '>;</span>

<span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#800000; font-weight:bold; '>class</span> User <span style='color:#800080; '>{</span>
  <span style='color:#800000; font-weight:bold; '>private</span> <span style='color:#bb7977; '>int</span> userId<span style='color:#800080; '>;</span>
  <span style='color:#800000; font-weight:bold; '>private</span> <span style='color:#bb7977; font-weight:bold; '>String</span> userName<span style='color:#800080; '>;</span>
  <span style='color:#800000; font-weight:bold; '>private</span> <span style='color:#bb7977; font-weight:bold; '>String</span> deptName<span style='color:#800080; '>;</span>

    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#bb7977; font-weight:bold; '>String</span> getDeptName<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
        <span style='color:#800000; font-weight:bold; '>return</span> deptName<span style='color:#800080; '>;</span>
    <span style='color:#800080; '>}</span>
    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#bb7977; '>void</span> setDeptName<span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span> deptName<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
        <span style='color:#800000; font-weight:bold; '>this</span><span style='color:#808030; '>.</span>deptName <span style='color:#808030; '>=</span> deptName<span style='color:#800080; '>;</span>
    <span style='color:#800080; '>}</span>
    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#bb7977; '>int</span> getUserId<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
        <span style='color:#800000; font-weight:bold; '>return</span> userId<span style='color:#800080; '>;</span>
    <span style='color:#800080; '>}</span>
    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#bb7977; '>void</span> setUserId<span style='color:#808030; '>(</span><span style='color:#bb7977; '>int</span> userId<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
        <span style='color:#800000; font-weight:bold; '>this</span><span style='color:#808030; '>.</span>userId <span style='color:#808030; '>=</span> userId<span style='color:#800080; '>;</span>
    <span style='color:#800080; '>}</span>
    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#bb7977; font-weight:bold; '>String</span> getUserName<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
        <span style='color:#800000; font-weight:bold; '>return</span> userName<span style='color:#800080; '>;</span>
    <span style='color:#800080; '>}</span>
    <span style='color:#800000; font-weight:bold; '>public</span> <span style='color:#bb7977; '>void</span> setUserName<span style='color:#808030; '>(</span><span style='color:#bb7977; font-weight:bold; '>String</span> userName<span style='color:#808030; '>)</span> <span style='color:#800080; '>{</span>
        <span style='color:#800000; font-weight:bold; '>this</span><span style='color:#808030; '>.</span>userName <span style='color:#808030; '>=</span> userName<span style='color:#800080; '>;</span>
    <span style='color:#800080; '>}</span>
<span style='color:#800080; '>}</span>
</pre>
</div>
<p>&nbsp;</p>
<p>Run this on web browser <b>http://localhost:8080/struts/searchUser.do</b></p>
<p><a href="http://www.easywayserver.com/sourcecode/strutsiterator.zip">download source code of struts Iterator</a></p>
<div id="crp_related"><h3>Related Posts:</h3><ul style="list-style:disc;padding-left:20px"><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/struts-dynaform-validation/" rel="bookmark" class="crp_title">Struts &#8211; DynaForm validation</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/upload-file-in-struts/" rel="bookmark" class="crp_title">Upload file in struts</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/struts2-validation-example-struts-2-validation/" rel="bookmark" class="crp_title">Struts2 &#8211; Validation Example, Struts 2 Validation</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/java-read-xml-taglib-and-jstl-in-jsp/" rel="bookmark" class="crp_title">JAVA &#8211; Read XML Taglib and JSTL in JSP</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/struts2-example-struts2-tutorials-struts-program/" rel="bookmark" class="crp_title">Struts2 Example, Struts2 Tutorials, Struts Program</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/more-than-one-form-in-html-page/" rel="bookmark" class="crp_title">More than one form in HTML page</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/struts-iterator-database-fetching-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Struts2 &#8211; Submit tag example</title>
		<link>http://www.easywayserver.com/blog/struts2-submit-tag-example/</link>
		<comments>http://www.easywayserver.com/blog/struts2-submit-tag-example/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 07:04:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Struts]]></category>
		<category><![CDATA[struts2]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=524</guid>
		<description><![CDATA[Submit tag struts 2 example 
Submit tag is used to Submit form to server with input form values, send data to server.
Example will show you how to use Submit tag in struts2

&#60;s:submit key=&#34;Submit&#34; />



Related Posts:JavaScript – Submit is not a functionHow to Submit a Form Using JavaScriptMore than one form in HTML pageStruts2 &#8211; Input [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fstruts2-submit-tag-example%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fstruts2-submit-tag-example%2F" height="61" width="51" /></a></div><p><strong>Submit tag struts 2 example</strong> <br />
Submit tag is used to Submit form to server with input form values, send data to server.</p>
<p>Example will show you how to use Submit tag in struts2</p>
<div class="cde cdesize">
<pre><span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>s</span><span style='color:#5f5035; '>:</span><span style='color:#800000; font-weight:bold; '>submit</span><span style='color:#274796; '> key</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;Submit&quot;</span><span style='color:#274796; '> </span><span style='color:#a65700; '>/></span>
</pre>
</div>
<p><img src="http://www.easywayserver.com/images/struts2/submit.jpg"  border="0"/></p>
<div id="crp_related"><h3>Related Posts:</h3><ul style="list-style:disc;padding-left:20px"><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/javascript-%e2%80%93-submit-is-not-a-function/" rel="bookmark" class="crp_title">JavaScript – Submit is not a function</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/how-to-submit-a-form-using-javascript/" rel="bookmark" class="crp_title">How to Submit a Form Using JavaScript</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/more-than-one-form-in-html-page/" rel="bookmark" class="crp_title">More than one form in HTML page</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/struts2-input-text-tag-example/" rel="bookmark" class="crp_title">Struts2 &#8211; Input text tag example</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/struts2-password-input-tag-example/" rel="bookmark" class="crp_title">Struts2 &#8211; Password input tag example</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/struts2-textarea-tag-example/" rel="bookmark" class="crp_title">Struts2 &#8211; textarea tag example</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/struts2-submit-tag-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Struts2 &#8211; Password input tag example</title>
		<link>http://www.easywayserver.com/blog/struts2-password-input-tag-example/</link>
		<comments>http://www.easywayserver.com/blog/struts2-password-input-tag-example/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 06:52:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Struts]]></category>
		<category><![CDATA[struts2]]></category>

		<guid isPermaLink="false">http://www.easywayserver.com/blog/?p=522</guid>
		<description><![CDATA[Password tag struts 2 example 
Password tag is used to get password input from user, send data to server. Struts2 Password tag can get hidden character input data from user in browser.
Example will show you how to use Password tag in struts2

&#60;s:password key=&#34;txtpwd&#34; />



Related Posts:Struts2 &#8211; Input text tag examplePassword Field in HTMLStruts2 &#8211; textarea [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fstruts2-password-input-tag-example%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.easywayserver.com%2Fblog%2Fstruts2-password-input-tag-example%2F" height="61" width="51" /></a></div><p><strong>Password tag struts 2 example</strong> <br />
Password tag is used to get password input from user, send data to server. Struts2 Password tag can get hidden character input data from user in browser.</p>
<p>Example will show you how to use Password tag in struts2</p>
<div class="cde cdesize">
<pre><span style='color:#a65700; '>&lt;</span><span style='color:#800000; font-weight:bold; '>s</span><span style='color:#5f5035; '>:</span><span style='color:#800000; font-weight:bold; '>password</span><span style='color:#274796; '> key</span><span style='color:#808030; '>=</span><span style='color:#0000e6; '>&quot;txtpwd&quot;</span><span style='color:#274796; '> </span><span style='color:#a65700; '>/></span>
</pre>
</div>
<p><img src="http://www.easywayserver.com/images/struts2/password.jpg"  border="0"/></p>
<div id="crp_related"><h3>Related Posts:</h3><ul style="list-style:disc;padding-left:20px"><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/struts2-input-text-tag-example/" rel="bookmark" class="crp_title">Struts2 &#8211; Input text tag example</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/password-field-in-html/" rel="bookmark" class="crp_title">Password Field in HTML</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/struts2-textarea-tag-example/" rel="bookmark" class="crp_title">Struts2 &#8211; textarea tag example</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/struts2-validation-example-struts-2-validation/" rel="bookmark" class="crp_title">Struts2 &#8211; Validation Example, Struts 2 Validation</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/struts2-submit-tag-example/" rel="bookmark" class="crp_title">Struts2 &#8211; Submit tag example</a></li><li style="padding-left:8px"><a href="http://www.easywayserver.com/blog/struts2-example-struts2-tutorials-struts-program/" rel="bookmark" class="crp_title">Struts2 Example, Struts2 Tutorials, Struts Program</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.easywayserver.com/blog/struts2-password-input-tag-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
