<?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>SixJan</title>
	<atom:link href="http://sixjan.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sixjan.com</link>
	<description>knowing is half the battle</description>
	<lastBuildDate>Tue, 24 Jan 2012 07:24:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sixjan.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>SixJan</title>
		<link>http://sixjan.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sixjan.com/osd.xml" title="SixJan" />
	<atom:link rel='hub' href='http://sixjan.com/?pushpress=hub'/>
		<item>
		<title>Delegate in Ruby on Rails</title>
		<link>http://sixjan.com/2012/01/14/delegate-in-ruby-on-rails/</link>
		<comments>http://sixjan.com/2012/01/14/delegate-in-ruby-on-rails/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 09:15:27 +0000</pubDate>
		<dc:creator>Anand Muranal</dc:creator>
				<category><![CDATA[Ruby on Rails (RoR)]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[delegate]]></category>
		<category><![CDATA[ror]]></category>

		<guid isPermaLink="false">http://sixjan.com/?p=784</guid>
		<description><![CDATA[This is the technique where object expose some method or behavior which delegate take care of implementing that to an associated object. Example : There are two models User and Department. User belongs to department. class User belongs_to  :department delegate :name, :to =&#62; :department, :prefix =&#62; true, :allow_nil =&#62; true end class Department has_many  :users [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sixjan.com&amp;blog=791775&amp;post=784&amp;subd=anandmuranal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is the technique where object expose some method or behavior which delegate take care of implementing that to an associated object.</p>
<p>Example : There are two models User and Department. User belongs to department.</p>
<blockquote><p>class User</p>
<p style="padding-left:30px;">belongs_to  :department</p>
<p style="padding-left:30px;">delegate :name, :to =&gt; :department, :prefix =&gt; true, :allow_nil =&gt; true</p>
<p>end</p>
<p>class Department</p>
<p style="padding-left:30px;">has_many  :users</p>
<p>end</p></blockquote>
<p>If you want to access department name for an user</p>
<p style="padding-left:30px;">user.department_name</p>
<p><strong>Options for delegate</strong></p>
<p>:prefix =&gt; true</p>
<p style="padding-left:30px;">You have to call the method “name” by prefixing the model name as “user.department_name”</p>
<p>:prefix =&gt; “dept”</p>
<p style="padding-left:30px;">now you have to call as “user.dept_name”</p>
<p>:allow_nil =&gt; true</p>
<p style="padding-left:30px;">if there is no name then it will return nil. If you have not mentioned this option and name is not present then this method will give no method error</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anandmuranal.wordpress.com/784/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anandmuranal.wordpress.com/784/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anandmuranal.wordpress.com/784/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anandmuranal.wordpress.com/784/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/anandmuranal.wordpress.com/784/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/anandmuranal.wordpress.com/784/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/anandmuranal.wordpress.com/784/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/anandmuranal.wordpress.com/784/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anandmuranal.wordpress.com/784/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anandmuranal.wordpress.com/784/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anandmuranal.wordpress.com/784/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anandmuranal.wordpress.com/784/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anandmuranal.wordpress.com/784/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anandmuranal.wordpress.com/784/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sixjan.com&amp;blog=791775&amp;post=784&amp;subd=anandmuranal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sixjan.com/2012/01/14/delegate-in-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Anand M</media:title>
		</media:content>
	</item>
		<item>
		<title>Include Html file inside another Html file</title>
		<link>http://sixjan.com/2012/01/13/include-html-file-inside-another-html-file/</link>
		<comments>http://sixjan.com/2012/01/13/include-html-file-inside-another-html-file/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 07:31:26 +0000</pubDate>
		<dc:creator>Anand Muranal</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[html include in another html]]></category>

		<guid isPermaLink="false">http://sixjan.com/2012/01/13/include-html-file-inside-another-html-file/</guid>
		<description><![CDATA[To include the html content into another html file I have used java script. Below is the example where I have used header content and footer content into different file and called these two files into all files wherever header and footer requires. Main page content Content.html &#60;html&#62; &#60;body&#62; &#60;script type=&#8221;text/javascript&#8221; src=&#8221;header.js&#8221;&#62; &#60;/script&#62; &#60;p&#62; Content [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sixjan.com&amp;blog=791775&amp;post=767&amp;subd=anandmuranal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To include the html content into another html file I have used java script.<br />
Below is the example where I have used header content and footer content into different file<br />
and called these two files into all files wherever header and footer requires.</p>
<p>Main page content</p>
<p><strong>Content.html</strong></p>
<blockquote><p>&lt;html&gt;</p>
<p style="padding-left:30px;">&lt;body&gt;</p>
<p style="padding-left:60px;">&lt;script type=&#8221;text/javascript&#8221; src=&#8221;header.js&#8221;&gt; &lt;/script&gt;</p>
<p style="padding-left:60px;">&lt;p&gt;</p>
<p style="padding-left:90px;">Content of the page</p>
<p style="padding-left:60px;">&lt;/p&gt;</p>
<p style="padding-left:60px;">&lt;script type=&#8221;text/javascript&#8221; src=&#8221;footer.js&#8221;&gt; &lt;/script&gt;</p>
<p style="padding-left:30px;">&lt;/body&gt;</p>
<p>&lt;/html&gt;</p></blockquote>
<p><strong>header.js</strong> file content</p>
<blockquote><p>document.write(&#8220;&lt;h1&gt;Header&lt;/h1&gt;&#8221;);<br />
document.write(&#8220;&lt;h2&gt;Tag Line&lt;/h2&gt;&#8221;);</p></blockquote>
<p><strong>footer.js</strong> file content</p>
<blockquote><p>document.write(&#8220;&lt;h2&gt;Contact us&lt;/h2&gt;&#8221;);<br />
document.write(&#8220;&lt;h3&gt;9876543210&lt;/h3&gt;&#8221;);</p></blockquote>
<p><strong>Out put of content.html file in Browser</strong></p>
<blockquote><p>Header<br />
Tag Line</p>
<p>Content of the page in details</p>
<p>Contact us<br />
9876543210</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anandmuranal.wordpress.com/767/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anandmuranal.wordpress.com/767/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anandmuranal.wordpress.com/767/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anandmuranal.wordpress.com/767/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/anandmuranal.wordpress.com/767/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/anandmuranal.wordpress.com/767/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/anandmuranal.wordpress.com/767/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/anandmuranal.wordpress.com/767/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anandmuranal.wordpress.com/767/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anandmuranal.wordpress.com/767/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anandmuranal.wordpress.com/767/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anandmuranal.wordpress.com/767/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anandmuranal.wordpress.com/767/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anandmuranal.wordpress.com/767/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sixjan.com&amp;blog=791775&amp;post=767&amp;subd=anandmuranal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sixjan.com/2012/01/13/include-html-file-inside-another-html-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Anand M</media:title>
		</media:content>
	</item>
		<item>
		<title>Multiselector checkAll selects all options instead of filtered list</title>
		<link>http://sixjan.com/2011/11/01/multiselector-checkall-selects-all-options-instead-of-filtered-list/</link>
		<comments>http://sixjan.com/2011/11/01/multiselector-checkall-selects-all-options-instead-of-filtered-list/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 10:14:06 +0000</pubDate>
		<dc:creator>Anand Muranal</dc:creator>
				<category><![CDATA[Ruby on Rails (RoR)]]></category>
		<category><![CDATA[checkAll in multiselector]]></category>
		<category><![CDATA[multiselector]]></category>

		<guid isPermaLink="false">http://amcubes.com/?p=726</guid>
		<description><![CDATA[I am using multiselector and whenever I try to select all filtered result by clicking checkAll then it selects all options not only filter list but all. Example: I have list like abc1, abc2, abc3, xyz1, xyz2 and I filtered by “abc” text and I got three result abc1, abc2 and abc3 Then I clicked [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sixjan.com&amp;blog=791775&amp;post=726&amp;subd=anandmuranal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I am using multiselector and whenever I try to select all filtered result by clicking checkAll then it selects all options not only filter list but all.</p>
<p>Example: I have list like</p>
<p style="text-align:center;">abc1, abc2, abc3, xyz1, xyz2</p>
<p>and I filtered by “abc” text and I got three result abc1, abc2 and abc3</p>
<p>Then I clicked on checkAll link it shows it selected 3 options but it is selecting all 6 options, for this problem I have done general method and it is working fine</p>
<p>Added this function call in that html file</p>
<blockquote><p>&lt;script&gt;</p>
<p style="padding-left:30px;">$(document).ready(function() {</p>
<p style="padding-left:60px;">checkAllCorrection(&#8216;#selctboxid&#8217;);</p>
<p style="padding-left:30px;">});</p>
<p>&lt;/script&gt;</p></blockquote>
<p>General method in application.js file</p>
<blockquote><p>function checkAllCorrection(fieldName){</p>
<p>$(fieldName).bind(&#8220;multiselectcheckall&#8221;, function(event, ui){</p>
<p style="padding-left:30px;">    var checkedValueList = [];</p>
<p style="padding-left:30px;">    $(fieldName).multiselect(&#8220;getChecked&#8221;).each(function(){</p>
<p style="padding-left:30px;">         checkedValueList.push(this.value);</p>
<p style="padding-left:30px;">     });</p>
<p style="padding-left:30px;">    $(fieldName).multiselect(&#8220;refresh&#8221;);</p>
<p style="padding-left:30px;">    $(fieldName).multiselect(&#8216;widget&#8217;).find(&#8220;:checkbox&#8221;).each(</p>
<p style="padding-left:30px;">          function(){</p>
<p style="padding-left:30px;">               if(checkedValueList.indexOf(this.value) == -1</p>
<p style="padding-left:30px;">&amp;&amp; this.checked)        this.click();</p>
<p style="padding-left:30px;">           }</p>
<p style="padding-left:30px;">    );</p>
<p>    });</p>
<p>}</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anandmuranal.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anandmuranal.wordpress.com/726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anandmuranal.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anandmuranal.wordpress.com/726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/anandmuranal.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/anandmuranal.wordpress.com/726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/anandmuranal.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/anandmuranal.wordpress.com/726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anandmuranal.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anandmuranal.wordpress.com/726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anandmuranal.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anandmuranal.wordpress.com/726/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anandmuranal.wordpress.com/726/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anandmuranal.wordpress.com/726/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sixjan.com&amp;blog=791775&amp;post=726&amp;subd=anandmuranal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sixjan.com/2011/11/01/multiselector-checkall-selects-all-options-instead-of-filtered-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Anand M</media:title>
		</media:content>
	</item>
		<item>
		<title>Digital Signature</title>
		<link>http://sixjan.com/2011/04/08/digital-signature/</link>
		<comments>http://sixjan.com/2011/04/08/digital-signature/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 13:27:31 +0000</pubDate>
		<dc:creator>Anand Muranal</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[CAPICOM]]></category>
		<category><![CDATA[Certificate]]></category>
		<category><![CDATA[Digital certificate]]></category>
		<category><![CDATA[Digital signature]]></category>
		<category><![CDATA[Signer]]></category>

		<guid isPermaLink="false">http://amcubes.com/?p=682</guid>
		<description><![CDATA[Digital signature Digital signature algorithm is the one that makes the receiver believe that the message was sent by the claimed sender, and trust the message. There are different types of signing techniques for Example Text signer, Xml signer etc.. We used the XML Signer. First I will explain the signing process how it will [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sixjan.com&amp;blog=791775&amp;post=682&amp;subd=anandmuranal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Digital signature </strong></p>
<p>Digital signature algorithm is the one that makes the receiver believe that the message was sent by the claimed sender, and trust the message.</p>
<p>There are different types of signing techniques for Example Text signer, Xml signer etc.. We used the XML Signer. First I will explain the signing process how it will take place.</p>
<p>User will pass the Data along with the certificate and signing process will sign the Data using the certificate and pass the data with signature and certificate. We are calling this data as digitally signed Data. Receiver will separate the data and signature form the digitally signed data. And make another signature from that data and compare the both signature.</p>
<p><strong>CAPICOM</strong> is a discontinued ActiveX control created by Microsoft to help expose a select set of Microsoft Cryptographic Application Programming Interface (CryptoAPI) functions through Microsoft Component Object Model (COM). CAPICOM can be used to digitally sign data, inspect, verify and display their digital signature and/or digital certificate. CAPICOM Version 2.1.0.2, the latest and last version of CAPICOM, is officially supported on Windows Vista. We are using CAPICOM Version 2.1.0.2</p>
<p><a href="http://anandmuranal.files.wordpress.com/2011/04/verify.jpg"><img class="alignnone size-medium wp-image-684" title="verify" src="http://anandmuranal.files.wordpress.com/2011/04/verify.jpg?w=434&#038;h=292" alt="" width="434" height="292" /></a></p>
<p><strong>Signing Process</strong></p>
<ul>
<li>We are passing Data for signing and the certificate information.</li>
<li>CAPICOM will take the certificate details like Hash algorithm and apply that algorithm to data and get the Hash called it as Message Digest (MD).</li>
<li>Using this MD and primary key which is present in certificate, it will create the signature</li>
<li>It will integrate signature certificate and Data. This data is called digitally signed data.</li>
</ul>
<p><a href="http://anandmuranal.files.wordpress.com/2011/04/signer11.jpg"><img class="alignnone size-medium wp-image-731" title="signer1" src="http://anandmuranal.files.wordpress.com/2011/04/signer11.jpg?w=380&#038;h=250" alt="" width="380" height="250" /></a></p>
<p><strong>Verify Process</strong></p>
<ul>
<li>We are passing the digitally signed data for verification</li>
<li>It will separate the Data signature and certificate.</li>
<li>Using data it will create once again the hash (message Digest) let’s say MD1, using certificate primary key and hash algorithm.</li>
<li>It will get another MD using signature which is passed though digitally signed data, using local key of certificate. Let’s say this MD as MD2</li>
<li>For verifying the signing it will check the MD1 is equal to MD2 or not.</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anandmuranal.wordpress.com/682/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anandmuranal.wordpress.com/682/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anandmuranal.wordpress.com/682/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anandmuranal.wordpress.com/682/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/anandmuranal.wordpress.com/682/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/anandmuranal.wordpress.com/682/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/anandmuranal.wordpress.com/682/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/anandmuranal.wordpress.com/682/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anandmuranal.wordpress.com/682/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anandmuranal.wordpress.com/682/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anandmuranal.wordpress.com/682/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anandmuranal.wordpress.com/682/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anandmuranal.wordpress.com/682/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anandmuranal.wordpress.com/682/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sixjan.com&amp;blog=791775&amp;post=682&amp;subd=anandmuranal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sixjan.com/2011/04/08/digital-signature/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Anand M</media:title>
		</media:content>

		<media:content url="http://anandmuranal.files.wordpress.com/2011/04/verify.jpg?w=300" medium="image">
			<media:title type="html">verify</media:title>
		</media:content>

		<media:content url="http://anandmuranal.files.wordpress.com/2011/04/signer11.jpg?w=300" medium="image">
			<media:title type="html">signer1</media:title>
		</media:content>
	</item>
		<item>
		<title>Struts Life Cycle EXample</title>
		<link>http://sixjan.com/2011/02/13/struts-life-cycle-example/</link>
		<comments>http://sixjan.com/2011/02/13/struts-life-cycle-example/#comments</comments>
		<pubDate>Sun, 13 Feb 2011 11:04:11 +0000</pubDate>
		<dc:creator>Anand Muranal</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[java j2ee]]></category>
		<category><![CDATA[life cycle struts]]></category>
		<category><![CDATA[struts]]></category>

		<guid isPermaLink="false">http://amcubes.com/?p=672</guid>
		<description><![CDATA[Request process in Struts Framework When any struts based web application loaded into serverinitially it will load the ActionServlet class, due to&#60;load-on-startup&#62; tag in web.xml. It will read struts-config.xml file, due to &#60;init-param&#62; tag inweb.xml. When anybody makes request to the respective webapplication it will display the file which is mentioned in&#60;welcome-file-list&#62; tag of web.xml [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sixjan.com&amp;blog=791775&amp;post=672&amp;subd=anandmuranal&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Request process in Struts </strong><strong>Framework</strong></p>
<ul>
<li style="text-align:justify;"><strong></strong>When any struts based web application loaded into serverinitially it will load the ActionServlet class, due to&lt;load-on-startup&gt; tag in web.xml.</li>
</ul>
<ul>
<li style="text-align:justify;">It will read struts-config.xml file, due to &lt;init-param&gt; tag inweb.xml.</li>
</ul>
<ul>
<li style="text-align:justify;">When anybody makes request to the respective webapplication it will display the file which is mentioned in&lt;welcome-file-list&gt; tag of web.xml file.</li>
</ul>
<ul>
<li style="text-align:justify;">When the view page(.jsp) is displayed to the user internally the strutsframework (ActionServlet) will create an object for the formbean class</li>
</ul>
<ul>
<li style="text-align:justify;">Which extends the ActionForm by calling zero argument constructor(default construtor) which is mapped with the Action class path mentioned in .jsp file &lt;html:form action=&#8221;/path&#8221;&gt; later it will call the reset() and all the getter methods of the form bean class.</li>
</ul>
<ul>
<li style="text-align:justify;">When the user fills the form and submit the input, our form bean class again calls the default constructor, reset(), all setter() methods, validate() methods respectively.</li>
</ul>
<ul>
<li style="text-align:justify;">Validate method return ActionErrors object. If the ActionErrors object contains any error values(ActionError/ActionMessage values) then the ActionServlet calls the input page mapped with respective action class(&lt;action input=&#8221;/input.jps&#8221;) that page will display to the user with error messages.</li>
</ul>
<ul>
<li style="text-align:justify;">If ActionErrors object is null(doesn&#8217;t contains any ActionError/ ActionMessage) then the ActionServlet calls the execute() method of the Action class which is bind with input request (&lt;action path=&#8221;/path&#8221; type=&#8221;package.OurActionClass&#8221;).</li>
</ul>
<ul>
<li style="text-align:justify;">execute() method will return ActionForward object. Depend onthe value, again the ActionServlet will call the respectiveview(.jps page) as response and send it back to user.</li>
</ul>
<p><span style="text-decoration:underline;"><strong>Web.xml</strong></span></p>
<blockquote><p>&lt;servlet&gt;</p>
<p style="padding-left:30px;">&lt;servlet-name&gt;action&lt;/servlet-name&gt;</p>
<p style="padding-left:30px;">&lt;servlet-class&gt; org.apache.struts.action.ActionServlet &lt;/servlet-class&gt;</p>
<p style="padding-left:30px;">&lt;init-param&gt;</p>
<p style="padding-left:60px;">&lt;param-name&gt;config&lt;/param-name&gt;</p>
<p style="padding-left:60px;">&lt;param-value&gt;/WEB-INF/struts-config.xml&lt;/param-value&gt;</p>
<p style="padding-left:30px;">&lt;/init-param&gt;</p>
<p style="padding-left:30px;">&lt;load-on-startup&gt;1&lt;/load-on-startup&gt;</p>
<p>&lt;/servlet&gt;</p>
<p>&lt;servlet-mapping&gt;</p>
<p style="padding-left:30px;">&lt;servlet-name&gt;action&lt;/servlet-name&gt;</p>
<p style="padding-left:30px;">&lt;url-pattern&gt;*.do&lt;/url-pattern&gt;</p>
<p>&lt;/servlet-mapping&gt;</p>
<p>&lt;taglib&gt;</p>
<p style="padding-left:30px;">&lt;taglib-uri&gt;/WEB-INF/struts-html.tld&lt;/taglib-uri&gt;</p>
<p style="padding-left:30px;">&lt;taglib-location&gt;/WEB-INF/struts-html.tld&lt;/taglib-location&gt;</p>
<p>&lt;/taglib&gt;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>struts-Config.xml</strong></span></p>
<blockquote><p>&lt;action path=&#8221;/Name&#8221; type=&#8221;example.NameAction&#8221; name=&#8221;nameForm&#8221; input=&#8221;/index.jsp&#8221;&gt;</p>
<p style="padding-left:30px;">&lt;forward name=&#8221;success&#8221; path=&#8221;/displayname.jsp&#8221;/&gt;</p>
<p style="padding-left:30px;">&lt;forward name=&#8221;failure&#8221; path=&#8221;/index.jsp&#8221;/&gt;</p>
<p>&lt;/action&gt;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>NameAction.java</strong></span></p>
<blockquote><p>public class NameAction extends Action {</p>
<p style="padding-left:30px;">public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {</p>
<p style="padding-left:60px;">String target = new String(&#8220;success&#8221;);</p>
<p style="padding-left:60px;">if ( form != null ) {</p>
<p style="padding-left:90px;">// Use the NameForm to get the request parameters</p>
<p style="padding-left:90px;">NameForm nameForm = (NameForm)form;</p>
<p style="padding-left:90px;">String name = nameForm.getName();</p>
<p style="padding-left:60px;">}</p>
<p style="padding-left:60px;">// if no mane supplied Set the target to failure</p>
<p style="padding-left:60px;">if ( name == null ) {</p>
<p style="padding-left:90px;">target = new String(&#8220;failure&#8221;);</p>
<p style="padding-left:60px;">}   else {</p>
<p style="padding-left:90px;">request.setAttribute(&#8220;NAME&#8221;, name);</p>
<p style="padding-left:60px;">}</p>
<p style="padding-left:60px;">return (mapping.findForward(target));</p>
<p style="padding-left:30px;">}</p>
<p>}</p></blockquote>
<p><span style="text-decoration:underline;"><strong>NameForm.java</strong></span></p>
<blockquote><p>public class NameForm extends ActionForm {</p>
<p style="padding-left:30px;">private String name = null;</p>
<p style="padding-left:30px;">public String getName() {</p>
<p style="padding-left:60px;">return (name);</p>
<p style="padding-left:30px;">}</p>
<p style="padding-left:30px;">public void setName(String name) {</p>
<p style="padding-left:60px;">this.name = name;</p>
<p style="padding-left:30px;">}</p>
<p style="padding-left:30px;">public void reset(ActionMapping mapping, HttpServletRequest request) {</p>
<p style="padding-left:60px;">this.name = null;</p>
<p style="padding-left:30px;">}</p>
<p>}</p></blockquote>
<p><span style="text-decoration:underline;"><strong>Index.jsp</strong></span></p>
<blockquote><p>&lt;html&gt;</p>
<p>&lt;head&gt;</p>
<p style="padding-left:30px;">&lt;title&gt;Sample Struts Application&lt;/title&gt;</p>
<p>&lt;/head&gt;</p>
<p>&lt;body&gt;</p>
<p>&lt;html:form action=&#8221;Name&#8221; name=&#8221;nameForm&#8221; type=&#8221;example.NameForm&#8221;&gt;</p>
<p style="padding-left:30px;">&lt;table width=&#8221;80%&#8221; border=&#8221;0&#8243;&gt;</p>
<p style="padding-left:60px;">&lt;tr&gt;</p>
<p style="padding-left:90px;">&lt;td&gt;Name:&lt;/td&gt;</p>
<p style="padding-left:90px;">&lt;td&gt;&lt;html:text property=&#8221;name&#8221; /&gt;&lt;/td&gt;</p>
<p style="padding-left:60px;">&lt;/tr&gt;</p>
<p style="padding-left:60px;">&lt;tr&gt;</p>
<p style="padding-left:90px;">&lt;td&gt;&lt;html:submit /&gt;&lt;/td&gt;</p>
<p style="padding-left:60px;">&lt;/tr&gt;</p>
<p style="padding-left:30px;">&lt;/table&gt;</p>
<p>&lt;/html:form&gt;</p>
<p>&lt;/body&gt;</p>
<p>&lt;/html&gt;</p></blockquote>
<p><span style="text-decoration:underline;"><strong>displayName.jsp</strong></span></p>
<blockquote><p>&lt;html&gt;</p>
<p>&lt;head&gt;</p>
<p>&lt;title&gt;Sample Struts Display Name&lt;/title&gt;</p>
<p>&lt;/head&gt;</p>
<p>&lt;body&gt;</p>
<p style="padding-left:30px;">&lt;table width=&#8221;80%&#8221; border=&#8221;0&#8243;&gt;</p>
<p style="padding-left:60px;">&lt;tr&gt;</p>
<p style="padding-left:60px;">&lt;td&gt;Hello &lt;%= request.getAttribute(&#8220;NAME&#8221;) %&gt; !!&lt;/td&gt;</p>
<p style="padding-left:60px;">&lt;/tr&gt;</p>
<p style="padding-left:30px;">&lt;/table&gt;</p>
<p>&lt;/body&gt;</p>
<p>&lt;/html&gt;</p></blockquote>
<p><a href="http://www.allapplabs.com/struts/struts_example.htm">More info</a><span id="more-672"></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/anandmuranal.wordpress.com/672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/anandmuranal.wordpress.com/672/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/anandmuranal.wordpress.com/672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/anandmuranal.wordpress.com/672/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/anandmuranal.wordpress.com/672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/anandmuranal.wordpress.com/672/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/anandmuranal.wordpress.com/672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/anandmuranal.wordpress.com/672/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/anandmuranal.wordpress.com/672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/anandmuranal.wordpress.com/672/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/anandmuranal.wordpress.com/672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/anandmuranal.wordpress.com/672/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/anandmuranal.wordpress.com/672/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/anandmuranal.wordpress.com/672/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sixjan.com&amp;blog=791775&amp;post=672&amp;subd=anandmuranal&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sixjan.com/2011/02/13/struts-life-cycle-example/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Anand M</media:title>
		</media:content>
	</item>
	</channel>
</rss>
