<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosuresfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-3202269015126578615</atom:id><lastBuildDate>Sat, 11 Feb 2012 15:19:58 +0000</lastBuildDate><category>how to read image from the database</category><category>Indian flag</category><category>What is the difference between EAR</category><category>Load properties using resource bundle</category><category>Generic Servlet</category><category>Java Interview Questions</category><category>hibernate mapping</category><category>how to read image from the database and set height and width</category><category>cross browser compatability issues</category><category>war</category><category>how to get user size in oracle</category><category>A kid smile</category><category>Java Performance Tuning</category><category>HashSet</category><category>DHTML tables</category><category>Hibernate One to one example</category><category>Struts i18n applications</category><category>Stephen hawking</category><category>Introduction to apache cassandra</category><category>Store images while developing.</category><category>JFree chart</category><category>Replace String Example in Java</category><category>What is web service</category><category>Spcifying ICE faces DOCTYPE</category><category>Arrange an array in ascending and descending order</category><category>HTML5 Examples</category><category>Job Scheduler</category><category>Java webservices</category><category>Cassandra insertion example</category><category>my hero</category><category>Sping file upload</category><category>HTML5 Samples</category><category>i18n in strtus</category><category>Eclipse Struts2 plugins</category><category>Log file implementation in Java</category><category>What is the difference Normal HTML tags and Struts HTML tags</category><category>mapping in hibernate</category><category>thirupathi tour</category><category>web 1.0</category><category>RESTful webservice</category><category>JSF advantages</category><category>Hibernate many to one example</category><category>What is an Ip address</category><category>Hiberante Cache management</category><category>Front Controller</category><category>struts i18n example</category><category>Singleton example in java</category><category>Real happiness</category><category>internationalization in java</category><category>Jdbc connection to Sql Server</category><category>Iterator</category><category>Shani Singnapoor</category><category>Colorful life</category><category>Oracle Query to list all the users in database</category><category>Http Servlet</category><category>How to read image into image tag of html</category><category>Top 5 posts in 2010</category><category>Struts MVC design pattern</category><category>tour</category><category>Create Folder in Java Example</category><category>Enabling JMX port in JBOSS</category><category>struts samples</category><category>New year wishes</category><category>Cassandra Single Row Fetch Example</category><category>What is a singleton class</category><category>SortedSet Example</category><category>static method</category><category>front controller design pattern</category><category>Abstract class and Interface</category><category>jsf benfits</category><category>Servlet Implimentation</category><category>Javascript Dynamic row addition</category><category>hashCode() in java</category><category>Static variables</category><category>JSF implementations</category><category>jsf features</category><category>Ajax examples</category><category>one to one in hibernate</category><category>HTML DOCTYPES</category><category>How to add Dynamic rows using Javascript</category><category>Constructor</category><category>JSF doctype</category><category>Hibernate interview Questions.</category><category>cricket world cup 2011</category><category>J2EE design patterns</category><category>Login Application with Dispatch Action in Struts</category><category>difference bet ween object and instance</category><category>Indiblogger Rank</category><category>Nano Syntax</category><category>where to store images in database or folder</category><category>The happiest kid</category><category>how to get list of users in oracle</category><category>working with an array in java</category><category>Service to worker</category><category>Quartz Job Server</category><category>happy journey</category><category>Java SAX Parser</category><category>Apache Cassandra Usefull links</category><category>Pranave mistery</category><category>JAR and WAR file</category><category>Available implementations of JavaServer Faces</category><category>Log4j examples</category><category>array sorting</category><category>check box with ajax</category><category>browser compatability issues</category><category>Log4j configurations</category><category>Web sevice</category><category>Difference between GenericServlet and HttpServlet</category><category>Panchavati</category><category>Logging in Java</category><category>view helper</category><category>new year 2012 images</category><category>JEE core design patterns</category><category>xml parsing in java</category><category>hibernate examples</category><category>Enable JMX Remote port in WebLogic</category><category>hibernate relationships</category><category>JSF plugins</category><category>ip address</category><category>How to write byte array in jsp</category><category>DOM XML parsing</category><category>struts examples</category><category>struts action class example</category><category>many to one example in hibernate</category><category>Uploa image using Spring</category><category>Hash Set with Example</category><category>DHTML text boxes</category><category>How to read propeties file in java</category><category>World cup 2011</category><category>Google Call Phone</category><category>advantages of JSF</category><category>Oracle database import</category><category>struts internationalization example</category><category>browser compatibility issues</category><category>web 2.0</category><category>Java Server Faces plugins</category><category>getting selected text from the html select menu</category><category>How man inner classes are there in Java?</category><category>Websphere JMX remote port</category><category>SortedSet</category><category>Business Deligate</category><category>Gmail Call Phone</category><category>Replace String in Java</category><category>Web 3.0</category><category>DAO</category><category>Web service defination</category><category>Cassandra</category><category>developing applications for different browsers</category><category>browser compatiblity issues with IE in JSF</category><category>What is the difference between Iterator and ListIterator</category><category>MVC Design pattern with Struts</category><category>Learn HTML5</category><category>i18n example in struts</category><category>action class example in struts</category><category>210 blog posts</category><category>Trayambakeshwar</category><category>how to get size of user in oracle</category><category>array sorting in java</category><category>hibernate one to many eaxmple</category><category>Struts2 plugins</category><category>Java xml parsing</category><category>how to know my system ip Address</category><category>ear</category><category>Jar</category><category>Webservices</category><category>photo</category><category>Sparsh</category><category>equals() in java</category><category>Executable jar file</category><category>Cassandra Examples</category><category>Buffered InputStraeam Example</category><category>subnet</category><category>Java Interface</category><category>Log4j samples</category><category>Write image into jsp</category><category>Ajax samples</category><category>web technologies</category><category>Abstact class in java</category><category>JSF</category><category>Java Server Faces</category><category>Writing image into jsp</category><category>java static variables and methods</category><category>Revoutionary software</category><category>Enabling JMX port in Tomcat</category><category>HAPPY NEW YEAR 2010</category><category>Filters in java</category><category>ListIterator</category><category>intercepting filter</category><category>validation framwork in struts</category><category>struts validation</category><category>Nasik</category><category>java try catch block</category><category>JSF Interview Questions</category><category>Servlet Basics</category><category>Prime faces</category><category>Indiblogger post</category><category>load propeties file in java</category><category>Log4j</category><category>interface iin java</category><category>Ajax</category><category>How to create Folder in Java</category><category>What is the difference bet ween object and instance</category><category>Cewolf</category><category>WSDL</category><category>Fetch All the Records From Cassandra database exmaple</category><category>Upload image into database using Spring</category><category>Struts Dispatch Action</category><category>Jtest</category><category>java abstract class</category><category>Intercepting Filte</category><category>optionsselection example in struts</category><category>intel widi</category><category>HAPPY NEW YEAR 2011</category><category>Design Patterns</category><category>Nearest places to thirupathi</category><category>HTML5</category><category>Servlet Life Cycle</category><category>Google Net Talk</category><category>Java examples</category><category>The Real Beauty...</category><category>Servlets</category><category>Java Sever Implementaions</category><category>JBoss</category><category>Java Singleton Design pattern</category><category>Enable JMX Remote port in Websphere</category><category>get selected text of the drop doen ment of the html</category><category>Java Servlets</category><category>Log4j in java</category><category>Important Oracle Queries</category><category>Java</category><category>HAPPY NEW YEAR 2012</category><category>Exporting Oracle Database</category><category>Spring Image upload</category><category>SOAP</category><category>Hibernate Cache Management</category><category>Struts Login Example</category><category>Gmail Net talk</category><category>What are prime faces</category><category>JMX remote port in JBoss</category><category>Shirdi Tour</category><category>What happens to all my social networking information when I die</category><category>holy-grail</category><category>Cache in Hibernate</category><category>Session Facade</category><category>Import oracle database into a user</category><category>wi di</category><category>HTML5 Useful links</category><category>jar file Vs executable jar file</category><title>IT EINSTEIN</title><description>Share the knowledge</description><link>http://mallikarjungunda.blogspot.com/</link><managingEditor>noreply@blogger.com (Mallik)</managingEditor><generator>Blogger</generator><openSearch:totalResults>116</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/blogspot/cvBNv" /><feedburner:info uri="blogspot/cvbnv" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><media:copyright>All rights are reserved @ IT EINSTEIN</media:copyright><itunes:owner><itunes:email>mallikarjungunda@gmail.com</itunes:email><itunes:name>Mallikarjun Gunda</itunes:name></itunes:owner><itunes:author>Mallikarjun Gunda</itunes:author><itunes:explicit>no</itunes:explicit><itunes:subtitle>IT EINSTEIN</itunes:subtitle><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-1628009324480152475</guid><pubDate>Sat, 11 Feb 2012 14:18:00 +0000</pubDate><atom:updated>2012-02-11T06:23:30.549-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">HTML5</category><category domain="http://www.blogger.com/atom/ns#">HTML5 Useful links</category><category domain="http://www.blogger.com/atom/ns#">HTML5 Samples</category><category domain="http://www.blogger.com/atom/ns#">Learn HTML5</category><category domain="http://www.blogger.com/atom/ns#">HTML5 Examples</category><title>HTML5 More Useful Links</title><description>&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Recent
days HTML5 became more popular and good&amp;nbsp;presentation&amp;nbsp;web technology
due to its excellent features. Currently we are unable to see most of the HTML5
based applications in the web as it is not using completely around the world. But
we can believe that, in future HTML 5 replaces the most of the web presentation
technologies. As a developer I have tried to look into it and tried to
implement the some of the examples in HTML5 and I found that HTML5 has
excellent features like canvas implementation, GPS integration tags, Audio and
Vedio play tags.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;As
we have a greater scope or greater future for the HTML 5 designers, it is
better to digest the things from now onwards. In my research I found so many
examples&amp;nbsp;in number of websites. As per my understanding I took some
sites and I have classified them into three categories as mentioned below. This
is only my experience over the sites and I feel, if a person wants to learn
HTML 5 he has to go through the below step.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style="background-color: rgba(255, 255, 255, 0.917969); color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;Basic:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href="http://www.w3schools.com/html5/default.asp" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://www.w3schools.com/&lt;wbr&gt;&lt;/wbr&gt;html5/default.asp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.html5rocks.com/en/tutorials/video/basics/" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://www.html5rocks.com/en/&lt;wbr&gt;&lt;/wbr&gt;tutorials/video/basics/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.gilbertocortez.com/blog/html5/sample-html5-structure" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://www.gilbertocortez.com/&lt;wbr&gt;&lt;/wbr&gt;blog/html5/sample-html5-&lt;wbr&gt;&lt;/wbr&gt;structure&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="https://seogadget.co.uk/html5-examples-in-the-wild/" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;https://seogadget.co.uk/html5-&lt;wbr&gt;&lt;/wbr&gt;examples-in-the-wild/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: rgba(255, 255, 255, 0.917969); color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;Medium:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href="http://html5demos.com/" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://html5demos.com/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.w3schools.com/html/html_examples.asp" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://www.w3schools.com/html/&lt;wbr&gt;&lt;/wbr&gt;html_examples.asp&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://html5tutorial.net/" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://html5tutorial.net/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.rgraph.net/examples/index.html" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://www.rgraph.net/&lt;wbr&gt;&lt;/wbr&gt;examples/index.html&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.html5samples.com/category/new-features-in-html-5/html-5-and-css-3/" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://www.html5samples.com/&lt;wbr&gt;&lt;/wbr&gt;category/new-features-in-html-&lt;wbr&gt;&lt;/wbr&gt;5/html-5-and-css-3/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.web3mantra.com/2011/09/12/30-best-html5-websites-inspirations/" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://www.web3mantra.com/&lt;wbr&gt;&lt;/wbr&gt;2011/09/12/30-best-html5-&lt;wbr&gt;&lt;/wbr&gt;websites-inspirations/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.html5tuts.co.uk/" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://www.html5tuts.co.uk/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://blog.genggao.net/inspiration/beautiful-html5-web-design-showcases/" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://blog.genggao.net/&lt;wbr&gt;&lt;/wbr&gt;inspiration/beautiful-html5-&lt;wbr&gt;&lt;/wbr&gt;web-design-showcases/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: rgba(255, 255, 255, 0.917969); color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;Extream:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href="http://webdesignledger.com/inspiration/30-examples-of-websites-using-html5" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://webdesignledger.com/&lt;wbr&gt;&lt;/wbr&gt;inspiration/30-examples-of-&lt;wbr&gt;&lt;/wbr&gt;websites-using-html5&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://html5gallery.com/" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://html5gallery.com/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://html5websites.net/" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://html5websites.net/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.devlounge.net/code/10-awesome-html5-canvas-examples" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://www.devlounge.net/code/&lt;wbr&gt;&lt;/wbr&gt;10-awesome-html5-canvas-&lt;wbr&gt;&lt;/wbr&gt;examples&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://alteredqualia.com/canvasmol/#Anandamide" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://alteredqualia.com/&lt;wbr&gt;&lt;/wbr&gt;canvasmol/#Anandamide&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.chromeexperiments.com/" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://www.chromeexperiments.&lt;wbr&gt;&lt;/wbr&gt;com/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.webdesignersblog.net/inspiration/45-inspirational-examples-html5-websites/" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://www.webdesignersblog.&lt;wbr&gt;&lt;/wbr&gt;net/inspiration/45-&lt;wbr&gt;&lt;/wbr&gt;inspirational-examples-html5-&lt;wbr&gt;&lt;/wbr&gt;websites/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.web3mantra.com/2011/09/12/30-best-html5-websites-inspirations/" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://www.web3mantra.com/&lt;wbr&gt;&lt;/wbr&gt;2011/09/12/30-best-html5-&lt;wbr&gt;&lt;/wbr&gt;websites-inspirations/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.designfloat.com/blog/2011/08/11/html5-websites-best-capabilities/" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://www.designfloat.com/&lt;wbr&gt;&lt;/wbr&gt;blog/2011/08/11/html5-&lt;wbr&gt;&lt;/wbr&gt;websites-best-capabilities/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://101besthtml5sites.com/" style="background-color: rgba(255, 255, 255, 0.917969);" target="_blank"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;http://101besthtml5sites.com/&lt;/span&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-1628009324480152475?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/ZQNW2fd1lS0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/ZQNW2fd1lS0/recentdays-html5-became-more-popular.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><thr:total>0</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2012/02/recentdays-html5-became-more-popular.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-2536656990987085956</guid><pubDate>Sat, 04 Feb 2012 18:09:00 +0000</pubDate><atom:updated>2012-02-04T10:22:18.457-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">cross browser compatability issues</category><category domain="http://www.blogger.com/atom/ns#">browser compatiblity issues with IE in JSF</category><category domain="http://www.blogger.com/atom/ns#">Spcifying ICE faces DOCTYPE</category><category domain="http://www.blogger.com/atom/ns#">browser compatibility issues</category><category domain="http://www.blogger.com/atom/ns#">HTML DOCTYPES</category><category domain="http://www.blogger.com/atom/ns#">JSF doctype</category><title>HTML DTD for ICE faces JSPX</title><description>&lt;div class="tr_bq"&gt;&lt;span style="color: #222222; font-family: arial, sans-serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Resolving the browser compatibility issues while developing the web applications is a bit complex. Most of the times developer tries to write the browser specific code. But, it is not possible to implement the browser specific code for all the pages of the application in all the scenarios and it is not required if we specify the DOCTYPE. Specifying the doctype for the page will decrease the most of the browser compatibility issues.&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;A doctype declaration refers to the rules for the markup language, so that the browsers render the content correctly.&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;The doctype declaration is not an HTML tag; it is an instruction to the web browser about what version of the markup language the page is written in.&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;The doctype declaration refers to a Document Type Definition (DTD). The DTD specifies the rules for the markup language, so that the browsers render the content correctly.&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;The doctype declaration should be the very first thing in an HTML document, before the tag.&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;There are different DTDs for the HTML page as specified below:&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif; font-size: x-small;"&gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif; font-size: x-small;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif; font-size: x-small;"&gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif; font-size: x-small;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif; font-size: x-small;"&gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif; font-size: x-small;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif; font-size: x-small;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif; font-size: x-small;"&gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/transitional.dtd"&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Specifying the DTD on JSF page which developed using ICE faces might not accept as you specify on the normal HTML page. You have to place it after the declaration of f:view tag.&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;lt;jsp:root version="2.1" xmlns:jsp="http://java.sun.com/JSP/Page" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xmlns:f="http://java.sun.com/jsf/core" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xmlns:h="http://java.sun.com/jsf/html" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xmlns:ice="http://www.icesoft.com/icefaces/component"&amp;gt; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;lt;jsp:directive.page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"/&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;lt;f:view&amp;gt; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;lt;ice:outputDeclaration doctypeRoot="HTML" doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN" doctypeSystem="http://www.w3.org/TR/html4/strict.dtd" /&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;lt;!-- Place the required code here --&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;lt;/f:view&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;lt;/jsp:root&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;a href="http://mallikarjungunda.blogspot.in/2011/07/how-to-fix-browser-compatibility-issues.html" target="_blank"&gt;Click here &lt;/a&gt;To Read more about fixing the browser compatibility issues.&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-2536656990987085956?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/yUK-C7n7D2Q" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/yUK-C7n7D2Q/html-dtd-for-ice-faces-jspx.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><thr:total>0</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2012/02/html-dtd-for-ice-faces-jspx.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-1253172770870908738</guid><pubDate>Tue, 24 Jan 2012 17:57:00 +0000</pubDate><atom:updated>2012-02-11T06:06:59.121-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">equals() in java</category><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">hashCode() in java</category><category domain="http://www.blogger.com/atom/ns#">Java examples</category><title>equals() and hashCode() methods of Object Class</title><description>&lt;div class="MsoNormal"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;HashTable, HashMap and HashSet are the Collection classes in java.util package that make use of hashing algorithm to store objects. In all these Collection classes except HashSet, objects are stored as key-value pairs. For the storage and the retrieval of any user-defined objects it is a good &lt;u&gt;practice&lt;/u&gt; to override the following methods which is mentioned below,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul type="disc"&gt;
&lt;li class="MsoNormal"&gt;&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;i&gt;hashCode()&lt;/i&gt;&lt;/b&gt;      &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal"&gt;&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;i&gt;equals()&lt;/i&gt;&lt;/b&gt;      &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;These methods are available in the Object class and hence available to all &lt;u&gt;java classes&lt;/u&gt;.Using these two methods, an object can be stored or retrieved from a Hashtable, HashMap or HashSet. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;b&gt;&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;hashCode() method&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;This method returns a hashcode value as an int for the object. Default implementation for hashcode() should be overridden in order to make &lt;u&gt;searching&lt;/u&gt; of data faster. The implementation of hashCode() method for an user-defined object should be calculated based on the &lt;u&gt;properties&lt;/u&gt; of the class which we wish to consider. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;b&gt;&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;equals() method&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;This method returns a boolean which specifies whether two objects are equal or not. The default implementation of equals() method given by the Object Class uses the '==' operator to compare two object &lt;u&gt;references&lt;/u&gt;, and returns true only if they refer to the same object. But, we can meaningfully re-define this equals() method to have en equality check based on our own criterias.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;Consider the following code, which defines two user defined classes Employee and EmployeeId which are supposed to be stored in a Map. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;Employee.java&lt;/b&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;public class Employee {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private String name;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Employee(String name){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.name = name;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public String toString(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return name;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;EmployeeId.java&lt;/b&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;public class EmployeeId {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private String id;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public EmployeeId(String id){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.id = id;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public String toString(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return id;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;The following class makes use of the above classes by storing it in a Map for later retrieval. We are adding Employee objects into the Map keyed with Employee Id. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;HashCodeTest.java&lt;/b&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;public class HashCodeTest {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String[] args) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Map&lt;employeeid, employee=""&gt; employees = new HashMap&lt;employeeid, employee=""&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/employeeid,&gt;&lt;/employeeid,&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; employees.put(new EmployeeId("111"), &lt;u&gt;new Employee&lt;/u&gt;("Johny"));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; employees.put(new EmployeeId("222"), new Employee("Jeny")); // Line A&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; employees.put(new EmployeeId("333"), new Employee("Jessie"));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Employee emp =&amp;nbsp; employees.get(new EmployeeId("222")); // Line B&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(emp); // Line C&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;In Line B, we try to retrieve the Employee object who has Employee Id with a value of 222. We expect the output to be &lt;b&gt;&lt;i&gt;'Jeny'&lt;/i&gt;&lt;/b&gt;, because the Employee with Employee Id (222) was already there in the Collection, but surprisingly, the output of the above code is &lt;b&gt;&lt;i&gt;null&lt;/i&gt;&lt;/b&gt;. The reason is that we did not override the equals() method for EmployeeId and Employee classes because the default implementation of equals() in the Object class considers the new EmployeeId("222") in the put statement and new EmployeeId("222") in the get statement as two different instances, and hence the call to get() in Line B returns null. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;Let us look at how the same code works when we provide our desired implementation for hashcode() and equals() methods. We basically override hashcode() here just to make the object to be searched fast.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;Employee.java&lt;/b&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;public class Employee {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private String name;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Employee(String name){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.name = name;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public String toString(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return name;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public boolean equals(Object obj){ &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(obj == null) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(obj.getClass() != getClass()){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Employee emp = (Employee)obj;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(this.name == emp.name){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return true;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public int hashCode(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return name.hashCode();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;EmployeeId.java&lt;/b&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;public class EmployeeId {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private String id;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public EmployeeId(String id){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.id = id;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public String toString(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return id;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public boolean equals(Object obj){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(obj == null) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(obj.getClass() != getClass()){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EmployeeId empId = (EmployeeId)obj;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(this.id == empId.id){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return true;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public int hashCode(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return id.hashCode();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-color: #efefef; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0.0001pt;"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;Now, we get the desired output 'Jeny', because as per our implementation for the equals() method, the new EmployeeId("222") in the put statement and new EmployeeId("222") in the get statement are considered one and the same.&lt;/span&gt;&lt;span style="font-family: Verdana, sans-serif; font-size: x-small;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-1253172770870908738?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/NwJESCR8E6A" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/NwJESCR8E6A/equals-and-hashcode-methods-of-object.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><thr:total>2</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2012/01/equals-and-hashcode-methods-of-object.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-8125960350762353771</guid><pubDate>Mon, 16 Jan 2012 18:43:00 +0000</pubDate><atom:updated>2012-01-16T10:44:21.604-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java webservices</category><category domain="http://www.blogger.com/atom/ns#">RESTful webservice</category><category domain="http://www.blogger.com/atom/ns#">What is web service</category><category domain="http://www.blogger.com/atom/ns#">Web service defination</category><title>Introduction to RESTful Web Services</title><description>&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;REST is a “Representational state transfer” and it is firstly introduced by Roy Fielding (Fielding is one of the principal authors of the HTTP specification and a co-founder of the Apache HTTP Server project) in his 2000 doctoral dissertation.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0.0001pt;"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;REST-style services (i.e., RESTful services) adhere to a set of constraints and architectural principles that include the following:&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoListParagraphCxSpFirst" style="margin-bottom: 0.0001pt; text-indent: -0.25in;"&gt;&lt;/div&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span style="font: normal normal normal 7pt/normal 'Times New Roman'; text-indent: -0.25in;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="text-indent: -0.25in;"&gt;RESTful services are stateless. As Fielding writes in Section 5.1.3 of his thesis, “each request from client to server must contain all the information necessary to understand the request, and cannot take advantage of any stored context on the server.”&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="text-indent: -0.25in;"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;RESTful services have a uniform interface. This constraint is usually taken to mean that the only allowed operations are the HTTP operations: GET, POST, PUT, and DELETE.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="text-indent: -0.25in;"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;REST-based architectures are built from resources (pieces of information) that are uniquely identified by URIs. For example, in a RESTful purchasing system, each purchase order has a unique URI.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="line-height: 115%;"&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;REST components manipulate resources by exchanging representations of the resources. For example, a purchase order resource can be represented by an XML document. Within a RESTful purchasing system, a purchase order might be updated by posting an XML document containing the changed purchase order to its URI&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-8125960350762353771?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/Ydgxc8KGiyg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/Ydgxc8KGiyg/rest-is-representational-state-transfer.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><thr:total>0</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2012/01/rest-is-representational-state-transfer.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-6075127009823405487</guid><pubDate>Sat, 31 Dec 2011 04:42:00 +0000</pubDate><atom:updated>2012-02-10T09:33:16.940-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">New year wishes</category><category domain="http://www.blogger.com/atom/ns#">new year 2012 images</category><category domain="http://www.blogger.com/atom/ns#">HAPPY NEW YEAR 2012</category><title>Thanks to 2011</title><description>&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;This is the time say thanks to 2011, it brought remarkable changes in my life and its gave me the confidence to start new things which takes me into redesign myself.&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;I have started my new career with a new team in a new company along with the 2011. As it is passing away I continued in learn new things, interacting with many number of people, continued in improving&amp;nbsp;communication&amp;nbsp;skills, I have learned many technical skills. So, I got the many appreciations and many&amp;nbsp;recognitions&amp;nbsp;for my dedicated work in the team. Finally I like to stress is 2011 brought considerable change in my work.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;I am very sad for the retiring of 2011, and I am very happy in welcoming the new year 2012 which might bring more colorful and more&amp;nbsp;happiness&amp;nbsp;into my life. I hope 2012 brings more remarkable changes than 2011, and I wish you all the best for you all.&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;I am welcoming you all in inviting the new year.... :) so...&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;HAPPY NEW YEAR 2012&lt;/span&gt;&lt;/b&gt; all for you my dear friends...:)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-MWh6U9yraH0/Tv6QJo-t1bI/AAAAAAAABfU/YItXInwpgT8/s1600/Happy+New+Year2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://2.bp.blogspot.com/-MWh6U9yraH0/Tv6QJo-t1bI/AAAAAAAABfU/YItXInwpgT8/s640/Happy+New+Year2.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-6075127009823405487?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/eeBsC38w5pI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/eeBsC38w5pI/thanks-to-2011.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><media:thumbnail url="http://2.bp.blogspot.com/-MWh6U9yraH0/Tv6QJo-t1bI/AAAAAAAABfU/YItXInwpgT8/s72-c/Happy+New+Year2.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/12/thanks-to-2011.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-2412381334581030248</guid><pubDate>Sat, 19 Nov 2011 14:03:00 +0000</pubDate><atom:updated>2011-11-19T07:21:00.314-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">J2EE design patterns</category><category domain="http://www.blogger.com/atom/ns#">front controller design pattern</category><title>Front Controller - Core J2EE design patterns</title><description>&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Front Controller pattern tells that, “&lt;b&gt;&lt;i&gt;There should be a Single entry and exit point for each and every request made by the user on a single application expecting for a single type of result and the same single controller may interact with different systems or programs to build the response for the request&lt;/i&gt;&lt;/b&gt;”.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif; font-size: xx-small;"&gt;&lt;span class="Apple-style-span" style="line-height: 18px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;For a better manageability of an application use a Front Controller as the initial point of contact for handling all related requests. The Front Controller centralizes control logic that might otherwise be duplicated, and manages the key request handling activities.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif; font-size: xx-small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;The Front Controller pattern suggests centralizing the handling of all requests but, it does not limit the number of handlers in the system, as does a Singleton. An application may use multiple controllers in a system, each mapping to a set of distinct services&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="background-color: white;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="line-height: 115%;"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="line-height: 115%;"&gt;Most of the current MVC based frameworks are using the Front Controller design pattern internally to handle the request from the multiple users.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-style-span" style="line-height: 18px;"&gt;&lt;b&gt;Action Servlet&lt;/b&gt; is the Front controller in the Struts Framework (1.x)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-style-span" style="line-height: 18px;"&gt;&lt;b&gt;Faces Servlet&lt;/b&gt; is the Front Controller in the JSF Framework.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 115%;"&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;span style="line-height: 115%;"&gt;Advantages:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 115%;"&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;span style="line-height: 115%;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 115%;"&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;Centralizes The Control:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt; It works like a central place to handle system services and business logic across multiple requests and manages business logic processing and request handling. Centralized access to an application means that requests are easily tracked and logged.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 115%;"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 115%;"&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;Improves Manageability: &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;Front Controller centralizes control, providing a choke point for illicit access attempts into the Web application. In addition, auditing a single entrance into the application requires fewer resources than distributing security checks across all pages.&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;Improves Reusability:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt; Front Controller promotes cleaner application partitioning and encourages reuse, as code that is common among components moves into a controller or is managed by a controller.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 115%;"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 115%;"&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;Separates the System Processing Logic:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt; Front Servlet seperates the System Processing logic from view and provides the better manageability from the same.&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 115%;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-2412381334581030248?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/7tI5wm3empI" height="1" width="1"/&gt;</description><enclosure type="text/html" url="http://mallikarjungunda.blogspot.com/2011/11/intercepting-filter-core-j2ee-design.html" length="0" /><enclosure type="text/html" url="http://mallikarjungunda.blogspot.com/2011/11/j2ee-design-patterns.html" length="0" /><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/7tI5wm3empI/front-controller-core-j2ee-design.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><thr:total>1</thr:total><media:content url="http://mallikarjungunda.blogspot.com/2011/11/intercepting-filter-core-j2ee-design.html" type="text/html" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>Front Controller pattern tells that, “There should be a Single entry and exit point for each and every request made by the user on a single application expecting for a single type of result and the same single controller may interact with different system</itunes:subtitle><itunes:author>Mallikarjun Gunda</itunes:author><itunes:summary>Front Controller pattern tells that, “There should be a Single entry and exit point for each and every request made by the user on a single application expecting for a single type of result and the same single controller may interact with different systems or programs to build the response for the request”. For a better manageability of an application use a Front Controller as the initial point of contact for handling all related requests. The Front Controller centralizes control logic that might otherwise be duplicated, and manages the key request handling activities. The Front Controller pattern suggests centralizing the handling of all requests but, it does not limit the number of handlers in the system, as does a Singleton. An application may use multiple controllers in a system, each mapping to a set of distinct services Most of the current MVC based frameworks are using the Front Controller design pattern internally to handle the request from the multiple users.Action Servlet is the Front controller in the Struts Framework (1.x) Faces Servlet is the Front Controller in the JSF Framework. Advantages: Centralizes The Control: It works like a central place to handle system services and business logic across multiple requests and manages business logic processing and request handling. Centralized access to an application means that requests are easily tracked and logged. Improves Manageability: Front Controller centralizes control, providing a choke point for illicit access attempts into the Web application. In addition, auditing a single entrance into the application requires fewer resources than distributing security checks across all pages. Improves Reusability: Front Controller promotes cleaner application partitioning and encourages reuse, as code that is common among components moves into a controller or is managed by a controller. Separates the System Processing Logic: Front Servlet seperates the System Processing logic from view and provides the better manageability from the same. </itunes:summary><itunes:keywords>J2EE design patterns, front controller design pattern</itunes:keywords><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/11/front-controller-core-j2ee-design.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-2458209426586840516</guid><pubDate>Sun, 13 Nov 2011 16:20:00 +0000</pubDate><atom:updated>2011-11-13T08:34:52.111-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">xml parsing in java</category><category domain="http://www.blogger.com/atom/ns#">DOM XML parsing</category><category domain="http://www.blogger.com/atom/ns#">Java xml parsing</category><title>XML Parsing Example using DOM in Java</title><description>&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;package com.test;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;import java.io.StringReader;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;import javax.xml.parsers.DocumentBuilder;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;import javax.xml.parsers.DocumentBuilderFactory;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;import org.w3c.dom.CharacterData;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;import org.w3c.dom.Document;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;import org.w3c.dom.Element;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;import org.w3c.dom.Node;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;import org.w3c.dom.NodeList;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;import org.xml.sax.InputSource;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;public class XMLParsing {&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; public static void main(String arg[]) throws Exception{&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String xmlRecords = "&amp;lt;data&amp;gt;&amp;lt;employee&amp;gt;&amp;lt;name&amp;gt;A&amp;lt;/name&amp;gt;"&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; + "&amp;lt;title&amp;gt;Manager&amp;lt;/title&amp;gt;&amp;lt;/employee&amp;gt;&amp;lt;/data&amp;gt;";&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; DocumentBuilder db = DocumentBuilderFactory.newInstance().&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;                                             &lt;/span&gt;newDocumentBuilder();&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; InputSource is = new InputSource();&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; is.setCharacterStream(new StringReader(xmlRecords));&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; Document doc = db.parse(is);&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; NodeList nodes = doc.getElementsByTagName("employee");&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; nodes.getLength(); i++) {&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Element element = (Element) nodes.item(i);&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; NodeList name = element.getElementsByTagName("name");&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Element line = (Element) name.item(0);&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("Name: " + getCharacterDataFromElement(line));&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; NodeList title = element.getElementsByTagName("title");&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; line = (Element) title.item(0);&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("Title: " + getCharacterDataFromElement(line));&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; public static String getCharacterDataFromElement(Element e) {&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; Node child = e.getFirstChild();&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; if (child instanceof CharacterData) {&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; CharacterData cd = (CharacterData) child;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; return cd.getData();&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; return "";&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Related Links:&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href="http://mallikarjungunda.blogspot.com/2011/11/sax-parser-example-in-java.html" target="_blank"&gt;XML Parsing using SAX Parser in Java&lt;/a&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: #0b5394;"&gt;&lt;a href="http://mallikarjungunda.blogspot.com/2011/10/read-properties-file-in-java.html" target="_blank"&gt;Read Properties File in java&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href="http://mallikarjungunda.blogspot.com/2011/11/j2ee-design-patterns.html" target="_blank"&gt;J2EE Design Patterns&lt;/a&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-2458209426586840516?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/D_mJdzLVwbg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/D_mJdzLVwbg/xml-parsing-example-using-dom-in-java.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><thr:total>0</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/11/xml-parsing-example-using-dom-in-java.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-7898425927694135472</guid><pubDate>Sun, 13 Nov 2011 16:14:00 +0000</pubDate><atom:updated>2011-11-13T08:27:00.356-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">xml parsing in java</category><category domain="http://www.blogger.com/atom/ns#">Java SAX Parser</category><title>SAX Parser Example in JAVA</title><description>&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;package com.test;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;import java.io.StringReader;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;import java.util.Enumeration;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;import java.util.Locale;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;import java.util.ResourceBundle;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;import javax.xml.parsers.SAXParser;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;import javax.xml.parsers.SAXParserFactory;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;import org.xml.sax.Attributes;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;import org.xml.sax.InputSource;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;import org.xml.sax.SAXException;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;import org.xml.sax.helpers.DefaultHandler;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;public class ParseXMLUsingSAX {&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;public static String xmlString = "&amp;lt;?xml version='1.0'?&amp;gt;&amp;lt;EMPLOYEE&amp;gt;&amp;lt;USER_ID&amp;gt;admin&amp;lt;/USER_ID&amp;gt;&amp;lt;PASSWORD&amp;gt;admin123&amp;lt;/PASSWORD&amp;gt;&amp;lt;/EMPLOYEE&amp;gt;";&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;public static void main(String argv[]) {&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;String fileName = "D:\\test.xml";&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;parseXml(fileName);&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;public static void parseXml(String fileName){&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;try {&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;SAXParserFactory factory = SAXParserFactory.newInstance();&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;SAXParser saxParser = factory.newSAXParser();&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;InputSource is = new InputSource();&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;is.setCharacterStream(new StringReader(xmlString));&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;DefaultHandler handler = new DefaultHandler() {&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;boolean userID = false;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;boolean password = false;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;public void startElement(String uri, String localName,&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;String qName, Attributes attributes) t&lt;/span&gt;&lt;/code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;hrows SAXException {&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;if (qName.equalsIgnoreCase("USER_ID")) {&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;userID = true;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;if (qName.equalsIgnoreCase("PASSWORD")) {&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;password = true;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;public void endElement(String uri, String localName,&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;String qName) throws SAXException {&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;public void characters(char ch[], int start, int length)&lt;/span&gt;&lt;/code&gt;&lt;span class="Apple-tab-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif; white-space: pre;"&gt; &lt;/span&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;throws SAXException {&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;if (userID) {&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;System.out.println("userID : "&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;+ new String(ch, start, length));&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;userID = false;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;if (password) {&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;System.out.println("password : "&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;+ new String(ch, start, length));&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;password = false;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;};&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;          &lt;/span&gt;//saxParser.parse(fileName, handler);&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;           &lt;/span&gt;saxParser.parse(is, handler);&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;} catch (Exception e) {&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;          &lt;/span&gt;e.printStackTrace();&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-7898425927694135472?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/nWTT47FvKGg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/nWTT47FvKGg/sax-parser-example-in-java.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><thr:total>0</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/11/sax-parser-example-in-java.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-7640199651300133127</guid><pubDate>Sun, 13 Nov 2011 15:40:00 +0000</pubDate><atom:updated>2011-11-13T07:41:31.517-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">intercepting filter</category><category domain="http://www.blogger.com/atom/ns#">Filters in java</category><title>Intercepting Filter – Core J2EE design patterns</title><description>&lt;div class="MsoNormal"&gt;&lt;b style="background-color: white; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 11px;"&gt;What Intercepting Filter does?&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="background-color: white; line-height: 11px;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;The&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="emph"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;Intercepting Filter&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;span style="float: none;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;pattern wraps existing application resources with a filter that intercepts the reception of a request and the transmission of a response. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;What is the need of Intercepting Filter?&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: white; line-height: 115%; margin-bottom: 5.75pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; vertical-align: baseline;"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Consider a scenario, I your web application you want to check session from the every users request and if it is valid then only you want to let the user access the page. You can achieve this by checking sessions on all the servlet pages (or JSP pages) which users queries or you can do this by using Filter. In a filter you can write the logic to not enter the user without a valid session.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;ie: An intercepting filter can pre-process or redirect application requests, and can post-process or replace the content of application responses. Intercepting filters can also be stacked one on top of the other to add a chain of separate, declaratively-deployable services to existing Web resources with no changes to source code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;Example for Intercepting Filter:&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;code&gt;&lt;/code&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;import java.io.IOException;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;import java.util.Date;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;import javax.servlet.Filter;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;import javax.servlet.FilterChain;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;import javax.servlet.FilterConfig;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;import javax.servlet.ServletException;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;import javax.servlet.ServletRequest;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;import javax.servlet.ServletResponse;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;import javax.servlet.http.HttpServletRequest;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;public class LogFilter implements Filter {&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; public void doFilter(ServletRequest req, ServletResponse res,&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FilterChain chain) throws IOException, ServletException {&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; HttpServletRequest request = (HttpServletRequest) req;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Get the IP address of client machine.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String ipAddress = request.getRemoteAddr();&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Log the IP address and current timestamp.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("IP "+ipAddress + ", Time "&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; + new Date().toString());&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; chain.doFilter(req, res);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; public void init(FilterConfig config) throws ServletException {&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Get init parameter&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String testParam = config.getInitParameter("test-param");&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Print the init parameter&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println("Test Param: " + testParam);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; public void destroy() {&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //add code to release any resource&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;Advantages:&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;Centralizes Control with Loosely Coupled Handlers:&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;Filters provide a central place for handling processing across multiple requests, as does a controller. Filters are better suited to massaging requests and responses for ultimate handling by a target resource, such as a controller. Additionally, a controller often ties together the management of numerous unrelated common services, such as authentication, logging, encryption, and so forth, while filtering allows for much more loosely coupled handlers, which can be combined in various combinations.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial;"&gt;&lt;span class="Apple-style-span" style="line-height: 115%;"&gt;Improves&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: 18px;"&gt;Re-usability:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;Filters promote cleaner application partitioning and encourages reuse. These pluggable interceptors are transparently added or removed from existing code, and due to their standard interface, they work in any combination and are reusable for varying presentations.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;b&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Declarative and Flexible Configuration:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: white; color: #0b5394; font-family: Georgia, 'Times New Roman', serif; line-height: 18px;"&gt;Numerous services are combined in varying permutations without a single recompile of the core code base.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;Disadvantages:&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span class="apple-style-span"&gt;&lt;span style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;Information Sharing is Inefficient: &lt;/b&gt;Sharing information between filters can be inefficient, since by definition each filter is loosely coupled. If large amounts of information must be shared between filters, then this approach may prove to be costly.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-7640199651300133127?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/rYbCIBjwWwA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/rYbCIBjwWwA/intercepting-filter-core-j2ee-design.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><thr:total>1</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/11/intercepting-filter-core-j2ee-design.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-8712197716973640870</guid><pubDate>Sat, 12 Nov 2011 14:47:00 +0000</pubDate><atom:updated>2012-02-10T10:34:35.749-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">DAO</category><category domain="http://www.blogger.com/atom/ns#">view helper</category><category domain="http://www.blogger.com/atom/ns#">JEE core design patterns</category><category domain="http://www.blogger.com/atom/ns#">Design Patterns</category><category domain="http://www.blogger.com/atom/ns#">J2EE design patterns</category><category domain="http://www.blogger.com/atom/ns#">Intercepting Filte</category><category domain="http://www.blogger.com/atom/ns#">Session Facade</category><category domain="http://www.blogger.com/atom/ns#">Front Controller</category><category domain="http://www.blogger.com/atom/ns#">Business Deligate</category><category domain="http://www.blogger.com/atom/ns#">Service to worker</category><title>J2EE Design Patterns</title><description>&lt;div class="MsoNormal"&gt;
&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Recent times I have tried to look into the J2EE design patterns, as I am gaining the experience in Java development it is necessary the I should have complete Idea on the J2EE design patterns. Here I am planning to share my understanding, key points that I believe most important for normal java developer.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Most of J2EE/JEE based applications has the Presentation layer (which is visible to the user), Business Layer (which has the business components implementation) and Integration Layer (which integrates with other systems or databases). So, the people have classified the J2EE design patterns in to three types as below:&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;Presentation tier Patterns:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;a href="http://mallikarjungunda.blogspot.com/2011/11/intercepting-filter-core-j2ee-design.html" target="_blank"&gt;Intercepting Filter&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Front Controller&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Service to Worker&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;View Helper&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Composite View&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Dispatcher View&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;Business Tier Patterns:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Business Delegate&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Service Locator&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Session Façade&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Value List Handler&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Business Object&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Composite Entity&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;Integration tier patterns:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Data Access Object&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Service Activator&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Web Service Broker&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;Domain Service&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div class="MsoNormal"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;I have listed the most of the design patterns above which I feel more important. Most of the design patters depends on one or more, so implementation of a complete J2EE based and good architecture enterprise application requires all the design patters listed above.&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;Design pattern definition:&lt;/b&gt; A design pattern describes a proven solution, from experienced hands, for a recurring design problem. These solutions are very generic. They are described in well-defined Pattern Templates, with the most popular template defined by the&amp;nbsp;Gang of four. F&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;or a recurring problem there would be a single solution in a single context ie. There would be none other than one solution for single problem in a single context.&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal"&gt;
&lt;span class="Apple-style-span" style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-8712197716973640870?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/AhDAB_AXl4g" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/AhDAB_AXl4g/j2ee-design-patterns.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><thr:total>0</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/11/j2ee-design-patterns.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-8074792375997865234</guid><pubDate>Mon, 07 Nov 2011 15:02:00 +0000</pubDate><atom:updated>2012-02-10T10:30:24.557-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">The happiest kid</category><category domain="http://www.blogger.com/atom/ns#">A kid smile</category><title>Cute Smile</title><description>&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-zQ79TudZfdQ/Trf1fu5wZwI/AAAAAAAABIQ/Wc4jrybLLrM/s1600/P071011_1423%255B02%255D.jpg" imageanchor="1"&gt;&lt;img border="0" height="640" src="http://4.bp.blogspot.com/-zQ79TudZfdQ/Trf1fu5wZwI/AAAAAAAABIQ/Wc4jrybLLrM/s1600/P071011_1423%255B02%255D.jpg" width="480" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-8074792375997865234?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/kMxiUyFv04A" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/kMxiUyFv04A/cute-smile.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><media:thumbnail url="http://4.bp.blogspot.com/-zQ79TudZfdQ/Trf1fu5wZwI/AAAAAAAABIQ/Wc4jrybLLrM/s72-c/P071011_1423%255B02%255D.jpg" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/11/cute-smile.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-6507154547593287142</guid><pubDate>Sat, 05 Nov 2011 18:23:00 +0000</pubDate><atom:updated>2011-11-05T11:24:21.102-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Arrange an array in ascending and descending order</category><category domain="http://www.blogger.com/atom/ns#">working with an array in java</category><category domain="http://www.blogger.com/atom/ns#">array sorting in java</category><category domain="http://www.blogger.com/atom/ns#">array sorting</category><title>Sorting of int values in an array</title><description>&lt;code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;package com.classes;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;public class ManualSorting {&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;int[] arr = { 12, 1, 3, 22, 222, -9 };&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;public void ascendingOrder() {&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;for (int i = 0; i &amp;lt; arr.length; i++) {&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;for (int j = i + 1; j &amp;lt; arr.length; j++) {&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;int temp = 0;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;if (arr[i] &amp;lt; arr[j]) {&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;temp = arr[j];&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;arr[j] = arr[i];&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;arr[i] = temp;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;System.out.print(arr[i] + " ,");&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;System.out.println();&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;public void descendingOrder() {&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;for (int i = 0; i &amp;lt; arr.length; i++) {&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;for (int j = i + 1; j &amp;lt; arr.length; j++) {&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;int temp = 0;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;if (arr[i] &amp;gt; arr[j]) {&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;temp = arr[j];&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;arr[j] = arr[i];&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;arr[i] = temp;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;System.out.print(arr[i] + " ,");&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;System.out.println();&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;public static void main(String arr[]) {&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;ManualSorting ms = new ManualSorting();&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;ms.ascendingOrder();&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;ms.descendingOrder();&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-6507154547593287142?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/KJyBQUjtM0k" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/KJyBQUjtM0k/sorting-of-int-values-in-array.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><thr:total>0</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/11/sorting-of-int-values-in-array.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-7801969136637216498</guid><pubDate>Sat, 22 Oct 2011 18:11:00 +0000</pubDate><atom:updated>2011-10-22T11:18:09.068-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">load propeties file in java</category><category domain="http://www.blogger.com/atom/ns#">Load properties using resource bundle</category><category domain="http://www.blogger.com/atom/ns#">How to read propeties file in java</category><title>Read Properties file in Java</title><description>&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Times, 'Times New Roman', serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;package com.test;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;import java.io.File;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;import java.io.FileInputStream;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;import java.io.IOException;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;import java.util.Enumeration;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;import java.util.Locale;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;import java.util.Properties;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;import java.util.ResourceBundle;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;public class ReadPropetiesFile {&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;public static void main(String a[]){&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;String fileName = "test.properties";&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;ReadPropetiesFile readProp = new ReadPropetiesFile();&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;readProp.readProperties(fileName);&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;public void readProperties(String fileName){&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;try {&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;ResourceBundle labels = ResourceBundle.getBundle(fileName, Locale.ENGLISH);&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;Enumeration bundleKeys = labels.getKeys();&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;while (bundleKeys.hasMoreElements()) {&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt; &amp;nbsp; &amp;nbsp;String key = (String)bundleKeys.nextElement();&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt; &amp;nbsp; &amp;nbsp;String value = labels.getString(key);&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt; &amp;nbsp; &amp;nbsp;System.out.println("key = " + key + ", " + &amp;nbsp; "value = " + value);&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;}&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;}catch (Exception e) {&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;e.printStackTrace();&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: #3d85c6; font-family: Times, 'Times New Roman', serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-7801969136637216498?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/xYP6gApfUQE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/xYP6gApfUQE/read-properties-file-in-java.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><thr:total>0</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/10/read-properties-file-in-java.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-297683572159807477</guid><pubDate>Sun, 25 Sep 2011 15:20:00 +0000</pubDate><atom:updated>2011-09-25T08:20:30.747-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Indian flag</category><title>More Natural photo....</title><description>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-q-onDyo9W9c/Tn9GThGLLxI/AAAAAAAAA7U/HotAcNLGGIw/s1600/082120112660.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="480" src="http://3.bp.blogspot.com/-q-onDyo9W9c/Tn9GThGLLxI/AAAAAAAAA7U/HotAcNLGGIw/s640/082120112660.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-297683572159807477?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/o3nIR9kebYQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/o3nIR9kebYQ/more-natural-photo.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><media:thumbnail url="http://3.bp.blogspot.com/-q-onDyo9W9c/Tn9GThGLLxI/AAAAAAAAA7U/HotAcNLGGIw/s72-c/082120112660.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/09/more-natural-photo.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-5924385244006491945</guid><pubDate>Sun, 17 Jul 2011 16:53:00 +0000</pubDate><atom:updated>2011-07-17T10:22:05.283-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">cross browser compatability issues</category><category domain="http://www.blogger.com/atom/ns#">browser compatability issues</category><category domain="http://www.blogger.com/atom/ns#">developing applications for different browsers</category><title>How to fix browser compatibility issues?</title><description>&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;A normal developer never cares about the executing the application in different browsers while developing the application and he might doesn’t know that he will get lot of issues once the development is completed. This causes a big headache to him after completion of the application as he gets more number of cross browser compatibility issues and he can’t fix those instantly.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;Fixing the cross browser compatibility issues after completion of the project is night mare for the developer. He has to start fixing the issues from the starting stage of the application development.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;Below is the small discussion to fix the browser compatibility issues for different browsers like Chrome, Internet Explorer and Mozilla Firefox.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;b&gt;&lt;span style="font-size: small;"&gt;Mozilla Firefox:&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;The excellent feature that Firefox has is the add-ons. There are lot of add-ons you can add to Firefox in which Fire-Bug is the best add-on to fix the issues in applications while running in&amp;nbsp; the Firefox browser. When you install the fire bug add-on, one bug icon displayed on the right-bottom corner of the browser.&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;Once you open your application in firefox and click on the bug icon, you will see a window which contains html source code as shown in the below screenshot. The developer has to analyze the code which display on the firebug window and has to fix the issues.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt; The error console (Ctrl+sift+J gives the error console) of the firefox browser contains the java script errors in the site. Developer has to fix those errors by analyzing and debugging the JavaScript code.&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;Developer can fix the css related issues by modifying the css classes in the fire bug window.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;You can view the fire bug window by just pressing the button F12.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: small;"&gt;You can read more about the Fire bug on&amp;nbsp;&lt;b&gt;&lt;a href="http://getfirebug.com/whatisfirebug"&gt;http://getfirebug.com/whatisfirebug&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt; &lt;/span&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-3Vo0c0OQBK0/TiMUsGaoUuI/AAAAAAAAAow/M-Gik8IOV0A/s1600/mozilla.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-3Vo0c0OQBK0/TiMUsGaoUuI/AAAAAAAAAow/M-Gik8IOV0A/s1600/mozilla.bmp" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;Internet Explorer:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;Microsoft is providing the developer tool along with the Internet explorer to analyze the issues in the IE. Once the proper analysis is done by the developer and he can fix the issues by updating the changes in javascript code or css classes.&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;Below screen shot shows the Internet Explorer developer tool. You can open this by going to Tools --&amp;gt; Developer Tools or by simple pressing the key F12.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: small;"&gt;You can read more on Internet Explorer developer tools on &lt;a href="http://petelepage.com/blog/2010/06/internet-explorer-developer-tools/"&gt;http://petelepage.com/blog/2010/06/internet-explorer-developer-tools/&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-WrCAU-gDDnk/TiMVoranO8I/AAAAAAAAAo0/jA_3bWPrkbw/s1600/IE+image.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-WrCAU-gDDnk/TiMVoranO8I/AAAAAAAAAo0/jA_3bWPrkbw/s1600/IE+image.bmp" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;Google Chrome:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;By clicking on F12 button, you can open the Developer tool in the Chrome browser. Below screen shot shows the code analyzer of the Chrome browser.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: small;"&gt;You can read more on Chrome Developer tools on&amp;nbsp;&lt;a href="http://code.google.com/chrome/devtools/docs/overview.html"&gt;http://code.google.com/chrome/devtools/docs/overview.html&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Lf6Efmvm59w/TiMWvUqMobI/AAAAAAAAAo4/VFk5sacNBZk/s1600/chrome.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-Lf6Efmvm59w/TiMWvUqMobI/AAAAAAAAAo4/VFk5sacNBZk/s1600/chrome.bmp" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
I thought most of the cross browser issues comes with the javascript errors or javascript un supported methods in the browsers. If the developer cares about the javascript predefined functions while development, he can remove more number of cross browser issues.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-5924385244006491945?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/E8SF8BY_hOE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/E8SF8BY_hOE/how-to-fix-browser-compatibility-issues.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><media:thumbnail url="http://1.bp.blogspot.com/-3Vo0c0OQBK0/TiMUsGaoUuI/AAAAAAAAAow/M-Gik8IOV0A/s72-c/mozilla.bmp" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/07/how-to-fix-browser-compatibility-issues.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-2109673303594093009</guid><pubDate>Sun, 26 Jun 2011 12:46:00 +0000</pubDate><atom:updated>2011-06-26T06:04:32.404-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Colorful life</category><title>Make the life more colorful....</title><description>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;Colors are more important part of life. There are lot of colors with the combination of three major colors. Every one the world likes colors in their own way and for me, White and skyblue are favorite. Sometimes I like black too, most of my dresses are black, my shoes are black and my mobile is also black.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;Here I am going to tell about the White color...&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;White is a symbol for peace and if you look into white for some time, your mindset will become more tension free. I think most of we choose White color for walls on that psychological reason.&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;img border="0" height="640" src="http://3.bp.blogspot.com/-pOHzvtx9VWg/Tgcp6VYxHRI/AAAAAAAAAnA/N7sGPMZjduc/s640/MoreColorfullife.JPG" width="552" /&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;span style="color: #0b5394;"&gt;So, bring more white color into your life from the black.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-qWuNvGqsN7E/Tgcp7BQaCNI/AAAAAAAAAnE/v7ap0cvJ4Sc/s1600/colorfullife.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" src="http://2.bp.blogspot.com/-qWuNvGqsN7E/Tgcp7BQaCNI/AAAAAAAAAnE/v7ap0cvJ4Sc/s640/colorfullife.JPG" width="552" /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span style="color: #0b5394; font-size: small;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;Below is the small collection on colorful life from the web... &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-f3mFOrpLXF0/Tgcp704Z3rI/AAAAAAAAAnI/oq7kk6bW5Ks/s1600/coloured.turbans.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="454" src="http://3.bp.blogspot.com/-f3mFOrpLXF0/Tgcp704Z3rI/AAAAAAAAAnI/oq7kk6bW5Ks/s640/coloured.turbans.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-2109673303594093009?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/9MLOzNZBd3g" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/9MLOzNZBd3g/make-life-more-colorful.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><media:thumbnail url="http://3.bp.blogspot.com/-pOHzvtx9VWg/Tgcp6VYxHRI/AAAAAAAAAnA/N7sGPMZjduc/s72-c/MoreColorfullife.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/06/make-life-more-colorful.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-3167955751622384062</guid><pubDate>Sat, 25 Jun 2011 16:27:00 +0000</pubDate><atom:updated>2011-06-25T09:43:18.207-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Real happiness</category><title>Real Happiness - Nothing to write ... :)</title><description>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-IUPi-UhCvBI/TgYMLn5a7gI/AAAAAAAAAcw/drUR6Telfa0/s1600/P280511_0928%255B01%255D.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="480" src="http://4.bp.blogspot.com/-IUPi-UhCvBI/TgYMLn5a7gI/AAAAAAAAAcw/drUR6Telfa0/s640/P280511_0928%255B01%255D.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-3167955751622384062?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/3R-LS6TBrr4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/3R-LS6TBrr4/real-happiness.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><media:thumbnail url="http://4.bp.blogspot.com/-IUPi-UhCvBI/TgYMLn5a7gI/AAAAAAAAAcw/drUR6Telfa0/s72-c/P280511_0928%255B01%255D.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/06/real-happiness.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-126837606647578813</guid><pubDate>Sun, 22 May 2011 06:31:00 +0000</pubDate><atom:updated>2012-02-10T10:37:01.063-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Servlets</category><category domain="http://www.blogger.com/atom/ns#">Constructor</category><category domain="http://www.blogger.com/atom/ns#">Java Servlets</category><category domain="http://www.blogger.com/atom/ns#">Servlet Implimentation</category><title>The Servlet init Vs Constructor</title><description>&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal; margin: 0in 0in 0.0001pt 0.5in; text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;Generally Servlets don’t have the Constructor, because a servlet is just like an applet in the respect that it has an init() method that acts as a constructor, an initialization code you need to run should be place in the init(), since it get called when the servlet is first loaded.&lt;/span&gt;&lt;/div&gt;
&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal; margin: 0in 0in 0.0001pt 0.5in; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal; margin: 0in 0in 0.0001pt 0.5in; text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;You cann’t use a Constructor instead of init() method to initialize a servlet.The original reason for init() was that ancient versions of Java couldn’t dynamically invoke constructors with arguments, so there was no way to give the constructor a ServletConfig. That no longer applies, but servlet containers still will only call your no-arg constructor. So you won’t have access to a ServletConfig or ServletContext.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: small;"&gt;Even while you trying to override the init() method you should pass the argument a ServletContext object because the container passes the ServletConfig object to the servlet only when it calls the init method. So ServletConfig will not be accessible in the constructor. &lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-126837606647578813?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/xsZ7MUIHR1Y" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/xsZ7MUIHR1Y/servlet-init-vs-constructor.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><thr:total>3</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/05/servlet-init-vs-constructor.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-4406786387403428498</guid><pubDate>Sat, 21 May 2011 18:57:00 +0000</pubDate><atom:updated>2012-02-10T10:37:50.434-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Servlets</category><category domain="http://www.blogger.com/atom/ns#">Java Servlets</category><category domain="http://www.blogger.com/atom/ns#">Servlet Life Cycle</category><title>Servlet Life Cycle</title><description>&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal; margin: 0in 0in 0.0001pt 0.5in; text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;A servlet is a small Java program that runs within a Web server. Servlets receive and respond to requests from Web clients, usually across HTTP, the HyperText Transfer Protocol. &lt;/span&gt;&lt;/div&gt;
&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal; margin: 0in 0in 0.0001pt 0.5in; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal; margin: 0in 0in 0.0001pt 0.5in; text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;The methods which are used to initialize a servlet, to service requests, and to remove a servlet from the server are called servlet life cycle methods. These are three methods namely&lt;b&gt; init(), service(), destroy(). &lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal; margin: 0in 0in 0.0001pt 0.5in; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal; margin: 0in 0in 0.0001pt 0.5in; text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;&lt;b&gt;&lt;u&gt;Init():&lt;/u&gt; &lt;/b&gt;The servlet container calls the &lt;code&gt;init&lt;/code&gt; method exactly once after instantiating the servlet. The &lt;code&gt;init&lt;/code&gt; method must complete successfully before the servlet can receive any requests&lt;/span&gt;&lt;/div&gt;
&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal; margin: 0in 0in 0.0001pt 0.5in; text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;It Contains all information code for servlet and is invoked when the servlet is first loaded. &lt;/span&gt;&lt;/div&gt;
&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal; margin: 0in 0in 0.0001pt 0.5in; text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;You can override this method to write initialization code that needs to run only once, such as loading a driver, initializing values and soon, another case you can leave normally blank. &lt;/span&gt;&lt;/div&gt;
&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal; margin: 0in 0in 0.0001pt 0.5in; text-align: left;"&gt;
&lt;br /&gt;
&lt;span style="font-size: small;"&gt;public void init(&lt;span style="text-decoration: none;"&gt;ServletConfig&lt;/span&gt;&amp;nbsp;config)throws &lt;span style="text-decoration: none;"&gt;ServletException&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal; margin: 0in 0in 0.0001pt 0.5in; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;"&gt;
&lt;/div&gt;
&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal; margin: 0in 0in 0.0001pt 0.5in; text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;&lt;b&gt;&lt;u&gt;Service()&lt;/u&gt;&lt;/b&gt; : is called by the Servlet container after the init method to allow the servlet to respond to a request. Service method receives the request from the client and identifies the type of request and delegates them to doGet() or doPost() for processing.&lt;/span&gt;&lt;/div&gt;
&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal; margin: 0in 0in 0.0001pt 0.5in; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal; margin: 0in 0in 0.0001pt 0.5in; text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;public void service(ServletRequest request,ServletResponce response) throws ServletException,&amp;nbsp; IOException &lt;/span&gt;&lt;/div&gt;
&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal; margin: 0in 0in 0.0001pt 0.5in; text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;&lt;b&gt;&lt;u&gt;&lt;span style="text-decoration: none;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal; margin: 0in 0in 0.0001pt 0.5in; text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;&lt;b&gt;&lt;u&gt;Destroy()&lt;/u&gt;&lt;/b&gt; : The Servlet Container calls the destroy( ) before removing a Servlet Instance from Sevice. Executes only once when the Servlet is removed from Server. &lt;/span&gt;&lt;/div&gt;
&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal; margin: 0in 0in 0.0001pt 0.5in; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal; margin: 0in 0in 0.0001pt 0.5in; text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;public void destroy()&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="color: red;"&gt;
&lt;span style="font-size: small;"&gt;&lt;a href="http://mallikarjungunda.blogspot.com/2011/05/java-servlets.html"&gt;&lt;b&gt;Click here&lt;/b&gt;&lt;/a&gt; to know about Servlets &lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-4406786387403428498?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/vBijNgT0RNA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/vBijNgT0RNA/servlet-life-cycle.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><thr:total>0</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/05/servlet-life-cycle.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-2328922243456238401</guid><pubDate>Sat, 21 May 2011 13:54:00 +0000</pubDate><atom:updated>2012-02-10T10:39:55.550-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Servlets</category><category domain="http://www.blogger.com/atom/ns#">Generic Servlet</category><category domain="http://www.blogger.com/atom/ns#">Java Servlets</category><category domain="http://www.blogger.com/atom/ns#">Http Servlet</category><category domain="http://www.blogger.com/atom/ns#">Servlet Implimentation</category><category domain="http://www.blogger.com/atom/ns#">Servlet Basics</category><category domain="http://www.blogger.com/atom/ns#">Difference between GenericServlet and HttpServlet</category><title>Java Servlets</title><description>&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: justify;"&gt;
&lt;span style="font-size: small;"&gt;&lt;b&gt;&lt;i&gt;Servlet&lt;/i&gt; &lt;/b&gt;is a Java class used to extend the capabilities of servers that host applications accessed via a request-response programming model. Although servlets can respond to any type of request(like HTTP, FTP), they are commonly used to extend the applications hosted by Web servers.&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style="font-size: small;"&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: justify;"&gt;
&lt;span style="font-size: small;"&gt;&lt;span style="line-height: 115%;"&gt;Servlets runs at Server side typically Web Server or Application server, and respond to request by giving the response to user after processing the request.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style="font-size: small;"&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: justify;"&gt;
&lt;span style="font-size: small;"&gt;&lt;span style="line-height: 115%;"&gt;A servlet that implements SingleThreadModel means that for every request, a single servlet instance is created. This implementation helps in implementing the business applications like bank transactions.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style="font-size: small;"&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: justify;"&gt;
&lt;span style="font-size: small;"&gt;&lt;span style="line-height: 115%;"&gt;A multi-threaded servlet means that one servlet is capable of handling many requests which is the way most servlets should be implemented. This allows servlets to support systems such as on-line conferencing.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style="font-size: small;"&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: justify;"&gt;
&lt;span style="font-size: small;"&gt;&lt;span style="line-height: 115%;"&gt;A servlet can handle multiple requests concurrently, and can synchronize requests. Servlets can forward requests to other servers and servlets.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style="font-size: small;"&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoBodyText3" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;span style="font-size: small;"&gt;As Servlet are written in java, they can make use of extensive power of the JAVA API,such as networking and URL access, multithreading, databaseconnectivity, RMI object serialization.&lt;/span&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;A Servlet implementation can be done in three ways:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif; font-size: small;"&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;ol style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;/span&gt;By implementing the Sevlet interface into your class. The class which implementing the Servlet interface, should implement all the servlet life cycle methods defined in the Servlet interface.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;/span&gt;By writing a subclass to GenricServlet present in the javax.servlet package. The subclass must override the abstract service method present in the Generic servlet class.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;/span&gt;By writing a subclass to HttpServlet present in javax.servlet.http package. The subclass of HttpServlet must override any of the methods in &lt;span style="line-height: 115%;"&gt;doGet(), doPost(), doDelete(), doPut(), init(), destroy(), getServletInfo().&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style="font-size: small;"&gt;  &lt;/span&gt;    &lt;br /&gt;
&lt;div class="MsoListParagraphCxSpLast" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;span style="font-size: small;"&gt;In general most of the cases Servlet implementation can done by sub classing to GenericServlet or HttpServlet.&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-size: small;"&gt;  &lt;/span&gt;&lt;b&gt;&lt;span style="color: #0b5394; font-family: Georgia, 'Times New Roman', serif; font-size: small;"&gt;Below are the differences between HttpServlet and GenericServlet:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ol style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;HttpServlet is the subclass of GenericServlet.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;Generic Servlet defines a generic, protocol-independent servlet. HttpServlet &lt;span style="line-height: 115%;"&gt;provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="line-height: 115%;"&gt;A sub class which extends GenericServlet must implement the abstract service() method. A subclass of &lt;/span&gt;&lt;span style="line-height: 115%;"&gt;HttpServlet&lt;/span&gt;&lt;span style="line-height: 115%;"&gt; must override at least one method, usually one of these: doGet(), doPost(), doDelete(), doPut(), init(), destroy(), getServletInfo().&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div style="color: red; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style="font-size: small;"&gt;&lt;span style="line-height: 115%;"&gt;&lt;span style="color: red; font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;a href="http://mallikarjungunda.blogspot.com/2011/05/servlet-life-cycle.html"&gt;&lt;b&gt;Click here &lt;/b&gt;&lt;/a&gt;to know Servlet Life cycles&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;  &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-2328922243456238401?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/bqQhpLGS4PA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/bqQhpLGS4PA/java-servlets.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><thr:total>0</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/05/java-servlets.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-7347289219466618453</guid><pubDate>Sat, 21 May 2011 11:38:00 +0000</pubDate><atom:updated>2011-05-21T05:04:37.493-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">java abstract class</category><category domain="http://www.blogger.com/atom/ns#">Abstact class in java</category><title>Abstract class in Java</title><description>&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;/div&gt;&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;Abstract class is class w&lt;/span&gt;&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;hich  has more than one abstract method which doesn’t  have method body but at  least one of its methods need to be implemented&amp;nbsp;  in derived Class.&lt;/span&gt;&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;Abstract classes can be used to implement the inheritance relationship between the classes that belongs &lt;i&gt;same&lt;/i&gt; hierarchy.&lt;/span&gt;&lt;br /&gt;
&lt;ol style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Classes and methods can be declared as abstract.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="-moz-font-feature-settings: normal; -moz-font-language-override: normal; font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;/span&gt;Abstract class can extend &lt;i&gt;only one&lt;/i&gt; Class.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="-moz-font-feature-settings: normal; -moz-font-language-override: normal; font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;/span&gt;If a Class is declared as abstract , no &lt;i&gt;instance&lt;/i&gt; of that class can be created.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="-moz-font-feature-settings: normal; -moz-font-language-override: normal; font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;/span&gt;If a method is declared as abstract, the sub class gives the &lt;i&gt;implementation&lt;/i&gt; of that class.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="-moz-font-feature-settings: normal; -moz-font-language-override: normal; font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;/span&gt;Even if a single method is declared as abstract in a Class ,&amp;nbsp; the class itself&amp;nbsp; can be declared as abstract.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="-moz-font-feature-settings: normal; -moz-font-language-override: normal; font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;/span&gt;Abstract class have at least &lt;i&gt;one&lt;/i&gt; abstract&amp;nbsp; method and others may be concrete.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="-moz-font-feature-settings: normal; -moz-font-language-override: normal; font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;/span&gt;In abstract Class the &lt;i&gt;keyword abstract&lt;/i&gt; must be used for method.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="-moz-font-feature-settings: normal; -moz-font-language-override: normal; font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&lt;/span&gt;Abstract classes have &lt;i&gt;sub &lt;/i&gt;classes.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;Combination of modifiers &lt;i&gt;Final and&lt;/i&gt; &lt;i&gt;Abstract&lt;/i&gt; is illegal in java.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: justify;"&gt;&lt;span style="font-size: small;"&gt;The general form of abstract class is :&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: justify;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;&lt;i&gt;abstract type name (parameter list);&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: justify;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: justify;"&gt;&lt;span style="font-size: small;"&gt;The &lt;code&gt;Number&lt;/code&gt; class in the &lt;code&gt;java.lang&lt;/code&gt; package represents the abstract concept of numbers. It makes sense to model numbers in a program, but it doesn't make sense to create a generic number object.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: small;"&gt;Sample Abstract Classes: HttpServlet, GenericServlet&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://mallikarjungunda.blogspot.com/2011/05/interface-in-java.html"&gt;&lt;span style="font-size: small;"&gt;You can more avout Interface here&amp;nbsp;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;a href="http://mallikarjungunda.blogspot.com/2010/07/difference-between-abstract-class-and.html"&gt;Click here for Difference between Abstract class and Iterface&lt;/a&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: justify;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-7347289219466618453?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/GHUEEsfOjxA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/GHUEEsfOjxA/abstract-class-in-java.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><thr:total>0</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/05/abstract-class-in-java.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-267741316600650841</guid><pubDate>Sat, 21 May 2011 11:21:00 +0000</pubDate><atom:updated>2011-05-21T05:06:30.820-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Abstract class and Interface</category><category domain="http://www.blogger.com/atom/ns#">Java Interface</category><title>Interface in Java</title><description>&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;Interfaces can be used to implement the Inheritance relationship between the non-related classes that do not belongs to the same hierarchy, i.e. any Class and any where in hierarchy.&amp;nbsp; Using Interface, you can specify what a class must do but not how it does.&lt;/span&gt;&lt;br /&gt;
&lt;ol style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;A class can implement more than one Interface.&lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt; &lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;An Interface can extend one or more interfaces, by using the keyword &lt;i&gt;extends&lt;/i&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt; &lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;All the data members in the interface are public, static and Final by default.&lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt; &lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;An Interface method can have only Public, default and Abstract modifiers.&lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt; &lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;An Interface is loaded in memory only when it is needed for the first time.&lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt; &lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;A Class, which implements an Interface, needs to provide the implementation of all the methods in that Interface.&lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt; &lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;If the Implementation for all the methods declared in the Interface are not provided , the class itself has to declare &lt;i&gt;abstract&lt;/i&gt;, other wise the Class will not compile.&lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt; &lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;If a class Implements two &lt;i&gt;interface&lt;/i&gt; and both the &lt;i&gt;Intfs &lt;/i&gt;have identical method &lt;i&gt;declaration&lt;/i&gt;, it is totally valid.&amp;nbsp; &lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt; &lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;If a class implements two interfaces both have identical method name and argument list, but different return types, the code will not compile.&lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt; &lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;An Interface can’t be instantiated. &lt;i&gt;Intf&lt;/i&gt; Are designed to support dynamic method resolution at run time.&lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt; &lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;An interface can not be native, static, synchronize, final, protected or private.&lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt; &lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;The Interface &lt;i&gt;fields&lt;/i&gt; can’t be Private or Protected.&lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt; &lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;A Transient variables and Volatile variables can not be members of&amp;nbsp; Interface.&lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt; &lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;The extends keyword should not used after the Implements keyword, the Extends must always come before the Implements keyword.&lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt; &lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;A top level Interface can not be declared as static or final.&lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt; &lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;If an Interface species an exception list for a method, then the&amp;nbsp; class implementing the interface need not declare the method with&amp;nbsp; the exception list.&lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt; &lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="-moz-font-feature-settings: normal; -moz-font-language-override: normal; font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&lt;/span&gt;If an Interface can’t specify an exception list for a method, the class can’t throw an exception. &lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt; &lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;span style="-moz-font-feature-settings: normal; -moz-font-language-override: normal; font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;"&gt;&amp;nbsp;&lt;/span&gt;If an Interface does not specify the exception list for a method, the class can not throw any exception list.&lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;/ol&gt;&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;The general form of Interface is &lt;/span&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;br style="color: #0b5394;" /&gt;&lt;/span&gt;&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;b&gt;&lt;i&gt;Access interface name {&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;br style="color: #0b5394;" /&gt;&lt;/span&gt;&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;b&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return-type method-name1(parameter-list);&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;br style="color: #0b5394;" /&gt;&lt;/span&gt;&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;b&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type final-varname1=value;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;br style="color: #0b5394;" /&gt;&lt;/span&gt;&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;b&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;br style="color: #0b5394;" /&gt;&lt;/span&gt;&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;-----------------------&lt;/span&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;br style="color: #0b5394;" /&gt;&lt;/span&gt;&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;b&gt;&lt;i&gt;Marker Interfaces : &lt;/i&gt;&lt;/b&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;Serializable, Clonable, Remote, EventListener&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;Marker Interface is an Interface which does not have any method declarations. They are used to mark/tag the nature of the class.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;a href="http://mallikarjungunda.blogspot.com/2011/05/abstract-class-in-java.html"&gt;Click here&lt;/a&gt; to More about Abstract class&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;a href="http://mallikarjungunda.blogspot.com/2010/07/difference-between-abstract-class-and.html"&gt;Click here&lt;/a&gt; for more about Difference between Abstract class and Interface&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-267741316600650841?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/G4SfCEcLODM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/G4SfCEcLODM/interface-in-java.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><thr:total>0</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/05/interface-in-java.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-8120353726717985287</guid><pubDate>Sat, 21 May 2011 10:29:00 +0000</pubDate><atom:updated>2011-05-21T03:42:45.369-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">The Real Beauty...</category><title>Need of Real beauty to my second part of my life</title><description>&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal;"&gt;&lt;span style="font-size: small;"&gt;I am in need of a Real Beauty to be with me in my second part of the life as I have going to cross my bachelor life. At this point i am very happy to share my views about My Real beauty. The real beauty is not just a human being; it might be the place, object, animal etc… Here I am going to write about a beautiful lady, who should have real beauty characteristics to become part of my life.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://realbeauty.yahoo.com/" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;" title="Dove Real Beauty on Yahoo! India"&gt;&lt;br /&gt;
&lt;img alt="Dove Real Beauty on Yahoo! India" border="0" src="http://www.indiblogger.in/badges/bigsquare_realbeauty.png" /&gt;&lt;/a&gt;&lt;span style="font-size: small;"&gt;I have used the word beauty on ladies by looking at their face so many times in the past. But once I decided to choose a real beauty as part of my life, then I used to think about how can I define a real beauty and &amp;nbsp;what a real beauty is?. Sometimes I found that it is a hard to define or describe about the beauty of women. But, after understanding of real beauty I would expecting few of the characters as part of my partner.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;span style="color: #0b5394;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal;"&gt;&lt;span style="font-size: small;"&gt;The concept of beauty, in fact, is different from person to person. Anyone can tell you their personal definition of beauty: who they think is beautiful and who isn’t.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;span style="color: #0b5394;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Small Definition of Beauty…..&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;span style="color: #0b5394;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal;"&gt;&lt;span style="font-size: small;"&gt;So what is Beauty? Beauty is a characteristic of a person, place, object or idea that provides a perceptual experience of pleasure, meaning or satisfaction. Beauty may occur in different form, physical beauty of female, inner beauty of kind man, graceful beauty of grandeur dame and even ordinary beauty of common people.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal;"&gt;&lt;/div&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;span style="color: #0b5394;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal;"&gt;&lt;span style="font-size: small;"&gt;As we seeing every day, beauty contests like Miss Universe and shows like Extreme Makeover, as well as People Magazine featuring the most beautiful people in the world. If we observe clearly the competitions, we can have a true definition of a real beauty?.The concept of these shows is, the competitors should have internal beauty including the external beauty. As per this assumption only winner will be decided.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;span style="color: #0b5394;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal;"&gt;&lt;span style="font-size: small;"&gt;So, beauty is just not a person face or person body structure; it is also a characteristic of a person.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;span style="color: #0b5394;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal;"&gt;&lt;span style="font-size: small;"&gt;True beauty doesn't need any kind of ornaments. It is a gift from God to Human beings. The person who gets blessed by nature gets blessed with precious beauty.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal;"&gt;&lt;/div&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;span style="color: #0b5394;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Expectations of My Real Beauty characters:&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;ul style="color: #0b5394;"&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;She should have well outside beauty like The Moon.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;She should have cool mind like an Ice.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;She should have a kindly heart like The Ocean.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;She should too kind like Mother.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;She should help to others like Tree.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;Her thoughts should be cleaner like Milk.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span style="font-size: small;"&gt;This is my view about the real beauty. Different persons will have different views. So, others might have not consider all these points.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; line-height: normal;"&gt;&lt;span style="font-size: small;"&gt;Thank you.&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;span style="color: #0b5394;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-8120353726717985287?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/ye5m_-Szclw" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/ye5m_-Szclw/need-of-real-beauty-to-share-my-second.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><thr:total>4</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/05/need-of-real-beauty-to-share-my-second.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-7910622915212398664</guid><pubDate>Wed, 18 May 2011 17:41:00 +0000</pubDate><atom:updated>2011-05-18T10:42:39.234-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java Singleton Design pattern</category><category domain="http://www.blogger.com/atom/ns#">What is a singleton class</category><category domain="http://www.blogger.com/atom/ns#">Singleton example in java</category><title>Java Singleton Design pattern</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;/div&gt;&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;A class which must create only one object (ie. One instance) irrespective of any number of object creations based on that class.&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;b&gt;&lt;span style="font-size: small;"&gt;Steps to develop single ton class:-&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; margin-left: 28.35pt; text-indent: -14.15pt;"&gt;&lt;span style="font-size: small;"&gt;1.Create a Private construcor, so that outside class can not access this constructor. And declare a private static reference of same class&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; margin-left: 28.35pt; text-indent: -14.15pt;"&gt;&lt;span style="font-size: small;"&gt;2.Write a public Factory method which creates an object. Assign this object to private static Reference and return the object&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; margin-left: 28.35pt;"&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; margin-left: 28.35pt;"&gt;&lt;b&gt;&lt;span style="font-size: small;"&gt;Sample Code:-&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;span style="color: #0b5394;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; margin-left: 28.35pt;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; margin-left: 28.35pt;"&gt;&lt;span style="font-size: small;"&gt;public class SingleTonExample&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: small;"&gt;&lt;span style="color: #0b5394;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; margin-left: 28.35pt;"&gt;&lt;span style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; margin-left: 42.5pt;"&gt;&lt;span style="font-size: small;"&gt;private static SingleTonExample st=null;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; margin-left: 42.5pt;"&gt;&lt;span style="font-size: small;"&gt;private SingleTonExample()&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; margin-left: 42.5pt;"&gt;&lt;span style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; margin-left: 56.7pt;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="MsoHyperlink" style="color: #0b5394;"&gt;&lt;a href="http://system.out.println/"&gt;System.out.println&lt;/a&gt;&lt;/span&gt;(“\nIn constructor”);&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; margin-left: 42.5pt;"&gt;&lt;span style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; margin-left: 42.5pt;"&gt;&lt;span style="font-size: small;"&gt;public static SingleTonExample getInstance()&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; margin-left: 42.5pt;"&gt;&lt;span style="font-size: small;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; margin-left: 56.7pt;"&gt;&lt;span style="font-size: small;"&gt;if(st==null)&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; margin-left: 70.85pt;"&gt;&lt;span style="font-size: small;"&gt;st=new SingleTonExample();&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; margin-left: 70.85pt; text-align: left;"&gt;&lt;span style="font-size: small;"&gt;return st;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; margin-left: 42.5pt; text-align: left;"&gt;&lt;span style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; margin-left: 28.35pt;"&gt;&lt;span style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; margin-left: 28.35pt;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;How to use the Singleton class created above is described in below class:&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;public class UsingSingletonClass{&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void testMethod(){&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SingleTonExample st = SingleTonExample.hetInstance();&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //you can use the SingleTonExample object st for your requirements &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;span style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-7910622915212398664?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/hxIKBZjeIjY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/hxIKBZjeIjY/java-singleton-design-pattern.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><thr:total>0</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/05/java-singleton-design-pattern.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3202269015126578615.post-8466180614918386776</guid><pubDate>Tue, 17 May 2011 17:58:00 +0000</pubDate><atom:updated>2011-05-17T10:59:51.561-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">java static variables and methods</category><category domain="http://www.blogger.com/atom/ns#">static method</category><category domain="http://www.blogger.com/atom/ns#">Static variables</category><title>More about Static variable &amp; Static method</title><description>&lt;div style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;/div&gt;&lt;div class="MsoBodyText" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-indent: 0.5in;"&gt;&lt;span style="font-size: small;"&gt;Static variables &amp;amp; methods are instantiated only once per class. In other words they are class variables,&amp;nbsp;&amp;nbsp; not instance variables. If you change the value of a static variable in a particular object, the value of that variable changes for all instances of that class.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoBodyText" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-indent: 0.5in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoBodyText" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-indent: 0.5in;"&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class="MsoBodyText" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-indent: 0.5in;"&gt;&lt;span style="font-size: small;"&gt;Static methods can be referenced with the name of the class. It may not access the instance variables of that class, only its static variables. Further it may not invoke instance (non-static) methods of that class unless it provides them with some object.&lt;span class="element1"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="element1"&gt;--&amp;gt; &lt;/span&gt;&lt;span class="element1"&gt;When a member is declared a static it can be accessed before any object of its class are created.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="element1"&gt;--&amp;gt; &lt;/span&gt;&lt;span class="element1"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;span class="element1"&gt;&lt;/span&gt;&lt;span class="element1"&gt;Instance variables declared as static are essentially global variables.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="element1"&gt;--&amp;gt; &lt;/span&gt;&lt;span class="element1"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;span class="element1"&gt;&lt;/span&gt;&lt;span class="element1"&gt;If you do not specify an initial value to an instance &amp;amp; Static variable a default value will be assigned&amp;nbsp;&amp;nbsp; automatically.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="element1"&gt;--&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;span class="element1"&gt;Methods declared as static have some restrictions they can access only static data, they can only call other static data, they cannot refer &lt;b&gt;this&lt;/b&gt; or &lt;b&gt;super&lt;/b&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="element1"&gt;--&amp;gt; &lt;/span&gt;&lt;span class="element1"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;span class="element1"&gt;&lt;/span&gt;&lt;span class="element1"&gt; &lt;/span&gt;Static methods cant be overriden to non-static methods.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="element1"&gt;--&amp;gt; &lt;/span&gt;&lt;span class="element1"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt; Static methods is called by the static methods only&lt;b&gt;, an ordinary method can call the static methods, but static methods cannot call ordinary methods.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="element1"&gt;--&amp;gt; &lt;/span&gt;&lt;span class="element1"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt; Static methods are implicitly "final", because overriding is only done based on the type of the objects&lt;span class="element1"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="element1"&gt;--&amp;gt; &lt;/span&gt;&lt;span class="element1"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;They cannot refer “this” are “super” in any way.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="color: #0b5394; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3202269015126578615-8466180614918386776?l=mallikarjungunda.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/cvBNv/~4/9H1tmevMC8c" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/cvBNv/~3/9H1tmevMC8c/more-about-static-variable-static.html</link><author>mallikarjungunda@gmail.com (Mallikarjun Gunda)</author><thr:total>0</thr:total><feedburner:origLink>http://mallikarjungunda.blogspot.com/2011/05/more-about-static-variable-static.html</feedburner:origLink></item><language>en-us</language><copyright>All rights are reserved @ IT EINSTEIN</copyright><media:credit role="author">Mallikarjun Gunda</media:credit><media:rating>nonadult</media:rating><media:description type="plain">IT EINSTEIN</media:description></channel></rss>

