<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CkYGSXg9fSp7ImA9WhRUE0U.&quot;"><id>tag:blogger.com,1999:blog-664651663704607214</id><updated>2012-01-23T20:42:08.665-08:00</updated><category term="Java Interview Questions" /><title>Learn Technical Skills</title><subtitle type="html">PHP: Core php, Drupal, Joomla, Zencart, Phpnuke Cakephp, Dolphin, Magento, Wordpress, CodeIgniter, Zend Framework, X-cart...

Java: Core Java, J2EE(Jsp, Servlet, Jdbc), Struts, Hibernate, Spring, Jsf. 
 
Database: MySql &amp;amp; Oracle.

JavaScript: Core javascript, Ajax, JQuery.

Others: Html, Xhtml, css, XML.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://vindeshmohariya.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://vindeshmohariya.blogspot.com/" /><author><name>vini@riya</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/LearnTechnicalSkills" /><feedburner:info uri="learntechnicalskills" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;C0QDRXs7eCp7ImA9WxVSF0Q.&quot;"><id>tag:blogger.com,1999:blog-664651663704607214.post-1429306912644980917</id><published>2009-01-12T12:13:00.000-08:00</published><updated>2009-01-12T12:16:14.500-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-12T12:16:14.500-08:00</app:edited><title>Validate Integer Number using JavaScript and regular expression</title><content type="html">function isValidNumber(num) {&lt;br /&gt; Regex = /(^[0-9]*$)/;&lt;br /&gt;    return Regex.test(num);&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/664651663704607214-1429306912644980917?l=vindeshmohariya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Vld4cvqD-sKiFGdqQ-H5dBlhy18/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Vld4cvqD-sKiFGdqQ-H5dBlhy18/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Vld4cvqD-sKiFGdqQ-H5dBlhy18/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Vld4cvqD-sKiFGdqQ-H5dBlhy18/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnTechnicalSkills/~4/Lq98Sm88000" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://vindeshmohariya.blogspot.com/feeds/1429306912644980917/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=664651663704607214&amp;postID=1429306912644980917" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/1429306912644980917?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/1429306912644980917?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnTechnicalSkills/~3/Lq98Sm88000/validate-integer-number-using.html" title="Validate Integer Number using JavaScript and regular expression" /><author><name>vini@riya</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://vindeshmohariya.blogspot.com/2009/01/validate-integer-number-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEECQHk9fSp7ImA9WxVSF0Q.&quot;"><id>tag:blogger.com,1999:blog-664651663704607214.post-4977752693199146251</id><published>2009-01-12T11:55:00.000-08:00</published><updated>2009-01-12T12:37:41.765-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-12T12:37:41.765-08:00</app:edited><title>Validate email address using JavaScript and regular expression</title><content type="html">&lt;small&gt;Check Email Address with JavaScript and Regular Expressions&lt;/small&gt;
&lt;br /&gt;&lt;div class="entry"&gt;
&lt;br /&gt;&lt;p&gt;Last month I wrote about &lt;a title="Java reg ex" href="http://www.zparacha.com/java_regex_validation/" target="_blank"&gt;regular expressions in Java&lt;/a&gt;, today I’ll show you how to use regular expression in JavaScript to validate email address.&lt;/p&gt;
&lt;br /&gt;&lt;p&gt;Here is the code to validate email address in JavaScript using regular expression.&lt;/p&gt;
&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 255);"&gt;function &lt;/span&gt;validateEmail(elementValue){      &lt;br&gt;var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; &lt;span style="font-weight: bold; color: rgb(0, 0, 255);"&gt;return &lt;/span&gt;emailPattern.test(elementValue); } &lt;/p&gt;
&lt;br /&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;h4 id="toc-explanation"&gt;Explanation:&lt;/h4&gt;
&lt;br /&gt;&lt;p&gt;The argument to this method is the email address you want to validate.    &lt;br&gt;In the method body we define a variable (’emailPattern’) and assign a regular expression to it.&lt;/p&gt;
&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Email format&lt;/strong&gt;: The regular expression for email is     &lt;/p&gt;
&lt;br /&gt;&lt;p&gt;&lt;span id="more-66"&gt;&lt;/span&gt;&lt;br&gt;
&lt;br /&gt; &lt;strong&gt;/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/&lt;/strong&gt;
&lt;br /&gt;&lt;/p&gt;
&lt;br /&gt;&lt;p&gt;To understand the regular expression we will divide it into smaller components:&lt;/p&gt;
&lt;br /&gt;&lt;p&gt;&lt;span style="border-bottom: 2px solid rgb(0, 255, 0); padding-right: 5px; font-weight: bold; font-size: 105%; color: rgb(128, 0, 128); text-decoration: none;"&gt;/^[a-zA-Z0-9._-]+&lt;/span&gt;:&amp;nbsp; Means that the email address must begin with alpha-numeric characters (both lowercase and uppercase characters are allowed). It may have periods,underscores and hyphens.&lt;/p&gt;
&lt;br /&gt;&lt;p&gt;&lt;span style="border-bottom: 2px solid rgb(0, 255, 0); padding-right: 5px; font-weight: bold; font-size: 105%; color: rgb(128, 0, 128); text-decoration: none;"&gt;@&lt;/span&gt;:&amp;nbsp;&amp;nbsp; There must be a ‘@’ symbol after initial characters.&lt;/p&gt;
&lt;br /&gt;&lt;p&gt;&lt;span style="border-bottom: 1px solid rgb(0, 255, 0); padding-right: 10px; font-weight: bold; font-size: 105%; color: rgb(128, 0, 128); text-decoration: none;"&gt;[a-zA-Z0-9.-]+&lt;/span&gt;: After the ‘@’ sign there must be some alpha-numeric characters. It can also contain period (’.') and and hyphens(’-').&lt;/p&gt;
&lt;br /&gt;&lt;p&gt;&lt;span style="border-bottom: 2px solid rgb(0, 255, 0); padding-right: 5px; font-weight: bold; font-size: 105%; color: rgb(128, 0, 128); text-decoration: none;"&gt;\.&lt;/span&gt;: After the second group of characters there must be a period (’.'). This is to separate domain and subdomain names.&lt;/p&gt;
&lt;br /&gt;&lt;p&gt;&lt;span style="border-bottom: 2px solid rgb(0, 255, 0); padding-right: 5px; font-weight: bold; font-size: 105%; color: rgb(128, 0, 128); text-decoration: none;"&gt;[a-zA-Z]{2,4}$/&lt;/span&gt;: Finally, the email address must end with two to four alphabets. Having a-z and A-Z means that both lowercase and uppercase letters are allowed.     &lt;br&gt;{2,4} indicates the minimum and maximum number of characters. This will allow domain names with 2, 3 and 4 characters e.g.; us, tx, org, com, net, wxyz).&lt;/p&gt;
&lt;br /&gt;&lt;p&gt;On the final line we call &lt;i&gt;test&lt;/i&gt; method for our regular expression and pass the email address as input. If the input email address satisfies our regular expression, ‘test’ will return &lt;i&gt;true&lt;/i&gt; otherwise it will return &lt;i&gt;false&lt;/i&gt;. We return this value to the calling method.&lt;/p&gt;
&lt;br /&gt;&lt;p&gt;You can call this method whenever you want to validate email address.&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;p&gt;&lt;div&gt;&lt;h2&gt;Check Email Address with JavaScript and Regular Expressions&lt;/h2&gt;&lt;/div&gt;
&lt;br /&gt;&lt;code&gt;&amp;lt;script language="javascript"&amp;gt;&lt;br&gt;function checkEmail() {&lt;br&gt;var email = document.getElementById(’emailaddress’);&lt;br&gt;var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;&lt;br&gt;if (!filter.test(email.value)) {&lt;br&gt;alert(’Please provide a valid email address’);&lt;br&gt;email.focus&lt;br&gt;return false;&lt;br&gt;}&lt;br&gt;}&lt;br&gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;p&gt;
&lt;br /&gt;Validate Email Addresses with a JavaScript Regular Expression
&lt;br /&gt;Often, email validation code for web applications checks only for the position of @ and period characters, also assuming the @ character will be in the front of period. But we all know the "a_b.c@gamil.com" is valid.
&lt;br /&gt;
&lt;br /&gt;Did you know you can use a JavaScript Regular Expressions method to check email addresses? It is simple and efficient. Here's how:
&lt;br /&gt;
&lt;br /&gt;&lt;code&gt;
&lt;br /&gt;&lt;script language="javascript"&gt;
&lt;br /&gt;function checkEmail(inputvalue){	
&lt;br /&gt;    var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
&lt;br /&gt;    if(pattern.test(inputvalue)){         
&lt;br /&gt;		alert("true");   
&lt;br /&gt;    }else{   
&lt;br /&gt;		alert("false"); 
&lt;br /&gt;    }
&lt;br /&gt;}
&lt;br /&gt;&lt;/script&gt;
&lt;br /&gt;&lt;/code&gt;
&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/664651663704607214-4977752693199146251?l=vindeshmohariya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AAjREW3a-2PqKAXO0pIkOFo81Rg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AAjREW3a-2PqKAXO0pIkOFo81Rg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/AAjREW3a-2PqKAXO0pIkOFo81Rg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AAjREW3a-2PqKAXO0pIkOFo81Rg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnTechnicalSkills/~4/ZAzDgFKJ1mQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://vindeshmohariya.blogspot.com/feeds/4977752693199146251/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=664651663704607214&amp;postID=4977752693199146251" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/4977752693199146251?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/4977752693199146251?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnTechnicalSkills/~3/ZAzDgFKJ1mQ/validate-email-address-using-javascript.html" title="Validate email address using JavaScript and regular expression" /><author><name>vini@riya</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://vindeshmohariya.blogspot.com/2009/01/validate-email-address-using-javascript.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEABSXk5cSp7ImA9WxdVEUQ.&quot;"><id>tag:blogger.com,1999:blog-664651663704607214.post-3371039395385171974</id><published>2008-07-16T01:16:00.000-07:00</published><updated>2008-07-16T01:25:58.729-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-16T01:25:58.729-07:00</app:edited><title>Prevent browser window closing?</title><content type="html">Try this Examples:&lt;br /&gt;Copy &amp; paste this code in your html page and run it... &lt;br /&gt;&lt;br /&gt;{script type="text/javascript"}&lt;br /&gt;&lt;br /&gt;var needToConfirm = true;&lt;br /&gt;window.onbeforeunload = confirmExit;&lt;br /&gt;function confirmExit()&lt;br /&gt;{&lt;br /&gt;    if (needToConfirm)&lt;br /&gt;    return "You have attempted to leave this page. If you have made any changes to the fields without clicking the Save button, your changes will be lost. Are you sure you want to exit this page?";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function windowclose(){&lt;br /&gt;    window.close();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;{/script}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/664651663704607214-3371039395385171974?l=vindeshmohariya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/curpzsK9rU-AibKvP5BJf8f7ipk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/curpzsK9rU-AibKvP5BJf8f7ipk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/curpzsK9rU-AibKvP5BJf8f7ipk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/curpzsK9rU-AibKvP5BJf8f7ipk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnTechnicalSkills/~4/4hsTOord9ek" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://vindeshmohariya.blogspot.com/feeds/3371039395385171974/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=664651663704607214&amp;postID=3371039395385171974" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/3371039395385171974?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/3371039395385171974?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnTechnicalSkills/~3/4hsTOord9ek/prevent-browser-window-closing.html" title="Prevent browser window closing?" /><author><name>vini@riya</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://vindeshmohariya.blogspot.com/2008/07/prevent-browser-window-closing.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkUAR3wyeCp7ImA9WxdXFEs.&quot;"><id>tag:blogger.com,1999:blog-664651663704607214.post-6897983358528026322</id><published>2008-06-25T23:01:00.000-07:00</published><updated>2008-06-25T23:04:06.290-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-25T23:04:06.290-07:00</app:edited><title>Difference between SAX and DOM parsers?</title><content type="html">&lt;h1&gt;Difference between SAX and DOM parsers?&lt;/h1&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;DOM parser -&lt;/span&gt; Reads the whole XML document and returns a DOM tree representation of xml document. It provides a convenient way for reading, analyzing and manipulating XML files. It is not well suited for large xml files, as it always reads the whole file before processing.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;SAX parser -&lt;/span&gt; Works incrementally and generate events that are passed to the application. It does not generate data representation of xml content so some programming is required. However, it provides stream processing and partial processing which cannot be done alone by DOM parser.&lt;br /&gt;&lt;br /&gt;----------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;SAX Parser is the one which is developed to run the java programs especially. It uses a memory resident model. DOM is developed by w3c consortium so that it is an open standard. In DOM the xml file is arranged as a tree and backward and forward search is possible for searching the tags and evaluating the data which it holds. It depends upon the application and ease of data accessiblity. If we want to extract the data from a xml file once we have to move to SAX, which is one time top to bottom read approach and if we want ot randomly pick the data in an xml file then the tree reperesentation of DOM model is to be put into use. Thats all !&lt;br /&gt;&lt;br /&gt;----------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Both SAX and DOM are used to parse the XML document. Both has advantages and disadvantages and can be used in our programming depending on the situation&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;SAX parser: -&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. Parses node by node&lt;br /&gt;&lt;br /&gt;2. Doesnt store the XML in memory&lt;br /&gt;&lt;br /&gt;3. We cant insert or delete a node&lt;br /&gt;&lt;br /&gt;4. Top to bottom traversing&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;DOM parser: -&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. Stores the entire XML document into memory before processing&lt;br /&gt;&lt;br /&gt;2. Occupies more memory&lt;br /&gt;&lt;br /&gt;3. We can insert or delete nodes&lt;br /&gt;&lt;br /&gt;4. Traverse in any direction.&lt;br /&gt;&lt;br /&gt;If we need to find a node and doesnt need to insert or delete we can go with SAX itself otherwise DOM provided we have more memory.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/664651663704607214-6897983358528026322?l=vindeshmohariya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/IKU8FSfuMiQjb3GEK9DEi-fQcYE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IKU8FSfuMiQjb3GEK9DEi-fQcYE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/IKU8FSfuMiQjb3GEK9DEi-fQcYE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IKU8FSfuMiQjb3GEK9DEi-fQcYE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnTechnicalSkills/~4/3hPYpjeoaew" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://vindeshmohariya.blogspot.com/feeds/6897983358528026322/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=664651663704607214&amp;postID=6897983358528026322" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/6897983358528026322?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/6897983358528026322?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnTechnicalSkills/~3/3hPYpjeoaew/difference-between-sax-and-dom-parsers.html" title="Difference between SAX and DOM parsers?" /><author><name>vini@riya</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://vindeshmohariya.blogspot.com/2008/06/difference-between-sax-and-dom-parsers.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcARnk7eip7ImA9WxdXFEs.&quot;"><id>tag:blogger.com,1999:blog-664651663704607214.post-1141508246479586125</id><published>2008-06-25T22:58:00.000-07:00</published><updated>2008-06-25T23:00:47.702-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-25T23:00:47.702-07:00</app:edited><title>Application server &amp; Web server</title><content type="html">&lt;h1&gt;Application server &amp; Web server&lt;/h1&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1. What is difference between web server and application server?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Answer 1:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Webserver:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A Web server handles the HTTP protocol. When the Web server receives an HTTP request, it responds with an HTTP response, such as sending back an HTML page. To process a request, a Web server may respond with a static HTML page or image, send a redirect, or delegate the dynamic response generation to some other program such as CGI scripts, JSPs (JavaServer Pages), servlets, ASPs (Active Server Pages), server-side JavaScripts, or some other server-side technology. Whatever their purpose, such server-side programs generate a response, most often in HTML, for viewing in a Web browser.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Application Server:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As for the application server, according to our definition, an application server exposes business logic to client applications through various protocols, possibly including HTTP. While a Web server mainly deals with sending HTML for display in a Web browser, an application server provides access to business logic for use by client application programs. The application program can use this logic just as it would call a method on an object&lt;br /&gt;&lt;br /&gt;2. A web server itself is an application deployed inside an Application Server.&lt;br /&gt;&lt;br /&gt;As explained in earlier response, a Web Server is a software that serves to access internet or intranet.&lt;br /&gt;&lt;br /&gt;It provides HTTP message handling for an application server ( J2EE like Web Sphere).&lt;br /&gt;&lt;br /&gt;Application Server is a system that provides the execution enviroment for the entire system.That is the core of network computing / Architechtures.&lt;br /&gt;&lt;br /&gt;3. Web Server &amp; Application Server are different in the following aspects. The Web Server does not support the concept of multi-threading. In Application Server we have features like connection pulling, isolation pulling, multi-threading, and majorly the Transaction feature which is not there in Web Server. An Application Server may include a Web Server inside it.&lt;br /&gt;&lt;br /&gt;4. Webserver:&lt;br /&gt;&lt;br /&gt;1. It will process all HTTP request&lt;br /&gt;&lt;br /&gt;2. It supports to deploy .war files only.&lt;br /&gt;&lt;br /&gt;3. It supports multithreading&lt;br /&gt;&lt;br /&gt;4. It doesn‘t support load balancing, clustering&lt;br /&gt;&lt;br /&gt;5. It doesn‘t support connection pooling and thread pooling. Developers have to write coding to support this features.&lt;br /&gt;&lt;br /&gt;Application Server:&lt;br /&gt;&lt;br /&gt;1. It supports HTTP request thro Webserver.&lt;br /&gt;&lt;br /&gt;2. It supports to deploy .war and .ear files&lt;br /&gt;&lt;br /&gt;3. It gives Load balancing, clustering, Performance, highly availability and scalability.&lt;br /&gt;&lt;br /&gt;4. It supports Multithreading, JNDI, Connection Pooling and Thread pooling&lt;br /&gt;&lt;br /&gt;5. There is a progression in servers.&lt;br /&gt;&lt;br /&gt;There is Apache, which is a "web server" or "http server", and can only serve html pages, images, and you could also add intelligence to the website by adding cgi code (in perl or php). Otherwise its mostly a file server. But then sometimes a cluster of apache servers are used for load balancing at the front end, and requests could be redirected to different application servers based on some criteria.&lt;br /&gt;&lt;br /&gt;Then there is Tomcat, which is technically a "servlet container" - this can do all that apache does because it contains apache internally, and it can also support servlets and jsp pages.&lt;br /&gt;&lt;br /&gt;Then there are application servers like websphere, weblogic, etc.. which can do all that apache does and also support "ejbs".. and since the support ejbs, they also support a variety of other things, like security, authentication, transaction, resource pooling..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/664651663704607214-1141508246479586125?l=vindeshmohariya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PrOw7k9IE7OtBx5LmizQRKajYZ0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PrOw7k9IE7OtBx5LmizQRKajYZ0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/PrOw7k9IE7OtBx5LmizQRKajYZ0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PrOw7k9IE7OtBx5LmizQRKajYZ0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnTechnicalSkills/~4/MdYvxV6IyhQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://vindeshmohariya.blogspot.com/feeds/1141508246479586125/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=664651663704607214&amp;postID=1141508246479586125" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/1141508246479586125?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/1141508246479586125?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnTechnicalSkills/~3/MdYvxV6IyhQ/application-server-web-server.html" title="Application server &amp; Web server" /><author><name>vini@riya</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://vindeshmohariya.blogspot.com/2008/06/application-server-web-server.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUQNSXs_cSp7ImA9WxVSF0Q.&quot;"><id>tag:blogger.com,1999:blog-664651663704607214.post-5663356102390195158</id><published>2007-09-13T00:45:00.000-07:00</published><updated>2009-01-12T12:49:58.549-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-12T12:49:58.549-08:00</app:edited><title /><content type="html">&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/664651663704607214-5663356102390195158?l=vindeshmohariya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PFj6l_9DyUlQqkVo9pok1AH3VFg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PFj6l_9DyUlQqkVo9pok1AH3VFg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/PFj6l_9DyUlQqkVo9pok1AH3VFg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PFj6l_9DyUlQqkVo9pok1AH3VFg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnTechnicalSkills/~4/_xYdE0G7Hv8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://vindeshmohariya.blogspot.com/feeds/5663356102390195158/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=664651663704607214&amp;postID=5663356102390195158" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/5663356102390195158?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/5663356102390195158?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnTechnicalSkills/~3/_xYdE0G7Hv8/sample-java-interview-questions.html" title="" /><author><name>vini@riya</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://vindeshmohariya.blogspot.com/2007/09/sample-java-interview-questions.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0YHRn07eCp7ImA9WB5aFk0.&quot;"><id>tag:blogger.com,1999:blog-664651663704607214.post-7630236681414661133</id><published>2007-09-12T06:51:00.000-07:00</published><updated>2007-09-12T06:52:17.300-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-09-12T06:52:17.300-07:00</app:edited><title>State and session tracking with Java servlets Part 1: Using cookies</title><content type="html">&lt;span style="font-weight:bold;"&gt;State and session tracking with Java servlets Part 1: Using cookies&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Go to page: 1  2  Next  &lt;br /&gt;&lt;br /&gt;When the Hyper-Text Transfer Protocol (HTTP) was developed, its designers chose to create a protocol which does not maintain a persistent connection. Each request made by a Web browser, for an image, an HTML page, or other Web object, is made via a new connection. It would have been handy if Web browsers established a single connection, through which multiple requests could be made. Indeed, this feature has been introduced in HTTP 1.1, with the keep-alive feature. This feature comes too late though for server-side programmers, as support for legacy browsers and Web servers must be maintained. Without an ongoing session, however, it is difficult for developers to maintain state across HTTP requests. This ability is critical though for all but the simplest of server-side applications. A shopping cart, for example, needs to maintain a list of items and have this list associated with a specific user.&lt;br /&gt;How can state be maintained across HTTP requests?&lt;br /&gt;&lt;br /&gt;Developers are an inventive bunch and quickly found solutions. The simplest of all was to encode hidden parameters inside an HTML form, such as the username and type of transaction being made. Though not evident to the user, additional state information has been added to the form, which will be passed when the form is submitted. If every form included a hidden field indicating the user, then it would be possible to track user actions across HTTP requests. Of course, additional information can also be included, such as the type of operation being performed, as well as the focus of the operation. The following HTML code illustrates the use of hidden fields:&lt;br /&gt;&lt;br /&gt;&lt;form action="/servlet/order" method=post&gt;&lt;br /&gt;&lt;input type="hidden" name=userid value="5532211"&gt;&lt;br /&gt;&lt;input type="hidden" name=operation  value="add"&gt;&lt;br /&gt;&lt;input type="hidden" name=product_id value="4432A"&gt;&lt;br /&gt;Product ID : 4432A&lt;br /&gt;Quantity   : &lt;input type="quantity" value=1&gt;&lt;br /&gt;&lt;input type=submit&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;br /&gt;A variation on this theme is to use hyperlinks, which generate HTTP GET requests. Often a hyperlink is better than an HTML form, as most users are more comfortable with hyperlinks than buttons. Parameters can be added to the end of each URL, so that state information is passed when the next connection is made. For example, every hyperlink on the page could contain a userID code to allow user activity to be tracked. This information can be fetched by a servlet using&lt;br /&gt;&lt;br /&gt;javax.servlet.http.HttpServletRequest.getParameter(String)&lt;br /&gt;&lt;br /&gt;just as a standard CGI parameter would.&lt;br /&gt;&lt;br /&gt;&lt;a href="/servlet/shopping?userID=5532211&gt;View Shopping Cart&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Whether a hyperlink or an HTML form is used, this state information must be included every time a request is made, so that subsequent requests can gain access to it. If your servlet misses a URL or a hidden variable is missed from a form, the state information is lost. Such solutions are crude but effective. They do the job but are an inelegant and overly complex way of maintaining state across HTTP requests. A better way of maintaining state information is to use persistent client state cookies.&lt;br /&gt;Did you say cookies?&lt;br /&gt;&lt;br /&gt;To solve the problem of maintaining persistence across HTTP connections, Netscape Communications developed a specification for "cookies". Cookies are state objects stored by a Web browser (or other HTTP client) and can be used by server-side applications to store and retrieve information. Cookies can be created by servlets (or CGI scripts) and sent to the browser. For every subsequent request made by the browser, the cookie is sent as part of the HTTP request. This allows server-side applications to access state information, without the effort of encoding it in a hyperlink or HTML form. Figure 1 shows an example transaction between a server-side application and a browser where a cookie is stored and then returned.&lt;br /&gt;&lt;br /&gt;Figure 1. A cookie sent to an HTTP client is returned on subsequent requests.&lt;br /&gt;&lt;br /&gt;To understand how cookies work, let's consider the analogy of a bank. When signing up for an account, most customers will be given a card that contains identification information. Every time the customer uses an ATM, he or she presents the card. State information (the user's account number) persists across each transaction, even though transactions may be days, weeks, or even months apart. Cookies are no different — the state information issued by a server-side application is presented later, when the next HTTP request is made.&lt;br /&gt;&lt;br /&gt;Each cookie is named and contains a single value. The cookie is effectively a mapping between a single key and a single value. If developers need to store multiple values, they can use more than one cookie or can encode multiple values using some sort of separator character for the cookie data. Remember, however, that the number of cookies per domain name varies from browser to browser. Netscape imposes a limit of 20 cookies per domain, and a maximum size of 4096 bytes per cookie. As a general rule, cookies should only contain small pieces of data (to identify a user or a session). You have the option of using an identifier stored in a cookie to look up larger pieces of data stored server-side.&lt;br /&gt;Storing cookies from a Java servlet&lt;br /&gt;&lt;br /&gt;Support for cookies has been included in the Servlet API and provides an extremely easy interface for storing and retrieving cookies. Cookies are represented by the&lt;br /&gt;&lt;br /&gt;javax.servlet.http.Cookie&lt;br /&gt;&lt;br /&gt;class. The constructor takes two strings as parameters — the name of the cookie (which is fixed) and the value (which can be changed at a later date). &lt;br /&gt;&lt;br /&gt;// Create a new cookie&lt;br /&gt;Cookie myCookie = new Cookie ( "accountID" , "212994234");&lt;br /&gt;&lt;br /&gt;Servlets that wish to set cookies must add their cookie to the response sent back to the browser.&lt;br /&gt;&lt;br /&gt;HttpServletResponse&lt;br /&gt;&lt;br /&gt;offers an&lt;br /&gt;&lt;br /&gt;addCookie(Cookie)&lt;br /&gt;&lt;br /&gt;method, which can be invoked once or multiple times to add additional cookies.&lt;br /&gt;&lt;br /&gt;public void doGet(HttpServletRequest req, HttpServletResponse res)&lt;br /&gt;{&lt;br /&gt; // Store state information in browser cookies&lt;br /&gt; res.addCookie (new Cookie ("thecounter", "1");&lt;br /&gt;&lt;br /&gt; // Additional servlet code would go here.....&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Reading cookies from a Java servlet&lt;br /&gt;&lt;br /&gt;Accessing stored cookies from a servlet is also easy. Cookies are sent each time a request is made, so that if a cookie is already stored in the browser, it can be accessed by invoking the&lt;br /&gt;&lt;br /&gt;Cookies[] getCookies()&lt;br /&gt;&lt;br /&gt;method of&lt;br /&gt;&lt;br /&gt;javax.servlet.http.HttpServletRequest&lt;br /&gt;&lt;br /&gt;. This returns an array of Cookie objects, or&lt;br /&gt;&lt;br /&gt;null&lt;br /&gt;&lt;br /&gt;if no cookies are present.&lt;br /&gt;&lt;br /&gt;// Get cookie array from HttpServletRequest&lt;br /&gt;Cookie[] cookieArray = request.getCookies();&lt;br /&gt;&lt;br /&gt;// Guard statement to check for missing cookies&lt;br /&gt;if (cookieArray != null)&lt;br /&gt;{&lt;br /&gt; // Print a list of all cookies sent by browser&lt;br /&gt; for (int i =0; i&lt; cookieArray.length; i++)&lt;br /&gt; {&lt;br /&gt;  Cookie c = cookieArray[i];&lt;br /&gt;  pout.println ("Name : " + c.getName());&lt;br /&gt;  pout.println ("Value: " + c.getValue());&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;pout.println ("No cookies present, or browser does not support cookies");&lt;br /&gt;&lt;br /&gt;Putting cookies to work&lt;br /&gt;&lt;br /&gt;To demonstrate cookies in action, let's look at a simple example that tracks the number of times a user has visited a site. Though no unique identifier is to be stored as a cookie, the number of visits made by the user will persist over time. This shows that state has been maintained across connections.&lt;br /&gt;&lt;br /&gt;We start by checking for the presence of any cookies, and then a specific cookie named "count." If the cookie exists, we read the value and then display it to the user. Since the idea of a counter is to increase on every visit, we increment the counter value and send it back to the user as a cookie. As you reload the page, the cookie is incremented, and state information persists across connections. Note too that, by default, the cookie will persist only while the browser remains open, unless a specific time period is assigned to the cookie (see Listing 1).&lt;br /&gt;Listing 1 (See page 2)&lt;br /&gt;Summary&lt;br /&gt;&lt;br /&gt;Cookies provide an easy mechanism for maintaining state information across HTTP requests. The Servlet API provides an easy-to-use implementation of cookies, which requires a minimal amount of code. In the second part of this article (State and session tracking with Java servlets Part 2: Securing data), we'll cover more-advanced uses of cookies and enhanced session tracking features offered by the Servlet API.&lt;br /&gt;About the author&lt;br /&gt;&lt;br /&gt;David Reilly is a software engineer and freelance technical writer living in Australia. A Sun Certified Java 1.1 Programmer, his research interests include the Java programming language and networking &amp; distributed systems. He can be reached via e-mail at java@davidreilly.com.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Go to page: 1  2  Next &lt;br /&gt;&lt;br /&gt;Go to page: Prev  1  2  &lt;br /&gt;&lt;br /&gt;   Listing 1&lt;br /&gt;Putting cookies to work&lt;br /&gt;by David Reilly.&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// Import io package&lt;br /&gt;import java.io.*;&lt;br /&gt;&lt;br /&gt;// Import servlet packages&lt;br /&gt;import javax.servlet.*;&lt;br /&gt;import javax.servlet.http.*;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class CookieCounter extends HttpServlet&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt; // GET request handler&lt;br /&gt; public void doGet (HttpServletRequest request, HttpServletResponse response) throws IOException&lt;br /&gt; {&lt;br /&gt;  // Define content type&lt;br /&gt;  response.setContentType("text/html");&lt;br /&gt; &lt;br /&gt;  PrintStream pout = new PrintStream(response.getOutputStream());&lt;br /&gt;&lt;br /&gt;  // Check to see if there are any cookies&lt;br /&gt;  Cookie[] cookieArray = request.getCookies();&lt;br /&gt;&lt;br /&gt;  // Default value&lt;br /&gt;  int count = 0;&lt;br /&gt;&lt;br /&gt;  // Check for cookies&lt;br /&gt;  if (cookieArray != null)&lt;br /&gt;  {&lt;br /&gt;   for (int i =0; i&lt; cookieArray.length; i++)&lt;br /&gt;   {&lt;br /&gt;    Cookie c = cookieArray[i];&lt;br /&gt;&lt;br /&gt;    // Check for the count cookie&lt;br /&gt;    if (c.getName().equals("count"))&lt;br /&gt;    {&lt;br /&gt;     // Parse cookie value and assign to count&lt;br /&gt;     try&lt;br /&gt;     {&lt;br /&gt;      Integer num = new Integer (c.getValue());&lt;br /&gt;      count = num.intValue();&lt;br /&gt;     }&lt;br /&gt;     catch (NumberFormatException nfe) {}&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  // Increment counter&lt;br /&gt;  count++;&lt;br /&gt;&lt;br /&gt;  // Send updated cookie&lt;br /&gt;  response.addCookie(new Cookie ("count", String.valueOf(count)));&lt;br /&gt;&lt;br /&gt;  // Output message&lt;br /&gt;  pout.println ("You have visited this page " + count +&lt;br /&gt;   " times since your web browser started");&lt;br /&gt;  pout.flush();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; // POST request handler calls GET request handler&lt;br /&gt; public void doPost (HttpServletRequest request, HttpServletResponse response) throws IOException&lt;br /&gt; {&lt;br /&gt;  doGet(request,response);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Go to page: Prev  1  2&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/664651663704607214-7630236681414661133?l=vindeshmohariya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XP_g9ICUMQzlNYLswq0AGI6Ikw4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XP_g9ICUMQzlNYLswq0AGI6Ikw4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XP_g9ICUMQzlNYLswq0AGI6Ikw4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XP_g9ICUMQzlNYLswq0AGI6Ikw4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnTechnicalSkills/~4/mnHM6H6WgTM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://vindeshmohariya.blogspot.com/feeds/7630236681414661133/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=664651663704607214&amp;postID=7630236681414661133" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/7630236681414661133?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/7630236681414661133?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnTechnicalSkills/~3/mnHM6H6WgTM/state-and-session-tracking-with-java.html" title="State and session tracking with Java servlets Part 1: Using cookies" /><author><name>vini@riya</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://vindeshmohariya.blogspot.com/2007/09/state-and-session-tracking-with-java.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0cHRX89eCp7ImA9WB5aFk0.&quot;"><id>tag:blogger.com,1999:blog-664651663704607214.post-4923091454026091640</id><published>2007-09-12T06:49:00.000-07:00</published><updated>2007-09-12T06:50:34.160-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-09-12T06:50:34.160-07:00</app:edited><title>Questions and Answers - Session state in the client tier</title><content type="html">Questions and Answers - Session state in the client tier&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;Guidelines, Patterns, and code for end-to-end Java applications.&lt;br /&gt;Questions and Answers - Session state in the client tier&lt;br /&gt;&lt;br /&gt;   1. How can session state be maintained in the client tier?&lt;br /&gt;&lt;br /&gt;   2. What are the client-tier mechanisms for storing session state?&lt;br /&gt;&lt;br /&gt;   3. What are the advantages and disadvantages of storing state in the client tier?&lt;br /&gt;&lt;br /&gt;   4. How do I use cookies to store session state on the client?&lt;br /&gt;&lt;br /&gt;   5. What are some advantages of storing session state in cookies?&lt;br /&gt;&lt;br /&gt;   6. What are some disadvantages of storing session state in cookies?&lt;br /&gt;&lt;br /&gt;   7. How do I use URL rewriting to store session state on the client?&lt;br /&gt;&lt;br /&gt;   8. What are some advantages of using URL rewriting?&lt;br /&gt;&lt;br /&gt;   9. What are some disadvantages of using URL rewriting?&lt;br /&gt;&lt;br /&gt;1.  How can session state be maintained in the client tier?&lt;br /&gt;&lt;br /&gt;A session is a sequence of service requests by a single user using a single client to access a server. The information maintained in the session across requests is called session state. Session state may include both information visible to the user (shopping cart contents, for example) and invisible application control information (such as user preferences).&lt;br /&gt;&lt;br /&gt;We recommend that:&lt;br /&gt;&lt;br /&gt;    * for applications using enterprise beans: manage session state in the EJB tier using a stateful session bean.&lt;br /&gt;    * for applications not using enterprise beans: manage session state in the web tier using interface HttpSession.&lt;br /&gt;&lt;br /&gt;We do not recommend maintaining session state in the client tier.&lt;br /&gt;&lt;br /&gt;Most web applications store at least a session ID in the client tier, and extract the session ID from the service request to identify the session and thereby the session state. Some applications store all client session state in the client tier, which allows the server to be completely stateless. The discussions below describe the mechanisms for storing state in the client tier, discuss the choice of how much state to store there, and point out the tradeoffs involved in each approach.&lt;br /&gt;&lt;br /&gt;Either of the techniques recommended above may result in the server storing a session id in the client tier in some way, but that's an implementation detail that the developer should leave to the server. Using server facilities like HttpSession or stateful session beans frees the developer from having to deal with cookies, URL rewriting, hidden form variables, and so on; and lets the developer concentrate on creating business functionality.&lt;br /&gt;&lt;br /&gt;2.  What are the client-tier mechanisms for storing session state?&lt;br /&gt;&lt;br /&gt;At least three mechanisms can store session state in the client tier of a J2EE web application:&lt;br /&gt;&lt;br /&gt;    * Store the state in a cookie. A cookie is a small chunk of data that a server can include in a response for storage by the client. (See RFC2109 at http://www.ietf.org/rfc/rfc2109.txt for the cookie specification.) Each time the client sends information to a server, it includes in the request HTTP headers all of the previously-stored cookies it has received from that server. Session state can be stored in a cookie on the client tier for use by the server when formulating responses.&lt;br /&gt;    * Rewrite URLs to include the encoded state. URL rewriting is the technique of encoding every URL on a served page to include client-side session state. Any time such a URL is dereferenced, the browser performs an HTTP GET to the server, which receives the client-side state as an argument, which the server may then parse and use to perform the requested service.&lt;br /&gt;    * Keep the state in hidden form variables. A server can encode client-side session state in "hidden" form variables; that is, tags of the form &lt;INPUT TYPE="HIDDEN" ... &gt;. These values are included in subsequent HTTP requests from the client, and used by the server as the session state. This mechanism can be encapsulated in a JSP tag to make the programming easier. The Java Pet Store sample application contains a sample implementation of such a tag, called ClientStateTag.&lt;br /&gt;&lt;br /&gt;3.  What are the advantages and disadvantages of storing state in the client tier?&lt;br /&gt;&lt;br /&gt;Storing session state in the client tier allows servers to be stateless, which provides the following advantages over servers that maintain state:&lt;br /&gt;&lt;br /&gt;    * Potentially lower server resource usage. Stateless servers don't need to allocate and maintain resources to track session state.&lt;br /&gt;    * Improved scalability and easy failover in clusters. Stateless servers are easier to cluster, since any server can service any client. Clustered servers maintaining session state on the server ("stateful" servers) will typically require either "server affinity" (assigning a particular server to a particular client) or some form of distributed server-side session state replication. Both of these solutions, as well as failover, are complicated to implement, and imply more back-end processing. Stateless servers avoid these problems by not requiring the server to know anything about session state.&lt;br /&gt;    * client sessions can survive a server crash.Stateless servers lose no session information when they go down, since they maintain no such information. Failover techniques can redirect clients to any other available server to complete the request. Alternately, user retries of the same URL will typically succeed.&lt;br /&gt;&lt;br /&gt;Client-side session state has disadvantages, as well:&lt;br /&gt;&lt;br /&gt;    * Persistent cookies may be readable by unauthorized users. Browsers commonly write cookies to a "cookie file", which remains on the user's hard drive. Sensitive information (passwords, contact information, credit card numbers, etc.) unwisely stored in cookie files is vulnerable to abuse by anyone else who uses that computer (or who has access to the computer's drives). This vulnerability is especially a concern at public terminals, where a naive or careless user might leave sensitive information in cookies. Encrypting the data stored on the client might solve this problem, as long as the data in the client-side session state is not intended for display.&lt;br /&gt;    * Client-side data can be modified. Cookie files can be edited; URLs can be modified by hand; and HTML forms can be saved as source, edited, reloaded, and posted to the server. A malicious user could change any of these data to gain access to another user's resources. Including a digital signature in the client-side data can greatly lessen this risk.&lt;br /&gt;    * Greatly increased communication overhead. When session state is stored on the client, it must be transmitted to the server for each request. Often the server response includes yet another copy of the state, changed or otherwise. Most of this communication is redundant.&lt;br /&gt;    * Complex implementation. Maintaining client-side session state can be a tricky business. The mechanisms for maintaining session state outlined in the previous section all have peculiarities that make them difficult to use reliably and consistently. (These issues are expanded upon in other sections below.)&lt;br /&gt;    * Limited data size. There is no standardization among all browsers currently in use for the minimum size for a cookie. Trying to store all session state in a cookie could run up against a cookie size constraint for some browsers. URL length can also be an issue when using URL rewriting.&lt;br /&gt;&lt;br /&gt;One of the major goals of J2EE technology is to allow application developers to concentrate on implementing application functionality. An application server frees developers of messy system implementation details such as client session state mechanisms. In your J2EE application, it's usually better to allow the application server to handle the details of where and how session state is stored. Using either enterprise beans or a web container's HttpSession implementation can provide reliable, scalable access to client-side session state through a portable interface, and saves the developer the trouble of implementing a custom solution.&lt;br /&gt;&lt;br /&gt;4.  How do I use cookies to store session state on the client?&lt;br /&gt;&lt;br /&gt;We do not recommend storing session state directly on the client using cookies. See our recommendations for how to store session state. This section describes how to store session state directly on the client for those who choose to ignore these guidelines.&lt;br /&gt;&lt;br /&gt;In a servlet, the HttpServletResponse and HttpServletRequest objects passed to method HttpServlet.service() can be used to create cookies on the client and use cookie information transmitted during client requests. JSPs can also use cookies, in scriptlet code or, preferably, from within custom tag code.&lt;br /&gt;&lt;br /&gt;    * To set a cookie on the client, use the addCookie() method in class HttpServletResponse. Multiple cookies may be set for the same request, and a single cookie name may have multiple values.&lt;br /&gt;    * To get all of the cookies associated with a single HTTP request, use the getCookies() method of class HttpServletRequest&lt;br /&gt;    * The Using Cookies section in the Java Servlets trail of Java Tutorial provides detailed sample code. Read it at http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Servlets11.html.&lt;br /&gt;&lt;br /&gt;5.  What are some advantages of storing session state in cookies?&lt;br /&gt;&lt;br /&gt;    * Cookies are usually persistent, so for low-security sites, user data that needs to be stored long-term (such as a user ID, historical information, etc.) can be maintained easily with no server interaction.&lt;br /&gt;    * For small- and medium-sized session data, the entire session data (instead of just the session ID) can be kept in the cookie.&lt;br /&gt;&lt;br /&gt;6.  What are some disadvantages of storing session state in cookies?&lt;br /&gt;&lt;br /&gt;    * Cookies are controlled by programming a low-level API, which is more difficult to implement than some other approaches.&lt;br /&gt;    * All data for a session are kept on the client. Corruption, expiration or purging of cookie files can all result in incomplete, inconsistent, or missing information.&lt;br /&gt;    * Size limitations on cookies differ by browser type and version, but a least-common-denominator approach mandates a maximum cookie size of 4,096 bytes. This limitation can be eliminated by storing just references to data (session ids, user ids, etc.) in cookies, and retrieving the data as necessary from another tier (at the cost of increased server complexity and resource usage). In fact, this is equivalent to the recommended practice of storing session state in the web tier.&lt;br /&gt;    * Cookies may not be available for many reasons: the user may have disabled them, the browser version may not support them, the browser may be behind a firewall that filters cookies, and so on. Servlets and JSP pages that rely exclusively on cookies for client-side session state will not operate properly for all clients. Using cookies, and then switching to an alternate client-side session state strategy in cases where cookies aren't available, complicates development and maintenance.&lt;br /&gt;    * Since web clients transmit to a server only those cookies created by that server, servers with different domain names can't share cookie data. For example, JavaPetStore.com may want to allow the user to shop from its own shopping site, as well as from JavaPetFood.com. Since JavaPetFood.com can't access JavaPetStore.com's cookies, there's no easy way to unify the shopping sessions between the two servers.&lt;br /&gt;    * Historically, cookie implementations in both browsers and servers have tended to be buggy, and/or vary in their conformance to standards. While you may have control of your servers, buggy or nonconformant browser versions are still in use by many people.&lt;br /&gt;    * Browser instances share cookies, so users cannot have multiple simultaneous sessions.&lt;br /&gt;    * Cookie-based solutions work only for HTTP clients. This is because cookies are a feature of the HTTP protocol. Notice that the while package javax.servlet.http supports session management (via class HttpSession), package javax.servlet has no such support.&lt;br /&gt;&lt;br /&gt;For these reasons, we do not recommend a cookie-based solution for storing client session state in most cases.&lt;br /&gt;&lt;br /&gt;7.  How do I use URL rewriting to store session state on the client?&lt;br /&gt;&lt;br /&gt;We do not recommend storing session state directly on the client using URL rewriting. See our recommendations for how to store session state. This section describes how to store session state directly on the client for those who choose to ignore these guidelines.&lt;br /&gt;&lt;br /&gt;Every URL on the page must be encoded using method HttpServletResponse.encodeURL(). Each time a URL is output, the servlet passes the URL to encodeURL(), which encodes session ID in the URL if the browser isn't accepting cookies, or if the session tracking is turned off.&lt;br /&gt;&lt;br /&gt;8.  What are some advantages of using URL rewriting?&lt;br /&gt;&lt;br /&gt;    * URL rewriting works just about everywhere, especially when cookies are turned off.&lt;br /&gt;    * Multiple simultaneous sessions are possible for a single user. Session information is local to each browser instance, since it's stored in URLs in each page being displayed. This scheme isn't foolproof, though, since users can start a new browser instance using a URL for an active session, and confuse the server by interacting with the same session through two instances.&lt;br /&gt;    * Entirely static pages cannot be used with URL rewriting, since every link must be dynamically written with the session state. It is possible to combine static and dynamic content, using (for example) templating or server-side includes. This limitation is also a barrier to integrating legacy web pages with newer, servlet-based pages.&lt;br /&gt;&lt;br /&gt;9.  What are some disadvantages of using URL rewriting?&lt;br /&gt;&lt;br /&gt;    * Every URL on a page which needs the session information must be rewritten each time a page is served. Not only is this expensive computationally, but it can greatly increase communication overhead.&lt;br /&gt;    * URL rewriting limits the client's interaction with the server to HTTP GETs, which can result in awkward restrictions on the page.&lt;br /&gt;    * URL rewriting does not work well with JSP technology.&lt;br /&gt;    * If a client workstation crashes, all of the URLs (and therefore all of the data for that session) are lost.&lt;br /&gt;&lt;br /&gt;For these reasons, J2EE BluePrints does not recommend URL rewriting for storing client session state in most cases.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/664651663704607214-4923091454026091640?l=vindeshmohariya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KwtBw07g27MWvF8y2c2LIaZCqzY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KwtBw07g27MWvF8y2c2LIaZCqzY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KwtBw07g27MWvF8y2c2LIaZCqzY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KwtBw07g27MWvF8y2c2LIaZCqzY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnTechnicalSkills/~4/G7dijmljhhk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://vindeshmohariya.blogspot.com/feeds/4923091454026091640/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=664651663704607214&amp;postID=4923091454026091640" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/4923091454026091640?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/4923091454026091640?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnTechnicalSkills/~3/G7dijmljhhk/questions-and-answers-session-state-in.html" title="Questions and Answers - Session state in the client tier" /><author><name>vini@riya</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://vindeshmohariya.blogspot.com/2007/09/questions-and-answers-session-state-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0QMSXo5cCp7ImA9WB5aFUU.&quot;"><id>tag:blogger.com,1999:blog-664651663704607214.post-8518951198456343777</id><published>2007-09-12T00:09:00.000-07:00</published><updated>2007-09-12T00:16:28.428-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-09-12T00:16:28.428-07:00</app:edited><title>My Personal Link</title><content type="html">&lt;a href="http://webapps.6te.net/java/" target="_blank"&gt;&lt;span style="font-weight:bold;"&gt;Krack Java&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.jroller.com/vindesh/"&gt;&lt;span style="font-weight:bold;"&gt;Interview Questions&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/664651663704607214-8518951198456343777?l=vindeshmohariya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0bzt935_6kRaO-NjvU0Sc8l9BgI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0bzt935_6kRaO-NjvU0Sc8l9BgI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0bzt935_6kRaO-NjvU0Sc8l9BgI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0bzt935_6kRaO-NjvU0Sc8l9BgI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnTechnicalSkills/~4/ldKEd1jM-10" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://vindeshmohariya.blogspot.com/feeds/8518951198456343777/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=664651663704607214&amp;postID=8518951198456343777" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/8518951198456343777?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/8518951198456343777?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnTechnicalSkills/~3/ldKEd1jM-10/my-personal-link.html" title="My Personal Link" /><author><name>vini@riya</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://vindeshmohariya.blogspot.com/2007/09/my-personal-link.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEIMSHw4fSp7ImA9WB5aFUo.&quot;"><id>tag:blogger.com,1999:blog-664651663704607214.post-6589386357114635047</id><published>2007-09-11T22:49:00.001-07:00</published><updated>2007-09-11T22:56:29.235-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-09-11T22:56:29.235-07:00</app:edited><title>Servlet&amp;Jsp</title><content type="html">From the Author ........................................................................... 5&lt;br /&gt;Career Path Institute .................................................................... 6&lt;br /&gt;Servlets and JSP.........................................................7&lt;br /&gt;What are Servlets? ............................................................................................................................... 7&lt;br /&gt;What are advantages of servlets over CGI? ......................................................................................... 7&lt;br /&gt;Can you explain Servlet life cycle? ...................................................................................................... 7&lt;br /&gt;What are the two important API’s in for Servlets? ............................................................................... 7&lt;br /&gt;Can you explain in detail “javax.servlet” package? ............................................................................. 8&lt;br /&gt;What’s the use of ServletContext? ....................................................................................................... 9&lt;br /&gt;How do we define an application level scope for servlet? ................................................................. 11&lt;br /&gt;What's the difference between GenericServlet and HttpServlet? ....................................................... 12&lt;br /&gt;Can you explain in detail javax.servlet.http package? ....................................................................... 12&lt;br /&gt;What’s the architecture of a Servlet package? ................................................................................... 18&lt;br /&gt;Why is HTTP protocol called as a stateless protocol? ...................................................................... 18&lt;br /&gt;What are the different ways we can maintain state between requests? ............................................. 19&lt;br /&gt;What is URL rewriting? ..................................................................................................................... 19&lt;br /&gt;What are cookies? .............................................................................................................................. 20&lt;br /&gt;What are sessions in Servlets? ............................................................................................................ 22&lt;br /&gt;What’s the difference between getSession(true) and getSession(false) ? .......................................... 22&lt;br /&gt;What’s the difference between “doPost” and “doGet” methods? ...................................................... 23&lt;br /&gt;Which are the different ways you can communicate between servlets? ............................................ 23&lt;br /&gt;What is functionality of “RequestDispatcher” object? ....................................................................... 24&lt;br /&gt;How do we share data using “getServletContext ()”? ........................................................................ 25&lt;br /&gt;Explain the concept of SSI? ............................................................................................................... 25&lt;br /&gt;What are filters in JAVA? ................................................................................................................... 26&lt;br /&gt;Can you explain in short how do you go about implementing filters using Apache Tomcat? ........... 27&lt;br /&gt;Twist: - Explain step by step of how to implement filters? ................................................................ 27&lt;br /&gt;what’s the difference between Authentication and authorization? ..................................................... 29&lt;br /&gt;Explain in brief the directory structure of a web application? ........................................................... 30&lt;br /&gt;Can you explain JSP page life cycle? ................................................................................................. 30&lt;br /&gt;What is EL? ....................................................................................................................................... 31&lt;br /&gt;how does EL search for an attribute? ................................................................................................ 31&lt;br /&gt;What are the implicit EL objects in JSP? .......................................................................................... 32&lt;br /&gt;How can we disable EL? .................................................................................................................... 33&lt;br /&gt;what is JSTL? ................................................................................................................................... 33&lt;br /&gt;Can you explain in short what the different types of JSTL tags are? ................................................. 33&lt;br /&gt;How can we use beans in JSP? ........................................................................................................... 36&lt;br /&gt;What is &lt;jsp:forward&gt; tag for ?.......................................................................................................... 37&lt;br /&gt;What are JSP directives? .................................................................................................................... 38&lt;br /&gt;what are Page directives? ................................................................................................................... 38&lt;br /&gt;what are include directives? ............................................................................................................... 39&lt;br /&gt;Can you explain taglib directives? ..................................................................................................... 39&lt;br /&gt;How does JSP engines instantiate tag handler classes instances? ...................................................... 41&lt;br /&gt;what’s the difference between JavaBeans and taglib directives? ....................................................... 41&lt;br /&gt;what are the different scopes an object can have in a JSP page? ....................................................... 41&lt;br /&gt;what are different implicit objects of JSP? ......................................................................................... 42&lt;br /&gt;what are different Authentication Options available in servlets? ....................................................... 43&lt;br /&gt;Can you explain how do we practically implement security on a resource? ..................................... 44&lt;br /&gt;How do we practically implement form based authentication? ......................................................... 44&lt;br /&gt;How do we authenticate using JDBC? ............................................................................................... 46&lt;br /&gt;Can you explain JDBCRealm? ........................................................................................................... 46&lt;br /&gt;Can you explain how do you configure JNDIRealm? ........................................................................ 47&lt;br /&gt;How did you implement caching in JSP? ........................................................................................... 47&lt;br /&gt;What is the difference between Servletcontext and ServletConfig ? ................................................. 48&lt;br /&gt;How do we prevent browser from caching output of my JSP pages? ................................................ 48&lt;br /&gt;Can we explicitly destroy a servlet object? ........................................................................................ 49&lt;br /&gt;Distribution Partner ................................................................... 50&lt;br /&gt;From the Author&lt;br /&gt;First thing thanks to all those who have sent me complaints and also appreciation for what ever titles&lt;br /&gt;i have written till today. But interview question series is very near to my heart as i can understand&lt;br /&gt;the pain of searching a job. Thanks to my publishers (BPB) , readers and reviewers to always excuse&lt;br /&gt;all my stupid things which i always do.&lt;br /&gt;So why is this PDF free ?. Well i always wanted to distribute things for free specially when its a&lt;br /&gt;interview question book which can fetch a job for a developer. But i am also bounded with publishers&lt;br /&gt;rules and regulations. And why not they have a whole team of editor, printing guys, designers,&lt;br /&gt;distributors, shopkeepers and including me. But again the other aspect, readers should know of what&lt;br /&gt;they are buying , the quality and is it really useful to buy this book. So here are sample free questions&lt;br /&gt;which i am giving out free to the readers to see the worth of the book.&lt;br /&gt;I can be contacted at shiv_koirala@yahoo.com its bit difficult to answer all answers but as i get time&lt;br /&gt;i do it.&lt;br /&gt;We have recently started a career counselling drive absolutely free for new comers and experienced&lt;br /&gt;guys. So i have enlisted the following guys on the panel. Thanks to all these guys to accept the panel&lt;br /&gt;job of consulting. Feel free to shoot them questions just put a title in the mail saying “Question about&lt;br /&gt;Career”. I have always turned up to them when i had some serious career decision to take.&lt;br /&gt;Shivprasad Koirala :- Not a great guy but as i have done the complete book i have to take up one of&lt;br /&gt;the positions. You can contact me at shiv_koirala@yahoo.com for technical career aspect.&lt;br /&gt;Tapan Das :- If you think you are aiming at becoming a project manager he is the right person to&lt;br /&gt;consult. He can answer all your questions regarding how to groom your career as a project manager&lt;br /&gt;tapand@vsnl.com.&lt;br /&gt;Kapil Siddharth :- If you are thinking to grow as architect in a company then he is a guy. When it&lt;br /&gt;comes to role model as architect i rate this guy at the top. You can contact him at&lt;br /&gt;kapilsiddharth@hotmail.com&lt;br /&gt;Second if you think you can help the developers mail me at shiv_koirala@yahoo.com and if i find&lt;br /&gt;you fitting in the panel i will display your mail address. Please note there are no financial rewards as&lt;br /&gt;such but i am sure you will be proud of the work you are doing and whos knows what can come up.&lt;br /&gt;Lets make Software Industry a better place to work ..... Happy Job Hunting and Best of Luck&lt;br /&gt;Career Path Institute&lt;br /&gt;Author runs the “Softwar Career Path Insitute” personally in mumbai. If you are interested you can&lt;br /&gt;contact him regarding admissions at shiv_koirala@yahoo.com. Our courses are mainly targetting&lt;br /&gt;from how to get a job perspective.&lt;br /&gt;Below are some of the courses offered :-&lt;br /&gt;-- Interview preparation course two days ( Saturday and Sunday Batch). ( C# , SQL Server)&lt;br /&gt;-- Full one year course for C# , SQL Server&lt;br /&gt;www.questpond.com&lt;br /&gt;www.questpond.com&lt;br /&gt;7&lt;br /&gt;4.Servlets and JSP&lt;br /&gt;(B) What are Servlets?&lt;br /&gt;Servlets are small program which execute on the web server. They run under web server&lt;br /&gt;environment exploiting the functionalities of the web server.&lt;br /&gt;(B) What are advantages of servlets over CGI?&lt;br /&gt;In CGI for every request there is a new process started which is quiet an overhead. In&lt;br /&gt;servlets JVM stays running and handles each request using a light weight thread. In CGI&lt;br /&gt;if there are 1000 request then 1000 CGI program is loaded in memory while in servlets&lt;br /&gt;there are 1000 thread and only one copy of the servlet class.&lt;br /&gt;(B) Can you explain Servlet life cycle?&lt;br /&gt;Figure 4.1 : - Servlet Life cycle&lt;br /&gt;There are three methods which are very important in servlet life cycle i.e. "init”, "service"&lt;br /&gt;and "destroy". Server invokes "init ()" method when servlet is first loaded in to the web&lt;br /&gt;server memory. Servlet reads HTTP data provided in HTTP request in the "service ()"&lt;br /&gt;method. Once initialized servlet remains in memory to process subsequent request. So&lt;br /&gt;for every HTTP request "service ()" method of the servlet is called. Finally when server&lt;br /&gt;unloads the "servlet ()" from the memory it calls the "destroy" method which can be used&lt;br /&gt;to clean up any resource the servlet is consuming.&lt;br /&gt;(B) What are the two important API’s in for Servlets?&lt;br /&gt;8&lt;br /&gt;Two important packages are required to build servlet "javax.servlet" and&lt;br /&gt;"javax.servlet.http". They form the core of Servlet API. Servlets are not part of core&lt;br /&gt;Java but are standard extensions provided by Tomcat.&lt;br /&gt;(B) Can you explain in detail “javax.servlet” package?&lt;br /&gt;javax.servlet package has interfaces and classes which define a framework in which servlets&lt;br /&gt;can operate. Let’s first make a walk through of all the interfaces and methods and its&lt;br /&gt;description.&lt;br /&gt;Interfaces in javax.servlet&lt;br /&gt;Servlet Interface&lt;br /&gt;This interface has the init( ), service( ), and destroy( ) methods that are called by the&lt;br /&gt;server during the life cycle of a servlet.&lt;br /&gt;Following are the method in Servlet interface :-&lt;br /&gt;void destroy( ):- Executed when servlet is unloaded from the web server memory.&lt;br /&gt;ServletConfig getServletConfig() :- Returns back a ServletConfig object that contains&lt;br /&gt;initialization data.&lt;br /&gt;String getServletInfo( ):- Returns a string describing the servlet.&lt;br /&gt;init method :- Called for first time when the servlet is initialized by the web server.&lt;br /&gt;void service() method :- Called to process a request from a client.&lt;br /&gt;ServletConfig Interface&lt;br /&gt;This interface is implemented by the servlet container. Servlet can access any configuration&lt;br /&gt;data when its loaded. The methods declared by this interface are summarized here:&lt;br /&gt;Following are the methods in ServletConfig interface:-&lt;br /&gt;ServletContext getServletContext():- Gives the servlet context.&lt;br /&gt;String getInitParameter(String param):- Returns the value of the initialization parameter&lt;br /&gt;named param.&lt;br /&gt;Enumeration getInitParameterNames() :- Returns an enumeration of all initialization&lt;br /&gt;parameter names.&lt;br /&gt;9&lt;br /&gt;String getServletName( ) :- Returns the name of the invoking servlet.&lt;br /&gt;(I)What’s the use of ServletContext?&lt;br /&gt;ServletContext Interface&lt;br /&gt;It gives information about the environment. It represents a Servlet's view of the Web&lt;br /&gt;Application.Using this interface servlet can access raw input streams to Web Application&lt;br /&gt;resources, virtual directory translation, a common mechanism for logging information,&lt;br /&gt;and an application scope for binding objects.&lt;br /&gt;Following are the methods defined in ServletContext Interface&lt;br /&gt;Object getAttribute(String attr) :- Returns the value of the server attribute named attr.&lt;br /&gt;String getMimeType(String file) :- Gives MIME type for a file.&lt;br /&gt;String getRealPath(String vpath) :- Gives the actual physical path for a virtual path.&lt;br /&gt;String getServerInfo( ) :- You can get the server information using this function.&lt;br /&gt;void log(String s) :- Used to write to server log.&lt;br /&gt;void log(String s, Throwable e) :- Writes s and the stack trace for e to the servlet log.&lt;br /&gt;void setAttribute(String attr, Object val) :- Sets the attribute specified by attr to the&lt;br /&gt;value passed in val.&lt;br /&gt;ServletRequest Interface&lt;br /&gt;The ServletRequest interface is implemented by the servlet container. It gives data regarding&lt;br /&gt;client request.&lt;br /&gt;Following are the methods defined in ServletRequest Interface&lt;br /&gt;Object getAttribute(String attr) :- Returns the value of the attribute named attr.&lt;br /&gt;String getCharacterEncoding( ) :- Returns the character encoding of the request.&lt;br /&gt;int getContentLength( ) :- Gives the size of the request. If no size is there then it returns&lt;br /&gt;-1.&lt;br /&gt;10&lt;br /&gt;String getContentType( ) :- Returns the type of the request. A null value is returned if the&lt;br /&gt;type cannot be determined.&lt;br /&gt;ServletInputStream getInputStream( ) :- Returns a ServletInputStream that can be used&lt;br /&gt;to read binary data from the request.&lt;br /&gt;String getParameter(String pname) :- Returns the value of the parameter named pname.&lt;br /&gt;Enumeration getParameterNames( ) :- Returns an enumeration of the parameter names&lt;br /&gt;for this request.&lt;br /&gt;String[ ] getParameterValues(String name) :- Returns an array containing values associated&lt;br /&gt;with the parameter specified by name.&lt;br /&gt;String getProtocol( ) :- Gives back protocol description.&lt;br /&gt;BufferedReader getReader( ) :- Returns a buffered reader that can be used to read text&lt;br /&gt;from the request.&lt;br /&gt;String getRemoteAddr() :-Returns client IP address.&lt;br /&gt;String getRemoteHost() :- Returns client host name.&lt;br /&gt;String getScheme( ) :- Return what’s the transmission protocol HTTP , FTP etc.&lt;br /&gt;String getServerName() :- Returns the name of the server.&lt;br /&gt;int getServerPort() :- Returns the port number.&lt;br /&gt;ServletResponse Interface&lt;br /&gt;The ServletResponse interface is implemented by the servlet containerUsed to give&lt;br /&gt;response back to the client.&lt;br /&gt;Following are the methods defined in ServletResponse Interface&lt;br /&gt;String getCharacterEncoding() :- Returns back character encoding.&lt;br /&gt;ServletOutputStream getOutputStream() :- Returns a ServletOutputStream that can be&lt;br /&gt;used to write binary data to the response.&lt;br /&gt;PrintWriter getWriter() :- Returns a PrintWriter that can be used to write character data to&lt;br /&gt;the response.&lt;br /&gt;void setContentLength(int size) :- Sets the content length for the response to size.&lt;br /&gt;11&lt;br /&gt;void setContentType(String type) :- Sets the content type for the response to type.&lt;br /&gt;GenericServlet Class&lt;br /&gt;The GenericServlet class provides implementations of the basic life cycle methods for a&lt;br /&gt;servlet. GenericServlet implements the Servlet and ServletConfig interfaces.&lt;br /&gt;void log(String s)&lt;br /&gt;void log(String s, Throwable e)&lt;br /&gt;Here, s is the string to be appended to the log, and e is an exception that occurred.&lt;br /&gt;Now let’s revise through different classes.&lt;br /&gt;ServletInputStream Class&lt;br /&gt;This class extends InputStream. It is implemented by the servlet container and provides&lt;br /&gt;an input stream that a servlet developer can use to read the data from a client request. It&lt;br /&gt;defines the default constructor. In addition, a method is provided to read bytes from the&lt;br /&gt;stream.&lt;br /&gt;int readLine(byte[ ] buffer, int offset, int size) :- Here, buffer is the array into which size&lt;br /&gt;bytes are placed starting at offset. The method returns the actual number of bytes read or&lt;br /&gt;–1 if an end-of-stream condition is encountered.&lt;br /&gt;ServletOutputStream Class&lt;br /&gt;The ServletOutputStream class extends OutputStream. It is implemented by the servlet&lt;br /&gt;container and provides an output stream that a servlet developer can use to write data to&lt;br /&gt;a client response. A default constructor is defined. It also defines the “print()” and&lt;br /&gt;“println()” methods, which output data to the stream.&lt;br /&gt;Servlet Exception Classes&lt;br /&gt;javax.servlet defines two exceptions. The first is ServletException, which indicates that a&lt;br /&gt;servlet problem has occurred. The second is unavailableException, which extends&lt;br /&gt;ServletException. It indicates that a servlet is unavailable.&lt;br /&gt;(I) How do we define an application level scope for servlet?&lt;br /&gt;12&lt;br /&gt;(B) What's the difference between GenericServlet and HttpServlet?&lt;br /&gt;HttpServlet class extends GenericServlet class which is an abstract class to provide HTTP&lt;br /&gt;protocol-specific functionalities. Most of the java application developers extend&lt;br /&gt;HttpServlet class as it provides more HTTP protocol-specific functionalities. You can&lt;br /&gt;see in HttpServlet class doGet (), doPOst () methods which are more targeted towards&lt;br /&gt;HTTP protocol specific functionalities. For instance we can inherit from GenericServlet&lt;br /&gt;class to make something like MobileServlet. So GenericServlet class should be used when&lt;br /&gt;we want to write protocol specific implementation which is not available. But when we&lt;br /&gt;know we are making an internet application where HTTP is the major protocol its better&lt;br /&gt;to use HttpServlet.&lt;br /&gt;(B) Can you explain in detail javax.servlet.http package?&lt;br /&gt;The javax.servlet.http package inherits from “javax.servlet” package and supplies HTTP&lt;br /&gt;protocol specific functionalities for JAVA developers. If you are aiming at developing&lt;br /&gt;HTTP application you will find “javax.servlet.HTTP” more comfortable than&lt;br /&gt;“javax.servlet”.&lt;br /&gt;So let’s revisit through the interfaces and methods&lt;br /&gt;HttpServletRequest Interface&lt;br /&gt;Below are the lists of methods in HttpServletRequest Interface:-&lt;br /&gt;String getAuthType( ):- Returns the type of authentication.&lt;br /&gt;Cookie[ ] getCookies( ) :- Returns the collection of cookies for the request.&lt;br /&gt;long getDateHeader(String field) :- Returns the value of the date header field named&lt;br /&gt;field.&lt;br /&gt;String getHeader(String field) :- Returns the value of the header field named field.&lt;br /&gt;Enumeration getHeaderNames( ) :- Returns an enumeration of the header names.&lt;br /&gt;int getIntHeader(String field) :- Returns the int equivalent of the header field named&lt;br /&gt;field.&lt;br /&gt;String getMethod( ) :- What type of method does this request have POST , GET etc.&lt;br /&gt;13&lt;br /&gt;String getPathInfo( ) :- Returns any path information that is located after the servlet path&lt;br /&gt;and before a query string of the URL.&lt;br /&gt;String getPathTranslated( ) :- Returns any path information that is located after the servlet&lt;br /&gt;path and before a query string of the URL after translating it to a real path.&lt;br /&gt;String getQueryString( ) :- Returns any query string in the URL.&lt;br /&gt;String getRemoteUser( ) :- Returns the name of the user who issued this request.&lt;br /&gt;String getRequestedSessionId( ) :- Returns the ID of the session.&lt;br /&gt;String getRequestURI( ) :- Returns the URI.&lt;br /&gt;StringBuffer getRequestURL( ) :- Returns the URL.&lt;br /&gt;String getServletPath( ) :- Returns that part of the URL that identifies the servlet.&lt;br /&gt;HttpSession getSession( ) :- Returns the session for this request. If a session does not&lt;br /&gt;exist, one is created and then returned.&lt;br /&gt;HttpSession getSession(boolean new) :- If new is true and no session exists, creates and&lt;br /&gt;returns a session for this request. Otherwise, returns the existing session for this request.&lt;br /&gt;This section is explained in more detail in further questions.&lt;br /&gt;boolean isRequestedSessionIdFromCookie( ) :- Returns true if the cookie has the session&lt;br /&gt;id.&lt;br /&gt;boolean isRequestedSessionIdFromURL( ) :- Gives true if the URL has session id.&lt;br /&gt;boolean isRequestedSessionIdValid( ) :- Return true if the session is valid in the current&lt;br /&gt;context.&lt;br /&gt;HttpServletResponse Interface&lt;br /&gt;The HttpServletResponse interface is implemented by the servlet container. It enables a&lt;br /&gt;servlet to formulate an HTTP response to a client. Several constants are defined. These&lt;br /&gt;correspond to the different status codes that can be assigned to an HTTP response.&lt;br /&gt;Below are the methods and functions for the interface&lt;br /&gt;void addCookie(Cookie cookie) :-Adds cookie to the HTTP response.&lt;br /&gt;14&lt;br /&gt;String encodeURL(String url) :- Determines if the session ID must be encoded in the&lt;br /&gt;URL identified as url. If so, returns the modified version of URL. Otherwise, returns&lt;br /&gt;URL. All URLs generated by a servlet should be processed by this method.&lt;br /&gt;String encodeRedirectURL(String url) :- Determines if the session ID must be encoded in&lt;br /&gt;the URL identified as url. If so, returns the modified version of URL. Otherwise, returns&lt;br /&gt;URL. All URLs passed to sendRedirect( ) should be processed by this method.&lt;br /&gt;void sendError(int c) :- Sends the error code c to the client.&lt;br /&gt;void sendError(int c, String s) :- Sends the error code c and message s to the client.&lt;br /&gt;void sendRedirect(String url) :- Redirects the client to url.&lt;br /&gt;void setDateHeader(String field, long msec) :- Adds field to the header with date value&lt;br /&gt;equal to msec (milliseconds since midnight, January 1, 1970, GMT).&lt;br /&gt;void setHeader(String field, String value) :- Adds field to the header with value equal to&lt;br /&gt;value.&lt;br /&gt;void setIntHeader(String field, int value) :- Adds field to the header with value equal to&lt;br /&gt;value.&lt;br /&gt;void setStatus(int code) :- Sets the status code for this response to code.&lt;br /&gt;HttpSession Interface&lt;br /&gt;HTTP protocol is a stateless protocol and this interface enables to maintain sessions&lt;br /&gt;between requests.&lt;br /&gt;Object getAttribute(String attr) :- Returns the value associated with the name passed in&lt;br /&gt;attr. Returns null if attr is not found.&lt;br /&gt;Enumeration getAttributeNames( ) :- Returns an enumeration of the attribute names&lt;br /&gt;associated with the session.&lt;br /&gt;long getCreationTime( ) :- Returns the time (in milliseconds since midnight, January 1,&lt;br /&gt;1970, GMT) when this session was created.&lt;br /&gt;String getId( ) :- Returns the session ID.&lt;br /&gt;long getLastAccessedTime( ) :- Returns the time (in milliseconds since midnight, January&lt;br /&gt;1, 1970, GMT) when the client last made a request for this session.&lt;br /&gt;15&lt;br /&gt;void invalidate() :- Invalidates this session and removes it from the context.&lt;br /&gt;boolean isNew( ) :- Returns true if the server created the session and it has not yet been&lt;br /&gt;accessed by the client.&lt;br /&gt;void removeAttribute(String attr) :- Removes the attribute specified by attr from the&lt;br /&gt;session.&lt;br /&gt;void setAttribute(String attr, Object val) :- Associates the value passed in val with the&lt;br /&gt;attribute name passed in attr.&lt;br /&gt;HttpSessionBindingListener&lt;br /&gt;The HttpSessionBindingListener interface is implemented by objects that need to be&lt;br /&gt;notified when they are bound to or unbound from an HTTP session. The methods that&lt;br /&gt;are invoked when an object is bound or unbound are&lt;br /&gt;void valueBound(HttpSessionBindingEvent e)&lt;br /&gt;void valueUnbound(HttpSessionBindingEvent e)&lt;br /&gt;Here, e is the event object that describes the binding.&lt;br /&gt;Cookie Class&lt;br /&gt;The Cookie class encapsulates a cookie. A cookie is stored on a client and contains state&lt;br /&gt;information. Cookies are valuable for tracking user activities. For example, assume that a&lt;br /&gt;user visits an online store. A cookie can save the user's name, address, and other&lt;br /&gt;information. The user does not need to enter this data each time he or she visits the store.&lt;br /&gt;A servlet can write a cookie to a user's machine via the addCookie( ) method of the&lt;br /&gt;HttpServletResponse interface. The data for that cookie is then included in the header of&lt;br /&gt;the HTTP response that is sent to the browser.&lt;br /&gt;The names and values of cookies are stored on the user's machine. Some of the information&lt;br /&gt;that is saved for each cookie includes name of the cookie, value of the cookie, expiration&lt;br /&gt;date of the cookie and domain/path of the cookie.&lt;br /&gt;The expiration date determines when this cookie is deleted from the user's machine. If an&lt;br /&gt;expiration date is not explicitly assigned to a cookie, it is deleted when the current browser&lt;br /&gt;session ends. Otherwise, the cookie is saved in a file on the user's machine.&lt;br /&gt;16&lt;br /&gt;The domain and path of the cookie determine when it is included in the header of an&lt;br /&gt;HTTP request. If the user enters a URL whose domain and path match these values, the&lt;br /&gt;cookie is then supplied to the Web server. Otherwise, it is not. There is one constructor&lt;br /&gt;for Cookie. It has the signature shown here:&lt;br /&gt;Cookie(String name, String value) :- Here, the name and value of the cookie are supplied&lt;br /&gt;as arguments to the constructor. The methods of the Cookie class are&lt;br /&gt;Object clone( ) :- Returns a copy of this object.&lt;br /&gt;String getComment( ) :- Returns the comment.&lt;br /&gt;String getDomain( ) :- Returns the domain.&lt;br /&gt;int getMaxAge( ) :- Returns the maximum age (in seconds).&lt;br /&gt;String getName( ) :- Returns the name.&lt;br /&gt;String getPath( ) :- Returns the path.&lt;br /&gt;boolean getSecure( ) :- Returns true if the cookie is secure. Otherwise, returns false.&lt;br /&gt;String getValue( ) :- Returns the value.&lt;br /&gt;int getVersion( ) :- Returns the version.&lt;br /&gt;void setComment(String c) :- Sets the comment to c.&lt;br /&gt;void setDomain(String d) :- Sets the domain to d.&lt;br /&gt;void setMaxAge(int secs) :- Sets the maximum age of the cookie to secs. This is the&lt;br /&gt;number of seconds after which the cookie is deleted.&lt;br /&gt;void setPath(String p) :- Sets the path to p.&lt;br /&gt;void setSecure(boolean secure) :- Sets the security flag to secure.&lt;br /&gt;void setValue(String v) :- Sets the value to v.&lt;br /&gt;void setVersion(int v) :- Sets the version to v.&lt;br /&gt;HttpServlet Class&lt;br /&gt;The HttpServlet class extends GenericServlet. It is commonly used when developing&lt;br /&gt;servlets that receive and process HTTP requests.&lt;br /&gt;17&lt;br /&gt;void doDelete(HttpServletRequest req, HttpServletResponse res) throws IOException,&lt;br /&gt;ServletException :- Handles an HTTP DELETE.&lt;br /&gt;void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException,&lt;br /&gt;ServletException :- Handles an HTTP GET.&lt;br /&gt;void doOptions(HttpServletRequest req, HttpServletResponse res) throws IOException,&lt;br /&gt;ServletException :- Handles an HTTP OPTIONS.&lt;br /&gt;void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException,&lt;br /&gt;ServletException :- Handles an HTTP POST.&lt;br /&gt;void doPut(HttpServletRequest req, HttpServletResponse res) throws IOException,&lt;br /&gt;ServletException :- Handles an HTTP PUT.&lt;br /&gt;void doTrace(HttpServletRequest req, HttpServletResponse res) throws IOException,&lt;br /&gt;ServletException :- Handles an HTTP TRACE.&lt;br /&gt;long getLastModified(HttpServletRequest req) :- Returns the time (in milliseconds since&lt;br /&gt;midnight, January 1, 1970, GMT) when the requested resource was last modified.&lt;br /&gt;void service(HttpServletRequest req, HttpServletResponse res) throws IOException,&lt;br /&gt;ServletException :- Called by the server when an HTTP request arrives for this servlet.&lt;br /&gt;The arguments provide access to the HTTP request and response, respectively.&lt;br /&gt;HttpSessionEvent Class&lt;br /&gt;HttpSessionEvent encapsulates session events. It extends EventObject and is generated&lt;br /&gt;when a change occurs to the session.&lt;br /&gt;HttpSession getSession( )&lt;br /&gt;It returns the session in which the event occurred.&lt;br /&gt;The HttpSessionBindingEvent Class&lt;br /&gt;The HttpSessionBindingEvent class extends HttpSessionEvent. It is generated when a&lt;br /&gt;listener is bound to or unbound from a value in an HttpSession object. It is also generated&lt;br /&gt;when an attribute is bound or unbound. Here are its constructors:&lt;br /&gt;HttpSessionBindingEvent(HttpSession session, String name)&lt;br /&gt;HttpSessionBindingEvent(HttpSession session, String name, Object val)&lt;br /&gt;18&lt;br /&gt;Here, session is the source of the event, and name is the name associated with the object&lt;br /&gt;that is being bound or unbound. If an attribute is being bound or unbound, its value is&lt;br /&gt;passed in Val.&lt;br /&gt;String getName( ) :- The getName( ) method obtains the name that is being bound or&lt;br /&gt;unbound. Its constructor is shown here:&lt;br /&gt;HttpSession getSession( ) :- The getSession( ) method, shown next, obtains the session to&lt;br /&gt;which the listener is being bound or unbound:&lt;br /&gt;Object getValue( ) :- The getValue( ) method obtains the value of the attribute that is&lt;br /&gt;being bound or unbound. It is shown here:&lt;br /&gt;(B) What’s the architecture of a Servlet package?&lt;br /&gt;In the previous questions we saw all the servlet packages. But the basic architecture of&lt;br /&gt;the servlet packages is as shown below.&lt;br /&gt;Figure 4.2 : - Servlet package in action&lt;br /&gt;At the top of all is the main servlet interface which is implemented by the generic servlet.&lt;br /&gt;But generic servlet does not provide implementation specific to any protocol. HTTP&lt;br /&gt;servlet further inherits from the generic servlet and provides HTTP implementation like&lt;br /&gt;“Get” and “Post”. Finally comes our custom servlet which inherits from HTTP Servlet.&lt;br /&gt;(B) Why is HTTP protocol called as a stateless protocol?&lt;br /&gt;19&lt;br /&gt;A protocol is stateless if it can remember difference between one client request and the&lt;br /&gt;other. HTTP is a stateless protocol because each request is executed independently without&lt;br /&gt;any knowledge of the requests that came before it.&lt;br /&gt;Figure 4.3 : - HTTP Protocol in action&lt;br /&gt;Above is a pictorial presentation of how a stateless protocol operates. User first sends&lt;br /&gt;“request1” and server responds with “response1”. When the same user comes back with&lt;br /&gt;“request2” server treats this as new user and has no idea that it’s the same user who has&lt;br /&gt;come with the request. In short every request is a new request for the HTTP protocol so&lt;br /&gt;it’s called as a stateless protocol.&lt;br /&gt;(B) What are the different ways we can maintain state between requests?&lt;br /&gt;Following are the different ways of maintaining state’s between stateless requests:-&lt;br /&gt;√ URL rewriting&lt;br /&gt;√ Cookies&lt;br /&gt;√ Hidden fields&lt;br /&gt;√ Sessions&lt;br /&gt;(B) What is URL rewriting?&lt;br /&gt;It’s based on the concept of attaching a unique ID (which is generated by the server) in&lt;br /&gt;the URL of response from the server. So the server attaches this unique ID in each URL.&lt;br /&gt;20&lt;br /&gt;When the client sends a requests it sends back this ID with the request also which helps&lt;br /&gt;the server to identify the client uniquely.&lt;br /&gt;Note: - A sample code for URL rewriting is in the CD in “URLRewriting” folder.&lt;br /&gt;Below is a snippet which is extracted from the code which is provided in the CD.&lt;br /&gt;Figure 4.4 : - URLRewriting in Action&lt;br /&gt;In this sample we have generated a unique ID using the random class of java. This unique&lt;br /&gt;ID is then sent in the query string (see step 3 of the above snippet) back to the client.&lt;br /&gt;When the client comes back to the server the server first gets the token value from the&lt;br /&gt;query string and thus identifying the client uniquely.&lt;br /&gt;(B) What are cookies?&lt;br /&gt;Cookies are piece of data which are stored at the client’s browser to track information&lt;br /&gt;regarding the user usage and habits. Servlets sends cookies to the browser client using the&lt;br /&gt;HTTP response headers. When client gets the cookie information it’s stored by the browser&lt;br /&gt;21&lt;br /&gt;in the client’s hard disk. Similarly client returns the cookie information using the HTTP&lt;br /&gt;request headers.&lt;br /&gt;Figure 4.5 : - Cookies in action&lt;br /&gt;22&lt;br /&gt;Figure 4.6 : - Cookies code walkthrough&lt;br /&gt;Above is a simple snippet which shows how to use cookies. To create a cookie you need&lt;br /&gt;to use the “Cookie” class. In the above snippet step1 creates a cookie using the “Cookie”&lt;br /&gt;class. In this case “favoritecookiebook” is the name of the cookie. In Step 2 you can see&lt;br /&gt;how a cookie has been added to the response. Step 3 code shows how to get all the&lt;br /&gt;cookies which has come in the current request header. Step 4 shows the way to get a&lt;br /&gt;cookie from a collection in this case we wanted to retrieve “favoritecookiebook” from&lt;br /&gt;the cookies collection.&lt;br /&gt;Note: - You can get the above code in “cookies” folder.&lt;br /&gt;(B)What are sessions in Servlets?&lt;br /&gt;(B)What’s the difference between getSession(true) and getSession(false)&lt;br /&gt;?&lt;br /&gt;Session's can be considered as a series of related interactions between client and the&lt;br /&gt;server that take place over a period of time. Because HTTP is a stateless protocol these&lt;br /&gt;series of interactions are difficult to track. That’s where we can use HttpSession object to&lt;br /&gt;save in between of these interactions so that server can co-relate between interactions&lt;br /&gt;between clients.&lt;br /&gt;23&lt;br /&gt;Figure 4.7 : - Session code walkthrough&lt;br /&gt;Above is the code snippet which displays session data. Step1 returns an HttpSession&lt;br /&gt;object from the request object. “true” parameter in the “getsession” function ensures that&lt;br /&gt;we get a session object if there is no current session object in request which ensures that&lt;br /&gt;we never get a null session object. In Step 2 we are using the “getattribute” function to&lt;br /&gt;return the session value. In step 3 we are setting the session value with “Name” key.&lt;br /&gt;Note: - In source code folder we have a sample project “sessions” which can make your&lt;br /&gt;concept clearer.&lt;br /&gt;(I)What’s the difference between “doPost” and “doGet” methods?&lt;br /&gt;When we invoke a servlet the servlet engine passes information to service () method of&lt;br /&gt;the servlet. Service method evaluates whether it’s a GET or a POST request type. GET&lt;br /&gt;and POST differ from the way data is passed to the server. In GET data is passed as a&lt;br /&gt;query string attached to the URL for instance http://www.xyz.com/x.asp?Name=Shiv.&lt;br /&gt;So when you pass data through get method you can see the data in your browser URL&lt;br /&gt;which can be bad thing for critical data like password. In POST method data is passed&lt;br /&gt;through normal input stream. You will not be able to view data like how we get for GET&lt;br /&gt;method.&lt;br /&gt;So for POST method below is the HTML code.&lt;br /&gt;&lt;form name='MyServlet' method='POST' &gt;&lt;br /&gt;For GET method below is the HTML code&lt;br /&gt;&lt;form name='MyServlet' method='GET'&gt;&lt;br /&gt;(I)Which are the different ways you can communicate between servlets?&lt;br /&gt;Below are the different ways of communicating between servlets:-&lt;br /&gt;√ Using RequestDispatcher object.&lt;br /&gt;√ Sharing resource using “ServletContext ()” object.&lt;br /&gt;√ Include response of the resource in the response of the servlet.&lt;br /&gt;√ Calling public methods of the resource.&lt;br /&gt;√ Servlet chaining.&lt;br /&gt;24&lt;br /&gt;(I)What is functionality of “RequestDispatcher” object?&lt;br /&gt;Figure 4.8 : - RequestDispatcher in action&lt;br /&gt;Above is the code snippet for “requestdispatcher”. Code snippet&lt;br /&gt;“getServletContext().getRequestDispatcher("/servlet/clsAdd"); “gets the&lt;br /&gt;“requestdisptacherobject”. In order to call the other servlet class we call the forward&lt;br /&gt;method which in turn invokes the service method of the other servlets.&lt;br /&gt;Note: - There is a sample project “requestdispatcher” which you can open and see. In order&lt;br /&gt;to see how the dispatcher will work you can pass the “WhattoDo” as either “A” or “M” as&lt;br /&gt;shown in the figure below. Corresponding servlets are called depending on this value.&lt;br /&gt;25&lt;br /&gt;Figure 4.9 : - Running the dispatcher project through URL&lt;br /&gt;(I) How do we share data using “getServletContext ()”?&lt;br /&gt;Using the “getServletContext ()” we can make data available at application level. So&lt;br /&gt;servlets which lie in the same application can get the data. Below are important snippets&lt;br /&gt;which you will need to add, get and remove data which can be shared across servlets.&lt;br /&gt;Figure 4.10 : - Sharing data using “getServletContext ()”&lt;br /&gt;You can see in Step1 how “getServletContext().setAttribute()” method can be used add&lt;br /&gt;new objects to the “getServletContext” collection. Step2 shows how we can get the object&lt;br /&gt;back using “getAttribute()” and manipulate the same. Step3 shows how to remove an&lt;br /&gt;already shared application object from the collection. “getServletContext()” object is&lt;br /&gt;shared across servlets with in a application and thus can be used to share data between&lt;br /&gt;servlets.&lt;br /&gt;(B) Explain the concept of SSI?&lt;br /&gt;Server Side Includes (SSI) are commands and directives placed in Web pages that are&lt;br /&gt;evaluated by the Web server when the Web page is being served. SSI are not supported by&lt;br /&gt;all web servers. So before using SSI read the web server documentation for the support.&lt;br /&gt;SSI is useful when you want a small part of the page to be dynamically generated rather&lt;br /&gt;than loading the whole page again.&lt;br /&gt;Below is the code for SSI which needs to be inserted in between the HTML tags.&lt;br /&gt;&lt;SERVLET CODE=MyServlet CODEBASE=path&lt;br /&gt;initparam1=initvalue1 initparam2=initvalue2&gt;&lt;br /&gt;26&lt;br /&gt;&lt;PARAM NAME=param1 VALUE=value1&gt;&lt;br /&gt;&lt;PARAM NAME=param2 VALUE=value2&gt;&lt;br /&gt;&lt;/SERVLET&gt;&lt;br /&gt;Here the CODE attribute specifies the servlet name. The CODEBASE attribute indicates&lt;br /&gt;the servlet location. If you are using a servlet deployed in the same Web server, you can&lt;br /&gt;omit the CODEBASE attribute. You can pass any request parameters to the servlet&lt;br /&gt;using the PARAM tags.&lt;br /&gt;Below is the code how the SSI looks in the HTML&lt;br /&gt;&lt;HTML&gt;&lt;br /&gt;&lt;HEAD&gt;&lt;br /&gt;&lt;TITLE&gt;Using SSL&lt;/TITLE&gt;&lt;br /&gt;&lt;BODY&gt;&lt;br /&gt;&lt;SERVLET CODE=MyServlet CODEBASE=path&lt;br /&gt;initparam1=initvalue1 initparam2=initvalue2&gt;&lt;br /&gt;&lt;PARAM NAME=param1 VALUE=value1&gt;&lt;br /&gt;&lt;PARAM NAME=param2 VALUE=value2&gt;&lt;br /&gt;&lt;/SERVLET&gt;&lt;br /&gt;&lt;/BODY&gt;&lt;br /&gt;&lt;/HTML&gt;&lt;br /&gt;(I) What are filters in JAVA?&lt;br /&gt;Filters are nothing but simple java classes which can manipulate request before it reaches&lt;br /&gt;the resource on the web server. Resource can be a HTML file, servlet class, JSP etc. It can&lt;br /&gt;also intercept responses sent back to client and thus can manipulate the response before&lt;br /&gt;they reach the client browser.&lt;br /&gt;27&lt;br /&gt;Figure 4.11 : - Filter in action&lt;br /&gt;(A)Can you explain in short how do you go about implementing filters&lt;br /&gt;using Apache Tomcat?&lt;br /&gt;Twist: - Explain step by step of how to implement filters?&lt;br /&gt;In order to make a class as a filter we need to inherit from the “Filter” class. You can see&lt;br /&gt;the same in the code sample below in Step1.&lt;br /&gt;28&lt;br /&gt;Figure 4.12 : - Filter code walkthrough&lt;br /&gt;Above class “clsTimeFilter” logs the time required for resource to load. You can see in&lt;br /&gt;the above code in Step2 we have taken beforetime and aftertime values. In between of&lt;br /&gt;them we have called the “dofilter” (Which is Step 3). Finally at Step4 we send the difference&lt;br /&gt;of the aftertime and beforetime to the log file.&lt;br /&gt;29&lt;br /&gt;Figure 4.13 : - Filter mapped to URL&lt;br /&gt;Once we compile the class file we need to do two important steps one is define the filter&lt;br /&gt;and map the filter to the URL. As we are using tomcat we need to define the same in&lt;br /&gt;“web.xml” file. Above is a snippet of “web.xml” file with both the entries. The first entry&lt;br /&gt;defines the filter name and second maps it to a URL. Currently the URL pattern is “*”&lt;br /&gt;that means any servlet requested will invoke the “clsTimeFilter” filter.&lt;br /&gt;Once you have deployed the filter and you request a URL you can see the output sent by&lt;br /&gt;the filter to the LOG of tomcat.&lt;br /&gt;Figure 4.14 : - Log file entry&lt;br /&gt;Note:-You can get the source code for the filter in “Filters” folder.&lt;br /&gt;Note: - Running JSP is a breeze if the web server supports it. In CD we have provided&lt;br /&gt;Tomcat 5.5 installation. Tomcat 5.5 support JSP. You only need to create a folder for your&lt;br /&gt;project in webapps folder and put in your JSP files.&lt;br /&gt;(I) what’s the difference between Authentication and authorization?&lt;br /&gt;30&lt;br /&gt;Authentication is the process the application identifies that you are who. For example&lt;br /&gt;when a user logs into an application with a username and password, application checks&lt;br /&gt;that the entered credentials against its user data store and responds with success or failure.&lt;br /&gt;Authorization, on the other hand, is when the application checks to see if you're allowed&lt;br /&gt;to do something. For instance are you allowed to do delete or modify a resource.&lt;br /&gt;(B) Explain in brief the directory structure of a web application?&lt;br /&gt;Below is the directory structure of a web application:-&lt;br /&gt;webapp/&lt;br /&gt;WEB-INF/web.xml&lt;br /&gt;WEB-INF/classes&lt;br /&gt;WEB-INF/lib&lt;br /&gt;√ The webapp directory contains the JSP files, images, and HTML files. The webapp&lt;br /&gt;directory can also contain subdirectories such as images or html or can be organized&lt;br /&gt;by function, such as public or private.&lt;br /&gt;√ The WEB-INF/web.xml file is called the deployment descriptor for the Web&lt;br /&gt;application. This file contains configuration information for the Web application,&lt;br /&gt;including the mappings of URLs to servlets and filters. The web.xml file also contains&lt;br /&gt;configuration information for security, MIME type mapping, error pages, and locale&lt;br /&gt;settings&lt;br /&gt;√ The WEB-INF/classes directory contains the class files for the servlets, JSP files,&lt;br /&gt;tag libraries, and any other utility classes that are used in the Web application.&lt;br /&gt;√ The WEB-INF/lib directory contains JAR files for libraries that are used by the Web&lt;br /&gt;application. These are generally third-party libraries or classes for any tag libraries&lt;br /&gt;used by the Web application.&lt;br /&gt;(B) Can you explain JSP page life cycle?&lt;br /&gt;When first time a JSP page is request necessary servlet code is generated and loaded in&lt;br /&gt;the servlet container. Now until the JSP page is not changed the compiled servlet code&lt;br /&gt;serves any request which comes from the browser. When you again change the JSP page&lt;br /&gt;the JSP engine again compiles a servlet code for the same.&lt;br /&gt;31&lt;br /&gt;Figure 4.15 : - JSP page life cycle&lt;br /&gt;√ JSP page is first initialized by jspInit() method. This initializes the JSP in much the&lt;br /&gt;same way as servlets are initialized, when the first request is intercepted and just&lt;br /&gt;after translation.&lt;br /&gt;√ Every time a request comes to the JSP, the container generated _jspService() method&lt;br /&gt;is invoked, the request is processed, and response generated.&lt;br /&gt;√ When the JSP is destroyed by the server, the jspDestroy() method is called and this&lt;br /&gt;can be used for clean up purposes.&lt;br /&gt;(B) What is EL?&lt;br /&gt;EL stands for expression language. An expression language makes it possible to easily&lt;br /&gt;access application data.In the below expression amountofwine variable value will be&lt;br /&gt;rendered.&lt;br /&gt;&lt;b&gt;There are ${amountofwine} litres of wine in the bottle. &lt;/b&gt;&lt;br /&gt;(I) how does EL search for an attribute?&lt;br /&gt;EL parser searches the attribute in following order:&lt;br /&gt;√ Page&lt;br /&gt;√ Request&lt;br /&gt;√ Session (if it exists)&lt;br /&gt;32&lt;br /&gt;√ Application&lt;br /&gt;If no match is found for then it displays empty string.&lt;br /&gt;(B) What are the implicit EL objects in JSP?&lt;br /&gt;Following are the implicit EL objects:-&lt;br /&gt;PageContext: The context for the JSP page.&lt;br /&gt;Provides access to various objects for instance:-&lt;br /&gt;servletContext: The context for the JSP page's servlet and any web components contained&lt;br /&gt;in the same application.&lt;br /&gt;session: The session object for the client.&lt;br /&gt;request: The request triggering the execution of the JSP page.&lt;br /&gt;response: The response returned by the JSP page. See Constructing Responses.&lt;br /&gt;In addition, several implicit objects are available that allow easy access to the following&lt;br /&gt;objects:&lt;br /&gt;param: Maps a request parameter name to a single value&lt;br /&gt;paramValues: Maps a request parameter name to an array of values&lt;br /&gt;header: Maps a request header name to a single value&lt;br /&gt;headerValues: Maps a request header name to an array of values&lt;br /&gt;cookie: Maps a cookie name to a single cookie&lt;br /&gt;initParam: Maps a context initialization parameter name to a single value&lt;br /&gt;Finally, there are objects that allow access to the various scoped variables described in&lt;br /&gt;Using Scope Objects.&lt;br /&gt;pageScope: Maps page-scoped variable names to their values&lt;br /&gt;requestScope: Maps request-scoped variable names to their values&lt;br /&gt;sessionScope: Maps session-scoped variable names to their values&lt;br /&gt;applicationScope: Maps application-scoped variable names to their values&lt;br /&gt;33&lt;br /&gt;For instance the below snippet will indentify the browser used by the client.&lt;br /&gt;&lt;b&gt;Browser:&lt;/b&gt; ${header["user-agent"]}&lt;br/&gt;&lt;br /&gt;(I) How can we disable EL?&lt;br /&gt;You can disable using isELIgnored attribute of the page directive:&lt;br /&gt;&lt;%@ page isELIgnored ="true|false" %&gt;&lt;br /&gt;(I) what is JSTL?&lt;br /&gt;JSTL is also called as JSP tag libraries. They are collection of custom actions which can&lt;br /&gt;be accessed as JSP tags.&lt;br /&gt;Note: - In CD we have Jakarta tag libs jakarta-taglibs-standard-1.1.2.zip which you can&lt;br /&gt;use to practice sample tags and see how it works. When you unzip the file there are two files&lt;br /&gt;jstl.jar and standard.jar which you need to copy it in to your application's WEB-INF/lib&lt;br /&gt;directory.&lt;br /&gt;(A) Can you explain in short what the different types of JSTL tags are?&lt;br /&gt;Tags are classified in to four groups:-&lt;br /&gt;√ Core tags&lt;br /&gt;√ Formatting tags&lt;br /&gt;√ XML tags&lt;br /&gt;√ SQL tags&lt;br /&gt;Core tags&lt;br /&gt;&lt;c:if&gt; for conditional flow&lt;br /&gt;&lt;c:forEach&gt; and &lt;c:forTokens&gt; for iteration&lt;br /&gt;&lt;c:choose&gt;...&lt;c:when&gt;....&lt;c:otherwise&gt; for selective flow between mutually exclusive&lt;br /&gt;code&lt;br /&gt;&lt;c:set&gt; and &lt;c:remove&gt; for working with scoped variables&lt;br /&gt;&lt;c:out&gt; for rendering the value of variables and expressions&lt;br /&gt;34&lt;br /&gt;&lt;c:catch&gt; for working with Java exceptions&lt;br /&gt;&lt;c:url&gt; for creating and working with URLs&lt;br /&gt;Formatting tags&lt;br /&gt;Used to format and display text, the date, the time, and numbers. Below are some frequently&lt;br /&gt;used tags:-&lt;br /&gt;&lt;fmt:formatNumber&gt;: To render numerical value with specific precision or format&lt;br /&gt;&lt;fmt:formatDate&gt;: To render date and time values in a specific format (and according to&lt;br /&gt;international locale-specific conventions)&lt;br /&gt;&lt;fmt:message&gt;: To display an internationalized message (for example, a message in a&lt;br /&gt;different language using a different character set)&lt;br /&gt;XML tags&lt;br /&gt;XML tags are meant to process XML data. It supports data-parsing, transforming XML,&lt;br /&gt;plus data and flow control based on XPath expressions. These tags are used only when&lt;br /&gt;you need to work directly, within the JSP, with XML data.&lt;br /&gt;SQL tags&lt;br /&gt;They are designed to work directly with SQL tags. But most of the time you will see they&lt;br /&gt;are used for prototyping and not for final product.&lt;br /&gt;Just before we move ahead with some other questions. Let’s how do we install JSTL so&lt;br /&gt;that everything works. Below are three installation steps:-&lt;br /&gt;√ Unzip "jakarta-taglibs-standard-1.1.2.zip" and you will see two files jstl.jar and&lt;br /&gt;standard.jar in lib directory.&lt;br /&gt;√ Copy both jstl.jar and standard.jar to "\webapps\ROOT\WEB-INF\lib" directory&lt;br /&gt;in tomcat.&lt;br /&gt;√ Copy all tld files from the unzipped location to \webapps\ROOT\WEB-INF"&lt;br /&gt;directory.&lt;br /&gt;√ Modify the web.xml file to include all TLD files. Below is snippet of some tld's&lt;br /&gt;included in web.xml file.&lt;br /&gt;35&lt;br /&gt;&lt;taglib&gt;&lt;br /&gt;&lt;taglib-uri&gt;http://java.sun.com/jstl/fmt&lt;/taglib-uri&gt;&lt;br /&gt;&lt;taglib-location&gt;/WEB-INF/fmt.tld&lt;/taglib-location&gt;&lt;br /&gt;&lt;/taglib&gt;&lt;br /&gt;&lt;taglib&gt;&lt;br /&gt;&lt;taglib-uri&gt;http://java.sun.com/jstl/fmt-rt&lt;/taglib-uri&gt;&lt;br /&gt;&lt;taglib-location&gt;/WEB-INF/fmt-rt.tld&lt;/taglib-location&gt;&lt;br /&gt;&lt;/taglib&gt;&lt;br /&gt;&lt;taglib&gt;&lt;br /&gt;&lt;taglib-uri&gt;http://java.sun.com/jstl/core&lt;/taglib-uri&gt;&lt;br /&gt;&lt;taglib-location&gt;/WEB-INF/c.tld&lt;/taglib-location&gt;&lt;br /&gt;&lt;/taglib&gt;&lt;br /&gt;&lt;taglib&gt;&lt;br /&gt;&lt;taglib-uri&gt;http://java.sun.com/jstl/core-rt&lt;/taglib-uri&gt;&lt;br /&gt;&lt;taglib-location&gt;/WEB-INF/c-rt.tld&lt;/taglib-location&gt;&lt;br /&gt;&lt;/taglib&gt;&lt;br /&gt;&lt;taglib&gt;&lt;br /&gt;&lt;taglib-uri&gt;http://java.sun.com/jstl/sql&lt;/taglib-uri&gt;&lt;br /&gt;&lt;taglib-location&gt;/WEB-INF/sql.tld&lt;/taglib-location&gt;&lt;br /&gt;&lt;/taglib&gt;&lt;br /&gt;&lt;taglib&gt;&lt;br /&gt;36&lt;br /&gt;&lt;taglib-uri&gt;http://java.sun.com/jstl/sql-rt&lt;/taglib-uri&gt;&lt;br /&gt;&lt;taglib-location&gt;/WEB-INF/sql-rt.tld&lt;/taglib-location&gt;&lt;br /&gt;&lt;/taglib&gt;&lt;br /&gt;&lt;taglib&gt;&lt;br /&gt;&lt;taglib-uri&gt;http://java.sun.com/jstl/x&lt;/taglib-uri&gt;&lt;br /&gt;&lt;taglib-location&gt;/WEB-INF/x.tld&lt;/taglib-location&gt;&lt;br /&gt;&lt;/taglib&gt;&lt;br /&gt;&lt;taglib&gt;&lt;br /&gt;&lt;taglib-uri&gt;http://java.sun.com/jstl/x-rt&lt;/taglib-uri&gt;&lt;br /&gt;&lt;taglib-location&gt;/WEB-INF/x-rt.tld&lt;/taglib-location&gt;&lt;br /&gt;&lt;/taglib&gt;&lt;br /&gt;(I) How can we use beans in JSP?&lt;br /&gt;JSP provides three tags to work with beans:-&lt;br /&gt;√ &lt;jsp:useBean id=“bean name” class=“bean class” scope = “page | request | session&lt;br /&gt;|application ”/&gt;&lt;br /&gt;Bean name = the name that refers to the bean.&lt;br /&gt;Bean class = name of the java class that defines the bean.&lt;br /&gt;√ &lt;jsp:setProperty name = “id” property = “someProperty” value = “someValue” /&lt;br /&gt;&gt;&lt;br /&gt;id = the name of the bean as specified in the useBean tag.&lt;br /&gt;property = name of the property to be passed to the bean.&lt;br /&gt;value = value of that particular property .&lt;br /&gt;√ &lt;jsp:getProperty name = “id” property = “someProperty” /&gt;&lt;br /&gt;37&lt;br /&gt;Here the property is the name of the property whose value is to be obtained from the&lt;br /&gt;bean.Below is a code snippet which shows how MyUserClass is used and the values&lt;br /&gt;accessed.&lt;br /&gt;&lt;jsp:useBean id="user" class="MyUserClass" scope="session"/&gt;&lt;br /&gt;&lt;HTML&gt;&lt;br /&gt;&lt;BODY&gt;&lt;br /&gt;You entered&lt;BR&gt;&lt;br /&gt;Name: &lt;%= user.getUsername() %&gt;&lt;BR&gt;&lt;br /&gt;Email: &lt;%= user.getEmail() %&gt;&lt;BR&gt;&lt;br /&gt;&lt;/BODY&gt;&lt;br /&gt;&lt;/HTML&gt;&lt;br /&gt;(I) What is the use of &lt;jsp:include&gt; ?&lt;br /&gt;It includes the output of one JSP in to other JSP file at the location of the tag.&lt;br /&gt;Below is the syntax for the same:-&lt;br /&gt;&lt;jsp:include page="...url.." flush="true or false"/&gt;&lt;br /&gt;page: A URL that is relative to the current JSP page at request time&lt;br /&gt;flush: Determines if the buffer for the output is flushed immediately, before the included&lt;br /&gt;page's output.&lt;br /&gt;(I) What is &lt;jsp:forward&gt; tag for ?&lt;br /&gt;It forwards the current request to another JSP page. Below is the syntax for the same:-&lt;br /&gt;&lt;jsp:forward page="...url..." /&gt;&lt;br /&gt;We can also forward parameter to the other page using the param tag&lt;br /&gt;&lt;jsp:forward page="..url..."&gt;&lt;br /&gt;&lt;jsp:param ..../&gt;&lt;br /&gt;&lt;/jsp:forward&gt;&lt;br /&gt;38&lt;br /&gt;(B) What are JSP directives?&lt;br /&gt;JSP directives do not produce any output. They are used to set global values like class&lt;br /&gt;declaration, content type etc. Directives have scope for entire JSP file. They start with&lt;br /&gt;&lt;%@ and ends with %&gt;. There are three main directives that can be used in JSP:-&lt;br /&gt;√ page directive&lt;br /&gt;√ include directive&lt;br /&gt;√ taglib directive&lt;br /&gt;(I) what are Page directives?&lt;br /&gt;Page directive is used to define page attributes the JSP file. Below is a sample of the&lt;br /&gt;same:-&lt;br /&gt;&lt;%@ page language="Java" import="java.rmi.*,java.util.*" session="true"&lt;br /&gt;buffer="12kb" autoFlush="true" errorPage="error.jsp" %&gt;&lt;br /&gt;To summarize some of the important page attributes:-&lt;br /&gt;import :- Comma separated list of packages or classes, just like import statements in&lt;br /&gt;usual Java code.&lt;br /&gt;session :- Specifies whether this page can use HTTP session. If set "true" session (which&lt;br /&gt;refers to the javax.servlet.http.HttpSession) is available and can be used to access the&lt;br /&gt;current/new session for the page. If "false", the page does not participate in a session and&lt;br /&gt;the implicit session object is unavailable.&lt;br /&gt;buffer :- If a buffer size is specified (such as "50kb") then output is buffered with a buffer&lt;br /&gt;size not less than that value.&lt;br /&gt;isThreadSafe :- Defines the level of thread safety implemented in the page. If set "true"&lt;br /&gt;the JSP engine may send multiple client requests to the page at the same time. If "false"&lt;br /&gt;then the JSP engine queues up client requests sent to the page for processing, and processes&lt;br /&gt;them one request at a time, in the order they were received. This is the same as&lt;br /&gt;implementing the javax.servlet.SingleThreadModel interface in a servlet.&lt;br /&gt;errorPage: - Defines a URL to another JSP page, which is invoked if an unchecked runtime&lt;br /&gt;exception is thrown. The page implementation catches the instance of the Throwable&lt;br /&gt;object and passes it to the error page processing.&lt;br /&gt;39&lt;br /&gt;(I) what are include directives?&lt;br /&gt;The include directive informs the JSP engine to include the content of the resource in the&lt;br /&gt;current JSP page. Below is the syntax for include statement.&lt;br /&gt;&lt;%@ include file="Filename" %&gt;&lt;br /&gt;Below is a code snippet which shows include directive in action&lt;br /&gt;&lt;html&gt;&lt;br /&gt;&lt;head&gt;&lt;br /&gt;&lt;title&gt;Directive in action&lt;/title&gt;&lt;br /&gt;&lt;/head&gt;&lt;br /&gt;&lt;%@ include file="/companyname.html" %&gt;&lt;br /&gt;&lt;body&gt;&lt;br /&gt;&lt;h1&gt;Directive in action&lt;/h1&gt;&lt;br /&gt;&lt;/body&gt;&lt;br /&gt;&lt;/html&gt;&lt;br /&gt;companyname.html contains the following:&lt;br /&gt;&lt;p&gt;Koirala and Koirala Limited&lt;/p&gt;&lt;br /&gt;(I) Can you explain taglib directives?&lt;br /&gt;Taglib are also termed as JSP tag extensions. They provide a way of encapsulating reusable&lt;br /&gt;functionality on JSP pages. One of the biggest drawbacks of scripting environments such&lt;br /&gt;as JSP is that it's easy to get carried away without thinking about how it will be maintained&lt;br /&gt;and grown in the future. For example, the ability to generate dynamic content by using&lt;br /&gt;Java code embedded in the page is a very powerful feature of the JSP specification.&lt;br /&gt;Custom tags allow such functionality to be encapsulated into reusable components. You&lt;br /&gt;can make write your reusable class in JAVA and call the same using XML tag.&lt;br /&gt;There are four files which play an important role:-&lt;br /&gt;√ Main class file which encapsulates the logic.&lt;br /&gt;√ Tag library descriptor file.&lt;br /&gt;40&lt;br /&gt;√ Web.xml file which has the tag library descriptor file location.&lt;br /&gt;√ Finally the JSP file which calls it.&lt;br /&gt;Below is the image which shows the four files in one go.&lt;br /&gt;Figure 4.16 : - taglib directive in action&lt;br /&gt;41&lt;br /&gt;The first file is the class file which will has the reusable code which will be called in the&lt;br /&gt;JSP file. The above class is also called as tag handler class. One of the important things to&lt;br /&gt;note is doStartTag() and doEndTag(). doStartTag is called when the JSP engine encounters&lt;br /&gt;an open tag and doEndTag is called when it encounters a closed tag.&lt;br /&gt;The second important file is the tag descriptor file. This file maps the class name with a&lt;br /&gt;name which will be used to call this class.&lt;br /&gt;The third file is the web.xml file. We need to define the tag library descriptor file location&lt;br /&gt;in web.xml file.&lt;br /&gt;Finally is the JSP file which calls the class. There are two things to be noted in the JSP file&lt;br /&gt;first is the taglib which refers to the URI. Second is the custom tag which calls the datetime&lt;br /&gt;class.&lt;br /&gt;Note: - You can find the above code sample in “JspTag” folder. Both the class as well as the&lt;br /&gt;JSP file is in the same folder. It displays date and time.&lt;br /&gt;(A) How does JSP engines instantiate tag handler classes instances?&lt;br /&gt;JSP engines will always instantiate a new tag handler instance every time a tag is encountered&lt;br /&gt;in a JSP page. A pool of tag instances are maintained and reusing them where possible.&lt;br /&gt;When a tag is encountered, the JSP engine will try to find a Tag instance that is not being&lt;br /&gt;used and use the same and then release it.&lt;br /&gt;(I) what’s the difference between JavaBeans and taglib directives?&lt;br /&gt;JavaBeans and taglib fundamentals were introduced for reusability. But following are the&lt;br /&gt;major differences between them:-&lt;br /&gt;√ Taglib are for generating presentation elements while JavaBeans are good for storing&lt;br /&gt;information and state.&lt;br /&gt;√ Use custom tags to implement actions and JavaBeans to present information.&lt;br /&gt;(I) what are the different scopes an object can have in a JSP page?&lt;br /&gt;There are four scope which an object can have in a JSP page:-&lt;br /&gt;42&lt;br /&gt;Page Scope&lt;br /&gt;Objects with page scope are accessible only within the page. Data only is valid for the&lt;br /&gt;current response. Once the response is sent back to the browser then data is no more&lt;br /&gt;valid. Even if request is passed from one page to other the data is lost.&lt;br /&gt;Request Scope&lt;br /&gt;Objects with request scope are accessible from pages processing the same request in&lt;br /&gt;which they were created. Once the container has processed the request data is invalid.&lt;br /&gt;Even if the request is forwarded to another page, the data is still available though not if&lt;br /&gt;a redirect is required.&lt;br /&gt;Session Scope&lt;br /&gt;Objects with session scope are accessible in same session. Session is the time users spend&lt;br /&gt;using the application, which ends when they close their browser or when they go to&lt;br /&gt;another Web site. So, for example, when users log in, their username could be stored in&lt;br /&gt;the session and displayed on every page they access. This data lasts until they leave the&lt;br /&gt;Web site or log out.&lt;br /&gt;Application Scope&lt;br /&gt;Application scope objects are basically global object and accessible to all JSP pages which&lt;br /&gt;lie in the same application. This creates a global object that's available to all pages.&lt;br /&gt;Application scope variables are typically created and populated when an application starts&lt;br /&gt;and then used as read-only for the rest of the application.&lt;br /&gt;(I) what are different implicit objects of JSP?&lt;br /&gt;pageContext :- The PageContext object.&lt;br /&gt;pageScope :- A Map of all the objects that have page scope.&lt;br /&gt;requestScope :- A Map of all the objects that have request scope.&lt;br /&gt;sessionScope :- A Map of all the objects that have session scope.&lt;br /&gt;applicationScope :- A Map of all the objects that have application scope.&lt;br /&gt;43&lt;br /&gt;param :- A Map of all the form parameters that were passed to your JSP page (for example,&lt;br /&gt;the HTML &lt;input name="ourName" type="text"/&gt; is passed to your JSP page as a&lt;br /&gt;form parameter).&lt;br /&gt;paramValues :- HTML allows for multiple values for a single form parameter. This is a&lt;br /&gt;Map of all the parameters, just like param, but in this object the values are an array&lt;br /&gt;containing all of the values for a given parameter in the event that there's more than one.&lt;br /&gt;header :- A Map of all the request headers.&lt;br /&gt;headerValues :- For the same reasons as paramValues, a headerValues object is provided.&lt;br /&gt;cookie :- A Map of all the cookies passed to your JSP. The value returned is a Cookie&lt;br /&gt;object.&lt;br /&gt;initParam :- A Map that maps context initialization parameter names to their parameter&lt;br /&gt;values.&lt;br /&gt;(I) what are different Authentication Options available in servlets?&lt;br /&gt;There are four ways of authentication:-&lt;br /&gt;√ HTTP basic authentication&lt;br /&gt;√ HTTP digest authentication&lt;br /&gt;√ HTTPS client authentication&lt;br /&gt;√ Form-based authentication&lt;br /&gt;Let’s try to understand how the above four ways work.&lt;br /&gt;HTTP basic authentication&lt;br /&gt;In HTTP basic authentication the server uses the username and password send by the&lt;br /&gt;client. The password is sent using simple base64 encoding but it’s not encrypted.&lt;br /&gt;HTTP digest authentication&lt;br /&gt;HTTP digest authentication is same as HTTP basic authentication but the biggest&lt;br /&gt;difference is password is encrypted and transmitted using SHA or MD5.&lt;br /&gt;44&lt;br /&gt;HTTPS client authentication&lt;br /&gt;HTTPS client authentication is based on HTTP over SSL. It requires that the end client&lt;br /&gt;should possess a PKC (Public Key Certificate). This verifies the browsers identity.&lt;br /&gt;Form-based authentication&lt;br /&gt;In FORM-based the web container invokes a login page. The invoked login page is used&lt;br /&gt;to collect username and password.&lt;br /&gt;We will be seeing how to implement the above four using tomcat.&lt;br /&gt;(A) Can you explain how do we practically implement security on a&lt;br /&gt;resource?&lt;br /&gt;(A) How do we practically implement form based authentication?&lt;br /&gt;Note: - We will answer this question from the perspective of tomcat server.&lt;br /&gt;Below are the five important steps to implement security on a resource.&lt;br /&gt;√ Define the URL pattern on which security will be applied.&lt;br /&gt;√ Define the roles which are allowed to access the resource.&lt;br /&gt;√ Define all the roles in the web application.&lt;br /&gt;√ Define the authentication method.&lt;br /&gt;√ Relate the users with roles.&lt;br /&gt;We will try to understand the above steps in more detail using the figure below. In the&lt;br /&gt;below figure you can see the sequence of steps.&lt;br /&gt;45&lt;br /&gt;Figure 4.17 : - Authentication steps in Web.xml&lt;br /&gt;46&lt;br /&gt;Define the URL pattern on which security will be applied&lt;br /&gt;In this step we define the resource which we want to protect. This is defined in the&lt;br /&gt;web.xml file as shown in the figure above. In the &lt;url-pattern&gt; we have defined secure as&lt;br /&gt;the web application.&lt;br /&gt;Define the roles which are allowed to access the resource&lt;br /&gt;In step 2 we define which roles are allowed to access the resource. You can see in the&lt;br /&gt;above figure it’s done by using &lt;auth-constraint&gt; tag in web.xml.&lt;br /&gt;Define all the roles in the web application&lt;br /&gt;In step 3 we define roles for the web application. We also need to mention the security&lt;br /&gt;role in &lt;security-role&gt;. Just a note the &lt;auth-constraint&gt; element specifies that application&lt;br /&gt;users must also be in the role of "Admin", and the &lt;security-role&gt; element defines that&lt;br /&gt;role.&lt;br /&gt;Define the authentication method&lt;br /&gt;This is the most important part defining which type of authentication we want to use. It’s&lt;br /&gt;defined by using the &lt;auth-method&gt; tag. In this scenario we are using FORM&lt;br /&gt;authentication. You can also see sub tags &lt;form-login-config&gt; which define the main&lt;br /&gt;login page and the error page.&lt;br /&gt;Relate the users with roles&lt;br /&gt;Finally we need to define the actual users which can be attached to the roles. In the above&lt;br /&gt;figure you can see we have “interviewer” as user which is attached to admin role. Users&lt;br /&gt;can be defined in tomcat-users.xml file.&lt;br /&gt;Note: - We have a sample application in formlogin folder which demonstrates how to&lt;br /&gt;execute the above steps practically. Copy the folder and paste it in webapps folder and&lt;br /&gt;execute the same to see how it works.&lt;br /&gt;(I) How do we authenticate using JDBC?&lt;br /&gt;(I) Can you explain JDBCRealm?&lt;br /&gt;A realm is a "database" of usernames, passwords, and user roles. When we say JDBCrealm&lt;br /&gt;we mean all these attributes are stored in table. In order to connect to JDBC you need to&lt;br /&gt;47&lt;br /&gt;make a context.xml and save the same in “META-INF “folder of the web application.&lt;br /&gt;Below is the context.xml snippet.&lt;br /&gt;&lt;Context path="/security" docBase="security" debug="0"&gt;&lt;br /&gt;&lt;Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"&lt;br /&gt;driverName="com.mysql.jdbc.Driver"&lt;br /&gt;connectionURL="jdbc:mysql://localhost:3306/security?autoReconnect=true"&lt;br /&gt;connectionName="MyConn"&lt;br /&gt;connectionPassword="Password1"&lt;br /&gt;userTable="tblusers"&lt;br /&gt;userNameCol="username"&lt;br /&gt;userCredCol="password"&lt;br /&gt;userRoleTable="user_roles"&lt;br /&gt;roleNameCol="role_name" /&gt;&lt;br /&gt;&lt;/Context&gt;&lt;br /&gt;(A) Can you explain how do you configure JNDIRealm?&lt;br /&gt;Left to the users ? . That’s because it’s rarely asked but yes it’s asked.&lt;br /&gt;(I) How did you implement caching in JSP?&lt;br /&gt;OSCache is an open-source caching library that's available free of charge from the&lt;br /&gt;OpenSymphony organization (for more details visit http://www.opensymphony.com/&lt;br /&gt;oscache). OSCache has a set of JSP tags that make it easy to implement page caching in&lt;br /&gt;your JSP application.&lt;br /&gt;Following are some Cache techniques it fulfills:-&lt;br /&gt;Cache entry&lt;br /&gt;An object that's stored into a page cache is known as a cache entry. In a JSP application,&lt;br /&gt;a cache entry is typically the output of a JSP page, a portion of a JSP page, or a servlet.&lt;br /&gt;48&lt;br /&gt;Cache key&lt;br /&gt;A page cache is like a hash table. When you save a cache entry in a page cache, you must&lt;br /&gt;provide a cache key to identify the cache data. You can use keys like URI, other parameters&lt;br /&gt;like username, ipaddress to indentify cache data.&lt;br /&gt;Cache duration&lt;br /&gt;This is the period of time that a cache entry will remain in a page cache before it expires.&lt;br /&gt;When a cache entry expires, it's removed from the cache and will be regenerated again.&lt;br /&gt;Cache scope&lt;br /&gt;This defines at what scope the data is stored application or session scope.&lt;br /&gt;&lt;os:cache time="60"&gt;&lt;br /&gt;&lt;%= new java.util.Date().toString() %&gt;&lt;/p&gt;&lt;br /&gt;&lt;/os:cache&gt;&lt;br /&gt;The above tag says that refresh after every 60 seconds the user requests data. So if user1&lt;br /&gt;is requesting the page it will display fresh date and if an other user requests with in 60&lt;br /&gt;seconds it will show same data. If any other user requests the page after 60 second he will&lt;br /&gt;again see refreshed date.&lt;br /&gt;(B) What is the difference between Servletcontext and ServletConfig ?&lt;br /&gt;ServletConfig contains configuration data for the servlet in the form of name and value&lt;br /&gt;pairs.Using the ServletConfigwe get reference to the ServletContext object. ServletContext&lt;br /&gt;gives the servlet access to information about its runtime environment such as web server&lt;br /&gt;logging facilities, version info, URL details, web server attributes etc.&lt;br /&gt;(I) How do we prevent browser from caching output of my JSP pages?&lt;br /&gt;You can prevent pages from caching JSP pages output using the below code snippet.&lt;br /&gt;&lt;%response.setHeader("Cache-Control","no-cache"); //HTTP 1.1&lt;br /&gt;response.setHeader("Pragma","no-cache"); //HTTP 1.0&lt;br /&gt;response.setDateHeader ("Expires", 0); //prevents caching at the proxy server&lt;br /&gt;%&gt;&lt;br /&gt;49&lt;br /&gt;(I) Can we explicitly destroy a servlet object?&lt;br /&gt;No we can not destroy a servlet explicitly its all done by the container. Even if you try&lt;br /&gt;calling the destroy method container does not respond to it.&lt;br /&gt;Distribution Partner&lt;br /&gt;Do you have a news group or website where you want to&lt;br /&gt;distribute this PDF free. Contact at shiv_koirala@yahoo.com&lt;br /&gt;we will put your logo and send you a complete zipped file&lt;br /&gt;which you can host at your site to increase user visits. Be our&lt;br /&gt;partner and increase your user visits in your website. We do&lt;br /&gt;not take any charge from our partner to distrubute these&lt;br /&gt;sample copies. But yes the contents of this PDF can not be&lt;br /&gt;modified. If you are our partner you get regular updates of&lt;br /&gt;our interview question releases.&lt;br /&gt;Illegal distributions of this PDF will be taken seriously. Just&lt;br /&gt;send a mail and be our distribution partner with your website&lt;br /&gt;logo proudly do not distribute illegally.&lt;br /&gt;www.questpond.com&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/664651663704607214-6589386357114635047?l=vindeshmohariya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/YD2kZ6HDC-h8PidwBxT9xr9XYEM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YD2kZ6HDC-h8PidwBxT9xr9XYEM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/YD2kZ6HDC-h8PidwBxT9xr9XYEM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YD2kZ6HDC-h8PidwBxT9xr9XYEM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnTechnicalSkills/~4/UxPquZKDK30" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://vindeshmohariya.blogspot.com/feeds/6589386357114635047/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=664651663704607214&amp;postID=6589386357114635047" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/6589386357114635047?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/6589386357114635047?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnTechnicalSkills/~3/UxPquZKDK30/servlet.html" title="Servlet&amp;Jsp" /><author><name>vini@riya</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://vindeshmohariya.blogspot.com/2007/09/servlet.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU4DRHc6eSp7ImA9WBFbFkU.&quot;"><id>tag:blogger.com,1999:blog-664651663704607214.post-7873927471717723566</id><published>2007-05-08T22:17:00.000-07:00</published><updated>2007-05-08T22:19:35.911-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-05-08T22:19:35.911-07:00</app:edited><title>Core Java-Part - I</title><content type="html">1.what  is a transient variable?&lt;br /&gt;A transient variable is a variable that may not be serialized.&lt;br /&gt;&lt;br /&gt;2.which containers use a border Layout as their default layout?&lt;br /&gt;The window, Frame and Dialog classes use a border layout as their default layout.&lt;br /&gt;&lt;br /&gt;3.Why do threads block on I/O?&lt;br /&gt;Threads block on i/o (that is enters the waiting state) so that other threads may execute while the i/o Operation is performed.&lt;br /&gt;&lt;br /&gt;4. How are Observer and Observable used?&lt;br /&gt;Objects that subclass the Observable class maintain a list of observers. When an Observable object is updated it invokes the update() method of each of its observers to notify the observers that it has changed state. The Observer interface is implemented by objects that observe Observable objects.&lt;br /&gt;&lt;br /&gt;5. What is synchronization and why is it important?&lt;br /&gt;With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object's value. This often leads to significant errors.&lt;br /&gt;&lt;br /&gt;6. Can a lock be acquired on a class?&lt;br /&gt;Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object..&lt;br /&gt;&lt;br /&gt;7. What's new with the stop(), suspend() and resume() methods in JDK 1.2?&lt;br /&gt;The stop(), suspend() and resume() methods have been deprecated in JDK 1.2.&lt;br /&gt;&lt;br /&gt;8. Is null a keyword?&lt;br /&gt;The null value is not a keyword.&lt;br /&gt;&lt;br /&gt;9. What is the preferred size of a component?&lt;br /&gt;The preferred size of a component is the minimum component size that will allow the component to display normally.&lt;br /&gt;&lt;br /&gt;10. What method is used to specify a container's layout?&lt;br /&gt;The setLayout() method is used to specify a container's layout.&lt;br /&gt;&lt;br /&gt;11. Which containers use a FlowLayout as their default layout?&lt;br /&gt;The Panel and Applet classes use the FlowLayout as their default layout.&lt;br /&gt;&lt;br /&gt;12. What state does a thread enter when it terminates its processing?&lt;br /&gt;When a thread terminates its processing, it enters the dead state.&lt;br /&gt;&lt;br /&gt;13. What is the Collections API?&lt;br /&gt;The Collections API is a set of classes and interfaces that support operations on collections of objects.&lt;br /&gt;&lt;br /&gt;14. Which characters may be used as the second character of an identifier,&lt;br /&gt;but not as the first character of an identifier?&lt;br /&gt;The digits 0 through 9 may not be used as the first character of an identifier but they may be used after the first character of an identifier.&lt;br /&gt;&lt;br /&gt;15. What is the List interface?&lt;br /&gt;The List interface provides support for ordered collections of objects.&lt;br /&gt;&lt;br /&gt;16. How does Java handle integer overflows and underflows?&lt;br /&gt;It uses those low order bytes of the result that can fit into the size of the type allowed by the operation.&lt;br /&gt;&lt;br /&gt;17. What is the Vector class?&lt;br /&gt;The Vector class provides the capability to implement a growable array of objects&lt;br /&gt;&lt;br /&gt;18. What modifiers may be used with an inner class that is a member of an outer class?&lt;br /&gt;A (non-local) inner class may be declared as public, protected, private, static, final, or abstract.&lt;br /&gt;&lt;br /&gt;19. What is an Iterator interface?&lt;br /&gt;The Iterator interface is used to step through the elements of a Collection.&lt;br /&gt;&lt;br /&gt;20. What is the difference between the &gt;&gt; and &gt;&gt;&gt; operators?&lt;br /&gt;The &gt;&gt; operator carries the sign bit when shifting right. The &gt;&gt;&gt; zero-fills bits that have been shifted out.&lt;br /&gt;&lt;br /&gt;21. Which method of the Component class is used to set the position and&lt;br /&gt;size of a component?&lt;br /&gt;setBounds()&lt;br /&gt;&lt;br /&gt;22. How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters?&lt;br /&gt;Unicode requires 16 bits and ASCII require 7 bits. Although the ASCII character set uses only 7 bits, it is usually represented as 8 bits. UTF-8 represents characters using 8, 16, and 18 bit patterns. UTF-16 uses 16-bit and larger bit patterns.&lt;br /&gt;&lt;br /&gt;23What is the difference between yielding and sleeping?&lt;br /&gt;When a task invokes its yield() method, it returns to the ready state. When a task invokes its sleep() method, it returns to the waiting state.&lt;br /&gt;&lt;br /&gt;24. Which java.util classes and interfaces support event handling?&lt;br /&gt;The EventObject class and the EventListener interface support event processing.&lt;br /&gt;&lt;br /&gt;25. Is sizeof a keyword?&lt;br /&gt;The sizeof operator is not a keyword.&lt;br /&gt;&lt;br /&gt;26. What are wrapped classes?&lt;br /&gt;Wrapped classes are classes that allow primitive types to be accessed as objects.&lt;br /&gt;&lt;br /&gt;27. Does garbage collection guarantee that a program will not run out of memory?&lt;br /&gt;Garbage collection does not guarantee that a program will not run out of memory. It is possible for programs to use up memory resources faster than they are garbage collected. It is also possible for programs to create objects that are not subject to garbage collection&lt;br /&gt;&lt;br /&gt;28. What restrictions are placed on the location of a package statement&lt;br /&gt;within a source code file?&lt;br /&gt;A package statement must appear as the first line in a source code file (excluding blank lines and comments).&lt;br /&gt;&lt;br /&gt;29. Can an object's finalize() method be invoked while it is reachable?&lt;br /&gt;An object's finalize() method cannot be invoked by the garbage collector while the object is still reachable. However, an object's finalize() method may be invoked by other objects.&lt;br /&gt;&lt;br /&gt;30. What is the immediate superclass of the Applet class?&lt;br /&gt;Panel&lt;br /&gt;&lt;br /&gt;31. What is the difference between preemptive scheduling and time slicing?&lt;br /&gt;Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks. The scheduler then determines which task should execute next, based on priority and&lt;br /&gt;other factors.&lt;br /&gt;&lt;br /&gt;32. Name three Component subclasses that support painting.&lt;br /&gt;The Canvas, Frame, Panel, and Applet classes support painting.&lt;br /&gt;&lt;br /&gt;33. What value does readLine() return when it has reached the end of a file?&lt;br /&gt;The readLine() method returns null when it has reached the end of a file.&lt;br /&gt;&lt;br /&gt;34. What is the immediate superclass of the Dialog class?&lt;br /&gt;Window&lt;br /&gt;&lt;br /&gt;35. What is clipping?&lt;br /&gt;Clipping is the process of confining paint operations to a limited area or shape.&lt;br /&gt;&lt;br /&gt;36. What is a native method?&lt;br /&gt;A native method is a method that is implemented in a language other than Java.&lt;br /&gt;&lt;br /&gt;37. Can a for statement loop indefinitely?&lt;br /&gt;Yes, a for statement can loop indefinitely. For example, consider the following:&lt;br /&gt;for(;Wink ;&lt;br /&gt;&lt;br /&gt;38. What are order of precedence and associativity, and how are they used?&lt;br /&gt;Order of precedence determines the order in which operators are evaluated in expressions. Associatity determines whether an expression is evaluated left-to-right or right-to-left&lt;br /&gt;&lt;br /&gt;39. When a thread blocks on I/O, what state does it enter?&lt;br /&gt;A thread enters the waiting state when it blocks on I/O.&lt;br /&gt;&lt;br /&gt;40. To what value is a variable of the String type automatically initialized?&lt;br /&gt;The default value of an String type is null.&lt;br /&gt;&lt;br /&gt;41. What is the catch or declare rule for method declarations?&lt;br /&gt;If a checked exception may be thrown within the body of a method, the method must either catch the exception or declare it in its throws clause.&lt;br /&gt;&lt;br /&gt;42. What is the difference between a MenuItem and a CheckboxMenuItem?&lt;br /&gt;The CheckboxMenuItem class extends the MenuItem class to support a menu item that may be checked or unchecked.&lt;br /&gt;&lt;br /&gt;43. What is a task's priority and how is it used in scheduling?&lt;br /&gt;A task's priority is an integer value that identifies the relative order in which it should be executed with respect to other tasks. The scheduler attempts to schedule higher priority tasks before lower priority tasks.&lt;br /&gt;&lt;br /&gt;44. What class is the top of the AWT event hierarchy?&lt;br /&gt;The java.awt.AWTEvent class is the highest-level class in the AWT event-class hierarchy.&lt;br /&gt;&lt;br /&gt;45. When a thread is created and started, what is its initial state?&lt;br /&gt;A thread is in the ready state after it has been created and started.&lt;br /&gt;&lt;br /&gt;46. Can an anonymous class be declared as implementing an interface and extending a class?&lt;br /&gt;An anonymous class may implement an interface or extend a superclass, but may not be declared to do both.&lt;br /&gt;&lt;br /&gt;47. What is the range of the short type?&lt;br /&gt;The range of the short type is -(2^15) to 2^15 - 1.&lt;br /&gt;&lt;br /&gt;48. What is the range of the char type?&lt;br /&gt;The range of the char type is 0 to 2^16 - 1.&lt;br /&gt;&lt;br /&gt;49. In which package are most of the AWT events that support the event-delegation&lt;br /&gt;model defined?&lt;br /&gt;Most of the AWT-related events of the event-delegation model are defined in the java.awt.event package. The AWTEvent class is defined in the java.awt package.&lt;br /&gt;&lt;br /&gt;50. What is the immediate superclass of Menu?&lt;br /&gt;MenuItem&lt;br /&gt;&lt;br /&gt;CLICK HERE FOR PART 2 Questions&lt;br /&gt;http://www.careerenclave.com/info/index.php?topic=443.0&lt;br /&gt;&lt;br /&gt;CORE JAVA Interview Questions - Part 2&lt;br /&gt;&lt;br /&gt;51. What is the purpose of finalization?&lt;br /&gt;The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected.&lt;br /&gt;&lt;br /&gt;52. Which class is the immediate superclass of the MenuComponent class.&lt;br /&gt;Object&lt;br /&gt;&lt;br /&gt;53. What invokes a thread's run() method?&lt;br /&gt;After a thread is started, via its start() method or that of the Thread class, the JVM invokes the thread's run() method when the thread is initially executed.&lt;br /&gt;&lt;br /&gt;54. What is the difference between the Boolean &amp; operator and the &amp;&amp; operator?&lt;br /&gt;If an expression involving the Boolean &amp; operator is evaluated, both operands are evaluated. Then the &amp; operator is applied to the operand. When an expression involving the &amp;&amp; operator is evaluated, the first operand is evaluated. If the first operand returns a value of true then the second operand is evaluated. The &amp;&amp; operator is then applied to the first and second operands. If the first operand evaluates to false, the evaluation of the second operand is skipped.&lt;br /&gt;&lt;br /&gt;55. Name three subclasses of the Component class.&lt;br /&gt;Box.Filler, Button, Canvas, Checkbox, Choice, Container, Label, List, Scrollbar, or TextComponent&lt;br /&gt;&lt;br /&gt;56. What is the GregorianCalendar class?&lt;br /&gt;The GregorianCalendar provides support for traditional Western calendars.&lt;br /&gt;&lt;br /&gt;57. Which Container method is used to cause a container to be laid out and redisplayed?&lt;br /&gt;validate()&lt;br /&gt;&lt;br /&gt;58. What is the purpose of the Runtime class?&lt;br /&gt;The purpose of the Runtime class is to provide access to the Java runtime system.&lt;br /&gt;&lt;br /&gt;59. How many times may an object's finalize() method be invoked by the&lt;br /&gt;garbage collector?&lt;br /&gt;An object's finalize() method may only be invoked once by the garbage collector.&lt;br /&gt;&lt;br /&gt;60. What is the purpose of the finally clause of a try-catch-finally statement?&lt;br /&gt;The finally clause is used to provide the capability to execute code no matter whether or not an exception is thrown or caught.&lt;br /&gt;&lt;br /&gt;61. What is the argument type of a program's main() method?&lt;br /&gt;A program's main() method takes an argument of the String[] type.&lt;br /&gt;&lt;br /&gt;62. Which Java operator is right associative?&lt;br /&gt;The = operator is right associative.&lt;br /&gt;&lt;br /&gt;63. What is the Locale class?&lt;br /&gt;The Locale class is used to tailor program output to the conventions of a particular geographic, political, or cultural region.&lt;br /&gt;&lt;br /&gt;64. Can a double value be cast to a byte?&lt;br /&gt;Yes, a double value can be cast to a byte.&lt;br /&gt;&lt;br /&gt;65. What is the difference between a break statement and a continue statement?&lt;br /&gt;A break statement results in the termination of the statement to which it applies (switch, for, do, or while). A continue statement is used to end the current loop iteration and return control to the loop statement.&lt;br /&gt;&lt;br /&gt;66. What must a class do to implement an interface?&lt;br /&gt;It must provide all of the methods in the interface and identify the interface in its implements clause.&lt;br /&gt;&lt;br /&gt;67. What method is invoked to cause an object to begin executing as a separate thread?&lt;br /&gt;The start() method of the Thread class is invoked to cause an object to begin executing as a separate thread.&lt;br /&gt;&lt;br /&gt;68. Name two subclasses of the TextComponent class.&lt;br /&gt;TextField and TextArea&lt;br /&gt;&lt;br /&gt;69. What is the advantage of the event-delegation model over the earlier event-inheritance model?&lt;br /&gt;The event-delegation model has two advantages over the event-inheritance model. First, it enables event handling to be handled by objects other than the ones that generate the events (or their containers). This allows a clean separation between a component's design and its use. The other advantage of the event-delegation model is that it performs much better in applications where many events are generated. This performance improvement is due to the fact that the event-delegation model does not have to repeatedly process unhandled events, as is the case of the event-inheritance model.&lt;br /&gt;&lt;br /&gt;70. Which containers may have a MenuBar?&lt;br /&gt;Frame&lt;br /&gt;&lt;br /&gt;71. How are commas used in the intialization and iteration  parts of a for statement?&lt;br /&gt;Commas are used to separate multiple statements within the initialization and iteration parts of a for statement.&lt;br /&gt;&lt;br /&gt;72. What is the purpose of the wait(), notify(), and notifyAll() methods?&lt;br /&gt;The wait(),notify(), and notifyAll() methods are used to provide an efficient way for threads to wait for a shared resource. When a thread executes an object's wait() method, it enters the waiting state. It only enters the ready state after another thread invokes the object's notify() or notifyAll() methods..&lt;br /&gt;&lt;br /&gt;73. What is an abstract method?&lt;br /&gt;An abstract method is a method whose implementation is deferred to a subclass.&lt;br /&gt;&lt;br /&gt;74. How are Java source code files named?&lt;br /&gt;A Java source code file takes the name of a public class or interface that is defined within the file. A source code file may contain at most one public class or interface. If a public class or interface is defined within a source code file, then the source code file must take the name of the public class or interface. If no public class or interface is defined within a source code file, then the file must take on a name that is different than its classes and interfaces. Source code files use the .java extension.&lt;br /&gt;&lt;br /&gt;75. What is the relationship between the Canvas class and the Graphics class?&lt;br /&gt;A Canvas object provides access to a Graphics object via its paint() method.&lt;br /&gt;&lt;br /&gt;76. What are the high-level thread states?&lt;br /&gt;The high-level thread states are ready, running, waiting, and dead.&lt;br /&gt;&lt;br /&gt;77. What value does read() return when it has reached the end of a file?&lt;br /&gt;The read() method returns -1 when it has reached the end of a file.&lt;br /&gt;&lt;br /&gt;78. Can a Byte object be cast to a double value?&lt;br /&gt;No, an object cannot be cast to a primitive value.&lt;br /&gt;&lt;br /&gt;79. What is the difference between a static and a non-static inner class?&lt;br /&gt;A non-static inner class may have object instances that are associated with instances of the class's outer class. A static inner class does not have any object instances&lt;br /&gt;&lt;br /&gt;80. What is the difference between the String and StringBuffer classes?&lt;br /&gt;String objects are constants. StringBuffer objects are not.&lt;br /&gt;&lt;br /&gt;81. If a variable is declared as private, where may the variable be accessed?&lt;br /&gt;A private variable may only be accessed within the class in which it is declared.&lt;br /&gt;&lt;br /&gt;82. What is an object's lock and which object's have locks?&lt;br /&gt;An object's lock is a mechanism that is used by multiple threads to obtain synchronized access to the object. A thread may execute a synchronized method of an object only after it has acquired the object's lock. All objects and classes have locks. A class's lock is acquired on the class's Class object.&lt;br /&gt;&lt;br /&gt;83. What is the Dictionary class?&lt;br /&gt;The Dictionary class provides the capability to store key-value pairs.&lt;br /&gt;&lt;br /&gt;84. How are the elements of a BorderLayout organized?&lt;br /&gt;The elements of a BorderLayout are organized at the borders (North, South, East, and West) and the center of a container.&lt;br /&gt;&lt;br /&gt;85. What is the % operator?&lt;br /&gt;It is referred to as the modulo or remainder operator. It returns the remainder of dividing the first operand by the second operand.&lt;br /&gt;&lt;br /&gt;86. When can an object reference be cast to an interface reference?&lt;br /&gt;An object reference be cast to an interface reference when the object implements the referenced interface.&lt;br /&gt;&lt;br /&gt;87. What is the difference between a Window and a Frame?&lt;br /&gt;The Frame class extends Window to define a main application window that can have a menu bar.&lt;br /&gt;&lt;br /&gt;88. Which class is extended by all other classes?&lt;br /&gt;The Object class is extended by all other classes.&lt;br /&gt;&lt;br /&gt;89. Can an object be garbage collected while it is still reachable?&lt;br /&gt;A reachable object cannot be garbage collected. Only unreachable objects may be garbage collected..&lt;br /&gt;&lt;br /&gt;90. Is the ternary operator written x : y ? z or x ? y : z ?&lt;br /&gt;It is written x ? y : z.&lt;br /&gt;&lt;br /&gt;91. What is the difference between the Font and FontMetrics classes?&lt;br /&gt;The FontMetrics class is used to define implementation-specific properties, such as ascent and descent, of a Font object.&lt;br /&gt;&lt;br /&gt;92. How is rounding performed under integer division?&lt;br /&gt;The fractional part of the result is truncated. This is known as rounding toward zero.&lt;br /&gt;&lt;br /&gt;93. What happens when a thread cannot acquire a lock on an object?&lt;br /&gt;If a thread attempts to execute a synchronized method or synchronized statement and is unable to acquire an object's lock, it enters the waiting state until the lock becomes available.&lt;br /&gt;&lt;br /&gt;94. What is the difference between the Reader/Writer class hierarchy and the&lt;br /&gt;InputStream/OutputStream class hierarchy?&lt;br /&gt;The Reader/Writer class hierarchy is character-oriented, and the InputStream/OutputStream class hierarchy is byte-oriented.&lt;br /&gt;&lt;br /&gt;95. What classes of exceptions may be caught by a catch clause?&lt;br /&gt;A catch clause can catch any exception that may be assigned to the Throwable type. This includes the Error and Exception types.&lt;br /&gt;&lt;br /&gt;96. If a class is declared without any access modifiers, where may the class be accessed?&lt;br /&gt;A class that is declared without any access modifiers is said to have package access. This means that the class can only be accessed by other classes and interfaces that are defined within the same package.&lt;br /&gt;&lt;br /&gt;97. What is the SimpleTimeZone class?&lt;br /&gt;The SimpleTimeZone class provides support for a Gregorian calendar.&lt;br /&gt;&lt;br /&gt;98. What is the Map interface?&lt;br /&gt;The Map interface replaces the JDK 1.1 Dictionary class and is used associate keys with values.&lt;br /&gt;&lt;br /&gt;99. Does a class inherit the constructors of its superclass?&lt;br /&gt;A class does not inherit constructors from any of its superclasses.&lt;br /&gt;&lt;br /&gt;100. For which statements does it make sense to use a label?&lt;br /&gt;The only statements for which it makes sense to use a label are those statements that can enclose a break or continue statement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/664651663704607214-7873927471717723566?l=vindeshmohariya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/hUNWzgSu7T2CCNzS_TRR-pGlOrA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hUNWzgSu7T2CCNzS_TRR-pGlOrA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/hUNWzgSu7T2CCNzS_TRR-pGlOrA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hUNWzgSu7T2CCNzS_TRR-pGlOrA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnTechnicalSkills/~4/EWvtdehPbdI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://vindeshmohariya.blogspot.com/feeds/7873927471717723566/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=664651663704607214&amp;postID=7873927471717723566" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/7873927471717723566?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/7873927471717723566?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnTechnicalSkills/~3/EWvtdehPbdI/core-java-part-i.html" title="Core Java-Part - I" /><author><name>vini@riya</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://vindeshmohariya.blogspot.com/2007/05/core-java-part-i.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkIMQHY5eyp7ImA9WB5aF0s.&quot;"><id>tag:blogger.com,1999:blog-664651663704607214.post-1253644019974666235</id><published>2007-04-09T00:42:00.000-07:00</published><updated>2007-09-14T03:09:41.823-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-09-14T03:09:41.823-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java Interview Questions" /><title>Core Java Interview Questions</title><content type="html">&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;&lt;span style="color: rgb(255, 0, 0);font-size:180%;" &gt;Core Java Interview Questions&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Question:&lt;/b&gt; What is transient variable?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; Transient variable can't be serialize. For example if a     variable is declared as transient in a Serializable class and the class is     written to an ObjectStream, the value of the variable can't be written to     the stream instead when the class is retrieved from the ObjectStream the     value of the variable becomes &lt;b&gt;null&lt;/b&gt;.&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; Name the containers which uses     Border Layout as their default layout?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; Containers which uses Border Layout as their default are:     window, Frame and Dialog classes.&lt;br /&gt;        &lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What do you understand by     Synchronization?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; Synchronization is a process of controlling the access of     shared resources by the multiple threads in such a manner that only one     thread can access one resource at a time. In non synchronized multithreaded     application, it is possible for one thread to modify a shared object while     another thread is in the process of using or updating the object's value.     Synchronization prevents such type of data corruption.&lt;br /&gt;    &lt;b&gt;E.g. Synchronizing a function:&lt;/b&gt;&lt;br /&gt;    public synchronized void Method1 () {&lt;br /&gt;         // Appropriate method-related code.&lt;br /&gt;    }&lt;br /&gt;    &lt;b&gt;E.g. Synchronizing a block of code inside a function:&lt;br /&gt;    &lt;/b&gt;public myFunction (){&lt;br /&gt;        synchronized (this) {&lt;br /&gt;                //     Synchronized code here.&lt;br /&gt;             }&lt;br /&gt;    }&lt;br /&gt;      &lt;/span&gt; &lt;/p&gt;  &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What is Collection API?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; The Collection API is a set of classes and interfaces that     support operation on collections of objects. These classes and interfaces     are more flexible, more powerful, and more regular than the vectors, arrays,     and hashtables if effectively replaces.&lt;br /&gt;    &lt;b&gt;Example of classes&lt;/b&gt;: &lt;code&gt;HashSet&lt;/code&gt;, &lt;code&gt;HashMap&lt;/code&gt;, &lt;code&gt;ArrayList&lt;/code&gt;,     &lt;code&gt;LinkedList&lt;/code&gt;, &lt;code&gt;TreeSet&lt;/code&gt; and &lt;code&gt;TreeMap&lt;/code&gt;.&lt;br /&gt;    &lt;b&gt;Example of interfaces&lt;/b&gt;: &lt;code&gt;Collection&lt;/code&gt;, &lt;code&gt;Set&lt;/code&gt;, &lt;code&gt;List&lt;/code&gt;     and &lt;code&gt;Map.&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; Is Iterator a Class or Interface?     What is its use?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; Iterator is an interface which is used to step through the     elements of a Collection.&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What is similarities/difference     between an Abstract class and Interface?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  Differences are as follows:&lt;/span&gt;     &lt;/p&gt; &lt;ul type="disc"&gt;&lt;li&gt;&lt;span style="color:#000000;"&gt;Interfaces provide a form of multiple         inheritance. A class can extend only one other class.&lt;/span&gt;       &lt;/li&gt;&lt;li&gt;&lt;span style="color:#000000;"&gt;Interfaces are limited to public methods and         constants with no implementation. Abstract classes can have a partial         implementation, protected parts, static methods, etc.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000000;"&gt;A Class may implement several interfaces. But in         case of abstract class, a class may extend only one abstract class.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000000;"&gt;Interfaces are slow as it requires extra         indirection to to find corresponding method in in the actual class.         Abstract classes are fast. &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;       &lt;p&gt;&lt;span style="color:#000000;"&gt;Similarities:&lt;/span&gt;     &lt;/p&gt; &lt;ul type="disc"&gt;&lt;li&gt;&lt;span style="color:#000000;"&gt;Neither Abstract classes or Interface can be         instantiated.&lt;br /&gt;          &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; How to define an Abstract class?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; A class containing abstract method is called Abstract class.     An Abstract class can't be instantiated.&lt;br /&gt;    Example of Abstract class:&lt;br /&gt;    abstract class testAbstractClass {&lt;br /&gt;        protected String myString;&lt;br /&gt;        public String getMyString() {&lt;br /&gt;            return myString;&lt;br /&gt;            }&lt;br /&gt;        public abstract string anyAbstractFunction();&lt;br /&gt;    }&lt;br /&gt;         &lt;/span&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; How to define an Interface?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; In Java Interface defines the methods but does not implement     them. Interface can include constants. A class that implements the     interfaces is bound to implement all the methods defined in Interface.&lt;br /&gt;    Emaple of Interface:&lt;br /&gt;   &lt;br /&gt;    public interface sampleInterface {&lt;br /&gt;        public void functionOne();&lt;br /&gt;   &lt;br /&gt;        public long CONSTANT_ONE = 1000;&lt;br /&gt;    }&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; Explain the user defined     Exceptions?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; User defined Exceptions are the separate Exception classes     defined by the user for specific purposed. An user defined can created by     simply sub-classing it to the Exception class. This allows custom exceptions     to be generated (using throw) and caught in the same way as normal     exceptions.&lt;br /&gt;    Example:&lt;br /&gt;    class myCustomException extends Exception {&lt;br /&gt;         // The class simply has to exist to be an exception    &lt;br /&gt;    }&lt;br /&gt;      &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; Explain the new Features of JDBC     2.0 Core API?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; The JDBC 2.0 API includes the complete JDBC API, which     includes both core and Optional Package API, and provides inductrial-strength     database computing capabilities.&lt;br /&gt;    New Features in JDBC 2.0 Core API:&lt;br /&gt;    &lt;/span&gt;       &lt;/p&gt; &lt;ul type="disc"&gt;&lt;li&gt;&lt;span style="color:#000000;"&gt;Scrollable result sets- using new methods in the         ResultSet interface allows programmatically move the to particular row         or to a position relative to its current position&lt;/span&gt;       &lt;/li&gt;&lt;li&gt;&lt;span style="color:#000000;"&gt;JDBC 2.0 Core API provides the Batch Updates functionality         to the java applications.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000000;"&gt;Java applications can now use the         ResultSet.updateXXX methods.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000000;"&gt;New data types - interfaces mapping the SQL3         data types&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000000;"&gt;Custom  mapping of user-defined types (UTDs)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000000;"&gt;Miscellaneous features, including performance         hints, the use of character streams, full precision for         java.math.BigDecimal values, additional security, and support for time         zones in date, time, and timestamp values. &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;          &lt;p&gt;&lt;span style="color:#000000;"&gt;    &lt;/span&gt;    &lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt;  Explain garbage collection?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  Garbage collection is one of the most important feature of     Java. Garbage collection is also called automatic memory management as JVM automatically     removes the unused variables/objects (value is null) from the memory. User     program cann't directly free the object from memory, instead it is the job     of the garbage collector to automatically free the objects that are no     longer referenced by a program. Every class inherits &lt;b&gt;finalize()&lt;/b&gt;     method from &lt;b&gt;java.lang.Object&lt;/b&gt;, the finalize() method is called by     garbage collector when it determines no more references to the object     exists. In Java, it is good idea to explicitly assign &lt;b&gt;null&lt;/b&gt; into a     variable when no more in use. I Java on calling &lt;b&gt;System.gc()&lt;/b&gt; and &lt;b&gt;Runtime.gc(), &lt;/b&gt;     JVM tries to recycle the unused objects, but there is no guarantee when all     the objects will garbage collected.&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt;  How you can force the garbage     collection?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  Garbage collection automatic process and can't be forced.  &lt;br /&gt;     &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt;  What is OOPS?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  OOP is the common abbreviation for Object-Oriented Programming.  &lt;br /&gt; &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt;  Describe the principles of OOPS.&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  There are three main principals of oops which are called Polymorphism, Inheritance and Encapsulation.  &lt;br /&gt; &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt;  Explain the Encapsulation principle.&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; Encapsulation is a process of binding or wrapping the data and the codes that operates on the data into a single entity. This keeps the data safe from outside interface and misuse. One way to think about encapsulation is as a protective wrapper that prevents code and data from being arbitrarily accessed by other code defined outside the wrapper. &lt;br /&gt;   &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt;  Explain the Inheritance principle.&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  Inheritance is the process by which one object acquires the properties of another object.  &lt;br /&gt;   &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt;  Explain the Polymorphism principle.&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; The meaning of Polymorphism is something like one name many forms. Polymorphism enables one entity to be used as as general category for different types of actions. The specific action is determined by the exact nature of the situation. The concept of polymorphism can be explained as "one interface, multiple methods". &lt;br /&gt;   &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt;  Explain the different forms of Polymorphism.&lt;br /&gt; &lt;b&gt;Answer:&lt;/b&gt;    From a practical programming viewpoint, polymorphism exists in three distinct forms in Java:   &lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;span style="color:#000000;"&gt;    &lt;li&gt;Method overloading     &lt;/li&gt;&lt;li&gt;Method overriding through inheritance     &lt;/li&gt;&lt;li&gt;Method overriding through the Java interface&lt;/li&gt;   &lt;/span&gt;&lt;/ul&gt;  &lt;span style="color:#000000;"&gt; &lt;br /&gt;   &lt;/span&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt;  What are Access Specifiers available in Java?&lt;br /&gt; &lt;b&gt;Answer:&lt;/b&gt;    Access specifiers are keywords that determines the type of access to the member of a class. These are:   &lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;span style="color:#000000;"&gt;    &lt;li&gt;Public&lt;/li&gt;     &lt;li&gt;Protected&lt;/li&gt;     &lt;li&gt;Private&lt;/li&gt;     &lt;li&gt;Defaults&lt;/li&gt;   &lt;/span&gt;&lt;/ul&gt;  &lt;span style="color:#000000;"&gt; &lt;br /&gt;   &lt;/span&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt;  Describe the wrapper classes in Java.&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; Wrapper class is wrapper around a primitive data type. An instance of a wrapper class contains, or wraps, a primitive value of the corresponding type.&lt;br /&gt;  &lt;p align="left"&gt;Following table lists the primitive types and the corresponding   wrapper classes:&lt;/p&gt;     &lt;table bg border="1" cellpadding="3" cellspacing="0" width="43%" style="color:#ffffcc;"&gt;    &lt;tbody&gt;      &lt;tr align="center" valign="center"&gt;     &lt;td bg width="13%" style="color:#ffff99;"&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Primitive&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;     &lt;td align="center" bg width="23%" style="color:#ffff99;"&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Wrapper&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;      &lt;/tr&gt;      &lt;tr align="center" valign="center"&gt;     &lt;td width="13%"&gt;&lt;b&gt;&lt;span style="font-size:85%;color:#000000;"&gt;boolean&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;     &lt;td align="left" width="23%"&gt;&lt;b&gt;&lt;span style="font-size:85%;color:#000000;"&gt;  java.lang.Boolean&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;      &lt;/tr&gt;      &lt;tr align="center" valign="center"&gt;     &lt;td width="13%"&gt;&lt;b&gt;&lt;span style="font-size:85%;color:#000000;"&gt;byte&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;     &lt;td align="left" width="23%"&gt;&lt;b&gt;&lt;span style="font-size:85%;color:#000000;"&gt;  java.lang.Byte&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;      &lt;/tr&gt;      &lt;tr align="center" valign="center"&gt;     &lt;td width="13%"&gt;&lt;b&gt;&lt;span style="font-size:85%;color:#000000;"&gt;char&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;     &lt;td align="left" width="23%"&gt;&lt;b&gt;&lt;span style="font-size:85%;color:#000000;"&gt;  java.lang.Character&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;      &lt;/tr&gt;      &lt;tr align="center" valign="center"&gt;     &lt;td width="13%"&gt;&lt;b&gt;&lt;span style="font-size:85%;color:#000000;"&gt;double&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;     &lt;td align="left" width="23%"&gt;&lt;b&gt;&lt;span style="font-size:85%;color:#000000;"&gt;  java.lang.Double&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;      &lt;/tr&gt;      &lt;tr align="center" valign="center"&gt;     &lt;td width="13%"&gt;&lt;b&gt;&lt;span style="font-size:85%;color:#000000;"&gt;float&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;     &lt;td align="left" width="23%"&gt;&lt;b&gt;&lt;span style="font-size:85%;color:#000000;"&gt;  java.lang.Float&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;      &lt;/tr&gt;      &lt;tr align="center" valign="center"&gt;     &lt;td width="13%"&gt;&lt;b&gt;&lt;span style="font-size:85%;color:#000000;"&gt;int&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;     &lt;td align="left" width="23%"&gt;&lt;b&gt;&lt;span style="font-size:85%;color:#000000;"&gt;  java.lang.Integer&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;      &lt;/tr&gt;      &lt;tr align="center" valign="center"&gt;     &lt;td width="13%"&gt;&lt;b&gt;&lt;span style="font-size:85%;color:#000000;"&gt;long&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;     &lt;td align="left" width="23%"&gt;&lt;b&gt;&lt;span style="font-size:85%;color:#000000;"&gt;  java.lang.Long&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;      &lt;/tr&gt;      &lt;tr align="center" valign="center"&gt;     &lt;td width="13%"&gt;&lt;b&gt;&lt;span style="font-size:85%;color:#000000;"&gt;short&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;     &lt;td align="left" width="23%"&gt;&lt;b&gt;&lt;span style="font-size:85%;color:#000000;"&gt;  java.lang.Short&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;      &lt;/tr&gt;      &lt;tr align="center" valign="center"&gt;     &lt;td width="13%"&gt;&lt;b&gt;&lt;span style="font-size:85%;color:#000000;"&gt;void&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;     &lt;td align="left" width="23%"&gt;&lt;b&gt;&lt;span style="font-size:85%;color:#000000;"&gt;  java.lang.Void&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;      &lt;/tr&gt;    &lt;/tbody&gt;     &lt;/table&gt;    &lt;br /&gt;   &lt;/span&gt; &lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt;  Read the following program:&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;public class test {&lt;br /&gt; public static void main(String [] args) {&lt;br /&gt;    int x = 3;&lt;br /&gt;    int y = 1;&lt;br /&gt;   if (x = y)&lt;br /&gt;     System.out.println("Not equal");&lt;br /&gt;  else&lt;br /&gt;    System.out.println("Equal");&lt;br /&gt; }&lt;br /&gt; }&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="color:#000000;"&gt;What is the result?&lt;br /&gt;   A. The output is “Equal”&lt;br /&gt;   B. The output in “Not Equal”&lt;br /&gt;   C. An error at "  if (x = y)" causes compilation to fall.&lt;br /&gt;   D. The program executes but no output is show on console.&lt;br /&gt;  &lt;b&gt;Answer: C&lt;br /&gt;   &lt;br /&gt;    Question:&lt;/b&gt;&lt;b&gt; &lt;/b&gt;what is the class variables ?&lt;br /&gt;&lt;b&gt;Answer: &lt;/b&gt;When we create a number of objects of the same class, then each object will share a common copy of variables. That means that there is only one copy per class, no matter how many objects are created from it. Class variables or static variables are declared with the static keyword in a class, but mind it that it should be declared outside outside a class. These variables are stored in static memory. Class variables are mostly used for constants, variable that never change its initial value. Static variables are always called by the class name. This variable is created when the program starts i.e. it is created before the instance is created of class by using new operator and gets destroyed when the programs stops. The scope of the class variable is same a instance variable. The class variable can be defined anywhere at class level with the keyword static. It initial value is same as instance variable. When the class variable is defined as int then it's initial value is by default zero, when declared boolean its default value is false and null for object references. Class variables are associated with the class, rather than with any object.  &lt;/span&gt;&lt;/p&gt; &lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What is the difference between the instanceof and getclass, these two are same or not ?&lt;br /&gt;&lt;b&gt;Answer: &lt;/b&gt;instanceof is a operator, not a function while getClass is a method of java.lang.Object class. Consider a condition where we use&lt;br /&gt;if(o.getClass().getName().equals("java.lang.Math")){  }&lt;br /&gt;This method only checks if the classname we have passed is equal to java.lang.Math. The class java.lang.Math is loaded by the bootstrap ClassLoader. This class is an abstract class.This class loader is responsible for loading classes. Every Class object contains a reference to the ClassLoader that defines. getClass() method returns the runtime class of an object. It fetches the java instance of the given fully qualified type name. The code we have written is not necessary, because we should not compare getClass.getName(). The reason behind it is that if the two different class loaders load the same class but for the JVM, it will consider both classes as different classes so, we can't compare their names. It can only gives the implementing class but can't compare a interface, but instanceof operator can.&lt;br /&gt;The instanceof operator compares an object to a specified type. We can use it to test if an object is an instance of a class, an instance of a subclass, or an instance of a class that implements a particular interface. We should try to use instanceof operator in place of getClass() method. Remember instanceof opeator and getClass are not same. Try this example, it will help you to better understand the difference between the two.&lt;br /&gt;Interface one{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Class Two implements one {&lt;br /&gt;}&lt;br /&gt;Class Three implements one {&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class Test {&lt;br /&gt;public static void main(String args[]) {&lt;br /&gt;one test1 = new Two();&lt;br /&gt;one test2 = new Three();&lt;br /&gt;System.out.println(test1 instanceof one); //true&lt;br /&gt;System.out.println(test2 instanceof one); //true&lt;br /&gt;System.out.println(Test.getClass().equals(test2.getClass()));   //false&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;h1 align="left"&gt;Jakarta Struts Interview Questions&lt;/h1&gt;&lt;br /&gt;&lt;p align="center"&gt;           &lt;span style="color:#000000;"&gt;           &lt;a href="http://www.roseindia.net/interviewquestions/corejava.shtml"&gt;&lt;img src="http://www.roseindia.net/images/previous.gif" border="0" /&gt;&lt;/a&gt;                    &lt;a href="http://www.roseindia.net/interviewquestions/index.shtml"&gt;&lt;img src="http://www.roseindia.net/images/bt_home.gif" border="0" /&gt;&lt;/a&gt;                    &lt;a href="http://www.roseindia.net/interviewquestions/strutsinterviewquestions.shtml"&gt;&lt;img src="http://www.roseindia.net/images/next.gif" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Q: What is Jakarta Struts Framework?&lt;br /&gt;    A: &lt;/b&gt;Jakarta Struts is open source implementation of MVC     (Model-View-Controller) pattern for the development of web based     applications. Jakarta Struts is robust architecture and can be used for the     development of application of any size. Struts framework makes it much     easier to design scalable, reliable Web applications with Java.&lt;br /&gt;       &lt;/span&gt;  &lt;span style="color:#000000;"&gt;&lt;b&gt;Q: What is ActionServlet?&lt;br /&gt;    A: &lt;/b&gt;The class &lt;i&gt;org.apache.struts.action.ActionServlet &lt;/i&gt;is the called     the ActionServlet. In the the Jakarta Struts Framework this class plays the     role of controller. All the requests to the server goes through the     controller. Controller is responsible for handling all the requests.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Q: How you will make available any Message     Resources Definitions file to the Struts Framework Environment?&lt;br /&gt;    A: &lt;/b&gt;Message Resources Definitions file are simple .properties files and     these files contains the messages that can be used in the struts project. Message     Resources Definitions files can be added to the struts-config.xml file     through &lt;b&gt;&lt;message-resources&gt;&lt;/b&gt;     tag.&lt;br /&gt;    &lt;b&gt;Example:&lt;/b&gt;&lt;br /&gt;    &lt;message-resources parameter="MessageResources"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Q: What is Action Class?&lt;br /&gt;    A: &lt;/b&gt;The Action is part of the controller. The purpose of Action Class is to translate the HttpServletRequest to the business logic. To use the Action, we need to  Subclass and overwrite the execute()  method. The ActionServlet (commad) passes the parameterized class to Action Form using the execute() method. There should be no database interactions in the action. The action should receive the request, call business objects (which then handle database, or interface with J2EE, etc) and then determine where to go next. Even better, the business objects could be handed to the action at runtime (IoC style) thus removing any dependencies on the model.   The return type of the execute method is ActionForward which is used by the Struts Framework to forward the request to the file as per the value of the returned ActionForward object.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Q: Write code of any Action Class?&lt;br /&gt;    A: &lt;/b&gt;Here is the code of Action Class that returns the &lt;i&gt;ActionForward&lt;/i&gt; object.&lt;br /&gt;    &lt;b&gt;TestAction.java&lt;/b&gt;     &lt;/span&gt;   &lt;table bg border="1" cellspacing="1" width="554" style="color:#ffff99;"&gt;     &lt;tbody&gt;       &lt;tr&gt;         &lt;td width="544"&gt;                    &lt;div class="java" align="left"&gt; &lt;table bg border="0" cellpadding="3" cellspacing="0" width="544" style="color:#ffff99;"&gt;    &lt;tbody&gt;&lt;tr&gt;   &lt;!-- start source code --&gt;    &lt;td align="left" nowrap="nowrap" valign="top"&gt;     &lt;code&gt; &lt;span style="color:#000000;"&gt;&lt;b&gt;package &lt;/b&gt;roseindia.net;&lt;br /&gt;&lt;br /&gt; &lt;b&gt;import &lt;/b&gt;javax.servlet.http.HttpServletRequest;&lt;br /&gt; &lt;b&gt;import &lt;/b&gt;javax.servlet.http.HttpServletResponse;&lt;br /&gt;&lt;br /&gt; &lt;b&gt;import &lt;/b&gt;org.apache.struts.action.Action;&lt;br /&gt; &lt;b&gt;import &lt;/b&gt;org.apache.struts.action.ActionForm;&lt;br /&gt; &lt;b&gt;import &lt;/b&gt;org.apache.struts.action.ActionForward;&lt;br /&gt; &lt;b&gt;import &lt;/b&gt;org.apache.struts.action.ActionMapping;&lt;br /&gt;&lt;br /&gt; &lt;b&gt;public class &lt;/b&gt;TestAction &lt;b&gt;extends &lt;/b&gt;Action&lt;br /&gt; {&lt;br /&gt;   &lt;b&gt;public &lt;/b&gt;ActionForward execute(&lt;br /&gt;     ActionMapping mapping,&lt;br /&gt;     ActionForm form,&lt;br /&gt;     HttpServletRequest request,&lt;br /&gt;     HttpServletResponse response) &lt;b&gt;throws &lt;/b&gt;Exception{&lt;br /&gt;       &lt;b&gt;return &lt;/b&gt;mapping.findForward("testAction");&lt;br /&gt;   }&lt;br /&gt; }&lt;/span&gt;&lt;/code&gt;         &lt;/td&gt;     &lt;/tr&gt;  &lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt; &lt;!-- =       END of automatically generated HTML code       = --&gt; &lt;!-- ======================================================== --&gt;      &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;span style="color:#000000;"&gt;&lt;b&gt;Q: What is ActionForm?&lt;br /&gt;    A: &lt;/b&gt;An ActionForm is a JavaBean that extends &lt;code&gt;org.apache.struts.action.ActionForm&lt;/code&gt;.     ActionForm maintains the session state for web application and the     ActionForm object is automatically populated on the server side with data     entered from a form on the client side.&lt;br /&gt;       &lt;/span&gt;  &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Q: What is Struts Validator Framework?&lt;br /&gt;    A: &lt;/b&gt;Struts Framework provides the functionality to validate the form data. It can be use to validate the data on the users browser as well as on the server side. Struts Framework emits the java scripts and it can be used validate the form data on the client browser. Server side validation of form can be accomplished by sub classing your From Bean with &lt;b&gt;DynaValidatorForm&lt;/b&gt; class. &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;The Validator framework was developed by David Winterfeldt as third-party add-on to Struts. Now the Validator framework is a part of Jakarta Commons project and it can be used with or without Struts. The Validator framework comes integrated with the Struts Framework and can be used without doing any extra settings.&lt;br /&gt;   &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Q. Give the Details of XML files used in Validator Framework?&lt;br /&gt;A: &lt;/b&gt;The Validator Framework uses two XML configuration files &lt;b&gt;validator-rules.xml&lt;/b&gt; and &lt;b&gt;validation.xml&lt;/b&gt;. The &lt;b&gt;validator-rules.xml&lt;/b&gt; defines the standard validation routines, these are reusable and used in &lt;b&gt;validation.xml&lt;/b&gt;. to define the form specific validations. The &lt;b&gt;validation.xml&lt;/b&gt; defines the validations applied to a form bean.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Q. How you will display validation fail errors on jsp page?&lt;br /&gt;A: &lt;/b&gt;Following tag displays all the errors:&lt;br /&gt;&lt;html:errors/&gt;&lt;br /&gt;  &lt;/span&gt;&lt;/p&gt; &lt;span style="color:#000000;"&gt;&lt;b&gt;Q. How you will enable front-end validation based on the xml in validation.xml?&lt;br /&gt;A: &lt;/b&gt;The &lt;html:javascript&gt; tag to allow front-end validation based on the xml in validation.xml. For  example the code: &lt;html:javascript formname="logonForm" dynamicjavascript="true" staticjavascript="true"&gt; generates the client side java script for the form "logonForm" as defined in the validation.xml file. The &lt;html:javascript&gt; when added in the jsp file generates the client site validation script.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;h1 align="left"&gt;Struts Interview Questions&lt;/h1&gt;&lt;br /&gt;&lt;p align="center"&gt;           &lt;span style="color:#000000;"&gt;           &lt;a href="http://www.roseindia.net/interviewquestions/jakartastrutsinterviewquestions.shtml"&gt;&lt;img src="http://www.roseindia.net/images/previous.gif" border="0" /&gt;&lt;/a&gt;                    &lt;a href="http://www.roseindia.net/interviewquestions/index.shtml"&gt;&lt;img src="http://www.roseindia.net/images/bt_home.gif" border="0" /&gt;&lt;/a&gt;                    &lt;a href="http://www.roseindia.net/interviewquestions/struts-interviewquestion-1.shtml"&gt;&lt;img src="http://www.roseindia.net/images/next.gif" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;&lt;br /&gt;Question: What is RequestProcessor and RequestDispatcher?&lt;br /&gt;    Answer:&lt;/b&gt;  The controller is responsible for intercepting and translating user input into actions to be performed by the model. The controller is responsible for selecting the next view based on user input and the outcome of model operations. The Controller receives the request from the browser, invoke a business operation and coordinating the view to return to the client.&lt;br /&gt;   &lt;br /&gt;The controller is implemented by a java servlet, this servlet is centralized point of control for the web application. In struts framework the controller responsibilities are implemented by several different components like&lt;br /&gt;    &lt;b&gt;The ActionServlet Class&lt;br /&gt;    The RequestProcessor Class&lt;br /&gt;    The Action Class&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;     The ActionServlet extends the&lt;b&gt; javax.servlet.http.httpServlet&lt;/b&gt; class. The ActionServlet class is not abstract and therefore can be used as a concrete controller by your application.&lt;br /&gt;The controller is implemented by the ActionServlet class. All incoming requests are mapped to the central controller in the deployment descriptor as follows.&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;servlet&gt;&lt;br /&gt;                &lt;servlet-name&gt;action&lt;/servlet-name&gt;&lt;br /&gt;                &lt;servlet-class&gt;org.apache.struts.action.ActionServlet&lt;/servlet-class&gt;&lt;br /&gt;    &lt;/servlet&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt;    All request URIs with the pattern *.do are mapped to this servlet in the deployment descriptor as follows.&lt;br /&gt;   &lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;servlet-mapping&gt;&lt;br /&gt;   &lt;servlet-name&gt;action&lt;/servlet-name&gt;&lt;br /&gt;            &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;&lt;br /&gt;            &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;    A request URI that matches this pattern will have the following form.&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;http://www.my_site_name.com/mycontext/actionName.do&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;   &lt;br /&gt;The preceding mapping is called extension mapping, however, you can also specify path mapping where a pattern ends with /* as shown below.&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;servlet-mapping&gt;&lt;br /&gt;        &lt;servlet-name&gt;action&lt;/servlet-name&gt;&lt;br /&gt;        &lt;url-pattern&gt;/do/*&lt;/url-pattern&gt;&lt;br /&gt;    &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;    A request URI that matches this pattern will have the following form.&lt;br /&gt;    http://www.my_site_name.com/mycontext/do/action_Name&lt;br /&gt;    The class &lt;b&gt; org.apache.struts.action.requestProcessor&lt;/b&gt; process the request from the controller. You can sublass the RequestProcessor with your own version and modify how the request is processed.&lt;br /&gt;   &lt;br /&gt;Once the controller receives a client request, it delegates the handling of the request to a helper class. This helper knows how to execute the business operation associated with the requested action. In the Struts framework this helper class is descended of org.apache.struts.action.Action class. It acts as a bridge between a client-side user action and business operation. The Action class decouples the client request from the business model. This decoupling allows for more than one-to-one mapping between the user request and an action. The Action class also can perform other functions such as authorization, logging before invoking business operation. the Struts Action class contains several methods, but most important method is the execute() method.&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;public ActionForward execute(ActionMapping mapping,&lt;br /&gt;                ActionForm form, HttpServletRequest request, HttpServletResponse response)        throws Exception; &lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;The execute() method is called by the controller when a request is received from a client. The controller creates an instance of the Action class if one doesn’t already exist. The strut framework will create only a single instance of each Action class in your application.&lt;br /&gt;   &lt;br /&gt;Action are mapped in the struts configuration file and this configuration is loaded into memory at startup and made available to the framework at runtime. Each Action element is represented in memory by an instance of the org.apache.struts.action.ActionMapping class . The ActionMapping object contains a path attribute that is matched against a portion of the URI of the incoming request.&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;action&gt;&lt;br /&gt;            path= "/somerequest"&lt;br /&gt;            type="com.somepackage.someAction"&lt;br /&gt;            scope="request"&lt;br /&gt;            name="someForm"&lt;br /&gt;            validate="true"&lt;br /&gt;            input="somejsp.jsp"&lt;br /&gt;        &lt;forward name="Success" path="/action/xys" redirect="true"&gt;&lt;br /&gt;        &lt;forward name="Failure" path="/somejsp.jsp" redirect="true"&gt;&lt;br /&gt;    &lt;/action&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;Once this is done the controller should determine which view to return to the client. The execute method signature in Action class has a return type org.apache.struts.action.ActionForward class. The ActionForward class represents a destination to which the controller may send control once an action has completed. Instead of specifying an actual JSP page in the code, you can declaratively associate as action forward through out the application. The action forward are specified in the configuration file.&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;action&gt;&lt;br /&gt;            path= "/somerequest"&lt;br /&gt;            type="com.somepackage.someAction"&lt;br /&gt;            scope="request"&lt;br /&gt;            name="someForm"&lt;br /&gt;            validate="true"&lt;br /&gt;            input="somejsp.jsp"&lt;br /&gt;        &lt;forward name="Success" path="/action/xys" redirect="true"&gt;&lt;br /&gt;        &lt;forward name="Failure" path="/somejsp.jsp" redirect="true"&gt;&lt;br /&gt;    &lt;/action&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;    The action forward mappings also can be specified in a global section, independent of any specific action mapping.&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;global-forwards&gt;&lt;br /&gt;        &lt;forward name="Success" path="/action/somejsp.jsp"&gt;&lt;br /&gt;        &lt;forward name="Failure" path="/someotherjsp.jsp"&gt;&lt;br /&gt;    &lt;/global-forwards&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;   &lt;br /&gt;    &lt;b&gt;public interface RequestDispatcher&lt;/b&gt;&lt;br /&gt;   &lt;br /&gt;Defines an object that receives requests from the client and sends them to any resource (such as a servlet, HTML file, or JSP file) on the server. The servlet container creates the RequestDispatcher object, which is used as a wrapper around a server resource located at a particular path or given by a particular name.&lt;br /&gt;This interface is intended to wrap servlets, but a servlet container can create RequestDispatcher objects to wrap any type of resource.&lt;br /&gt;   &lt;br /&gt;    &lt;b&gt;getRequestDispatcher&lt;/b&gt;&lt;br /&gt;   &lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;public RequestDispatcher getRequestDispatcher(java.lang.String path)&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;   &lt;br /&gt;Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path. A RequestDispatcher object can be used to forward a request to the resource or to include the resource in a response. The resource can be dynamic or static.&lt;br /&gt;The pathname must begin with a "/" and is interpreted as relative to the current context root. Use getContext to obtain a RequestDispatcher for resources in foreign contexts. This method returns null if the ServletContext cannot return a RequestDispatcher.&lt;br /&gt;   &lt;br /&gt;    &lt;b&gt;    Parameters:&lt;br /&gt;        path - a String specifying the pathname to the resource&lt;br /&gt;    Returns:&lt;br /&gt;        a RequestDispatcher object that acts as a wrapper for the resource at the specified path&lt;br /&gt;    See Also:&lt;br /&gt;        RequestDispatcher, getContext(java.lang.String)&lt;/b&gt;&lt;br /&gt;   &lt;br /&gt;    getNamedDispatcher&lt;br /&gt;   &lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;public RequestDispatcher getNamedDispatcher(java.lang.String name)&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;   &lt;br /&gt;    Returns a RequestDispatcher object that acts as a wrapper for the named servlet.&lt;br /&gt;Servlets (and JSP pages also) may be given names via server administration or via a web application deployment descriptor. A servlet instance can determine its name using ServletConfig.getServletName().&lt;br /&gt;    This method returns null if the ServletContext cannot return a RequestDispatcher for any reason.&lt;br /&gt;   &lt;br /&gt;    &lt;b&gt;        Parameters:&lt;br /&gt;        name - a String specifying the name of a servlet to wrap&lt;br /&gt;        Returns:&lt;br /&gt;        a RequestDispatcher object that acts as a wrapper for the named servlet&lt;br /&gt;        See Also:&lt;br /&gt;        RequestDispatcher, getContext(java.lang.String), ServletConfig.getServletName()&lt;br /&gt;      &lt;/b&gt;&lt;/span&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question: Why cant we overide create method in StatelessSessionBean?&lt;br /&gt;    Answer:&lt;/b&gt;  &lt;/span&gt;&lt;span style="color:#000000;"&gt;From the EJB Spec : - A Session bean's home interface defines one or morecreate(...) methods. Each create method must be named create and must match one of the ejbCreate methods defined in the enterprise Bean class. The return type of a create method must be the enterprise Bean's remote interface type. The home interface of a stateless session bean must have one create method that takes no arguments.&lt;br /&gt;      &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question: Is struts threadsafe?Give an example?&lt;br /&gt;    Answer:&lt;/b&gt;  &lt;/span&gt;&lt;span style="color:#000000;"&gt;Struts is not only thread-safe but thread-dependant. The response to a request is handled by a light-weight Action object, rather than an individual servlet. Struts instantiates each Action class once, and allows other requests to be threaded through the original object. This core strategy conserves resources and provides the best possible throughput. A properly-designed application will exploit this further by routing related operations through a single Action.&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question: Can we Serialize static variable?&lt;br /&gt;    Answer:  &lt;/b&gt;Serialization is the process of converting a set of object         instances that contain references to each other into a linear stream of         bytes, which can then be sent through a socket, stored to a file, or         simply manipulated as a stream of data. Serialization is the mechanism         used by RMI to pass objects between JVMs, either as arguments in a         method invocation from a client to a server or as return values from a         method invocation. In the first section of this book, There are         three exceptions in which serialization doesnot necessarily read and         write to the stream. These are&lt;br /&gt;        1. Serialization ignores static fields, because they are not part of any         particular object's state.&lt;br /&gt;        2. Base class fields are only handled if the base class itself is     serializable.&lt;br /&gt;        3. Transient fields.         There are four basic things       you must do when you are making a class serializable. They are:&lt;/span&gt;      &lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="color:#000000;"&gt;Implement the Serializable interface.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000000;"&gt;Make sure that instance-level, locally defined state is serialized         properly.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000000;"&gt;Make sure that superclass state is serialized properly.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000000;"&gt;Override equals( )and hashCode(         ).&lt;br /&gt;it is possible to have control over serialization process. The class       should implement Externalizable interface. This interface contains two       methods namely readExternal and writeExternal. You should implement these       methods and write the logic for customizing the serialization process ....         (Source: &lt;a href="http://www.oreilly.com/catalog/javarmi/chapter/ch10.html"&gt;http://www.oreilly.com/catalog/javarmi/chapter/ch10.html&lt;/a&gt;)&lt;br /&gt;          &lt;/span&gt;                 &lt;/li&gt;&lt;/ol&gt; &lt;span style="color:#000000;"&gt;&lt;b&gt;Question: What are the uses of tiles-def.xml file, resourcebundle.properties file, validation.xml file?&lt;br /&gt;    Answer:  &lt;/b&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;tiles-def.xml is is an xml file used to configure tiles with the struts application. You can define the layout / header / footer / body content for your View. See more at &lt;a href="http://www.roseindia.net/struts/using-tiles-defs-xml.shtml"&gt;http://www.roseindia.net/struts/using-tiles-defs-xml.shtml&lt;/a&gt;.&lt;br /&gt;   &lt;br /&gt;    The &lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt; resourcebundle.properties &lt;/b&gt;file is     used to configure the message (error/ other messages) for the struts     applications.&lt;br /&gt;   &lt;br /&gt;    The file validation.xml is used to declare sets of validations that should be applied to Form Beans.     Fpr more information please visit &lt;a href="http://www.roseindia.net/struts/address_struts_validator.shtml"&gt;http://www.roseindia.net/struts/address_struts_validator.shtml&lt;/a&gt;.&lt;br /&gt;       &lt;/span&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question: What is the difference between     perform() and execute() methods?&lt;br /&gt;    Answer:  &lt;/b&gt;Perform method is the method which was deprecated in the     Struts Version 1.1.  &lt;/span&gt;&lt;span style="color:#000000;"&gt;In Struts 1.x, Action.perform() is the method called by the ActionServlet. This is typically where your business logic resides, or at least the flow control to your JavaBeans and EJBs that handle your business logic. As we already mentioned, to support declarative exception handling, the method signature changed in perform. Now execute just throws Exception. Action.perform() is now deprecated; however, the Struts v1.1 ActionServlet is smart enough to know whether or not it should call perform or execute in the Action, depending on which one is available.&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question: What are the various Struts tag libraries?&lt;br /&gt;    Answer:  &lt;/b&gt;Struts is very rich framework and it provides very good     and user friendly way to develop web application forms. Struts provide many     tag libraries to ease the development of web applications. These tag     libraries are:&lt;br /&gt; * Bean tag library - Tags for accessing JavaBeans and their properties.&lt;br /&gt;    * HTML tag library - Tags to output standard HTML, including forms, text     boxes, checkboxes, radio buttons etc..&lt;br /&gt;    * Logic tag library - Tags for generating conditional output, iteration capabilities and flow management&lt;br /&gt;    * Tiles or Template tag library - For the application using tiles&lt;br /&gt;    * Nested tag library - For using the nested beans in the application&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question: What do you understand by     DispatchAction?&lt;br /&gt;    Answer:  &lt;/b&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;DispatchAction is an action that comes with Struts 1.1     or later, that lets you combine Struts actions into one class, each with their own method.     The org.apache.struts.action.DispatchAction class allows multiple operation     to mapped to the different functions in the same Action class.&lt;br /&gt;    &lt;b&gt;For example: &lt;/b&gt;&lt;br /&gt;    A package might include separate RegCreate, RegSave, and RegDelete Actions,     which just perform different operations on the same RegBean object. Since     all of these operations are usually handled by the same JSP page, it would     be handy to also have them handled by the same Struts Action.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;A very simple way to do this is to have the submit     button modify a field in the form which indicates which operation to     perform.&lt;/span&gt;&lt;/p&gt;     &lt;blockquote&gt;       &lt;p&gt;&lt;code&gt;&lt;span style="color:#000000;"&gt;&lt;html:hidden property="dispatch" value="error"&gt;&lt;br /&gt;      &lt;script&gt;function set(target)       {document.forms[0].dispatch.value=target;}&lt;/script&gt;&lt;br /&gt;      &lt;html:submit onclick="set('save');"&gt;SAVE&lt;/html:submit&gt;&lt;br /&gt;      &lt;html:submit onclick="set('create');"&gt;SAVE AS NEW&lt;/html:submitl&gt;&lt;br /&gt;      &lt;html:submit onclick="set('delete);"&gt;DELETE&lt;/html:submit&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;     &lt;/blockquote&gt;     &lt;p&gt;&lt;span style="color:#000000;"&gt;Then, in the Action you can setup different methods     to handle the different operations, and branch to one or the other depending     on which value is passed in the dispatch field.&lt;/span&gt;&lt;/p&gt;     &lt;blockquote&gt;       &lt;p&gt;&lt;code&gt;&lt;span style="color:#000000;"&gt;String dispatch = myForm.getDispatch();&lt;br /&gt;      if ("create".equals(dispatch)) { ...&lt;br /&gt;      if ("save".equals(dispatch)) { ...&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;     &lt;/blockquote&gt;     &lt;p&gt;&lt;span style="color:#000000;"&gt;The Struts Dispatch Action [org.apache.struts.actions]     is designed to do exactly the same thing, but without messy branching logic.     The base perform method will check a dispatch field for you, and invoke the     indicated method. The only catch is that the dispatch methods must use the     same signature as perform. This is a very modest requirement, since in     practice you usually end up doing that anyway.&lt;/span&gt;&lt;/p&gt;     &lt;p&gt;&lt;span style="color:#000000;"&gt;To convert an Action that was switching on a     dispatch field to a DispatchAction, you simply need to create methods like     this&lt;/span&gt;&lt;/p&gt;     &lt;blockquote&gt;       &lt;p&gt;&lt;code&gt;&lt;span style="color:#000000;"&gt;public ActionForward create(&lt;br /&gt;          ActionMapping mapping,&lt;br /&gt;          ActionForm form,&lt;br /&gt;          HttpServletRequest request,&lt;br /&gt;          HttpServletResponse response)&lt;br /&gt;        throws IOException, ServletException { ...&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;       &lt;p&gt;&lt;code&gt;&lt;span style="color:#000000;"&gt;public ActionForward save(&lt;br /&gt;          ActionMapping mapping,&lt;br /&gt;          ActionForm form,&lt;br /&gt;          HttpServletRequest request,&lt;br /&gt;          HttpServletResponse response)&lt;br /&gt;        throws IOException, ServletException { ...&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;     &lt;/blockquote&gt;     &lt;p&gt;&lt;span style="color:#000000;"&gt;Cool. But do you have to use a property named     dispatch? No, you don't. The only other step is to specify the name of of     the dispatch property as the "parameter" property of the     action-mapping. So a mapping for our example might look like this:&lt;/span&gt;&lt;/p&gt;     &lt;blockquote&gt;       &lt;p&gt;&lt;code&gt;&lt;span style="color:#000000;"&gt;&lt;action&lt;br /&gt;        path="/reg/dispatch"&lt;br /&gt;        type="app.reg.RegDispatch"&lt;br /&gt;        name="regForm"&lt;br /&gt;        scope="request"&lt;br /&gt;        validate="true"&lt;br /&gt;        parameter="dispatch"/&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;     &lt;/blockquote&gt;     &lt;p&gt;&lt;span style="color:#000000;"&gt;If you wanted to use the property "o"     instead, as in o=create, you would change the mapping to&lt;/span&gt;&lt;/p&gt;     &lt;blockquote&gt;       &lt;p&gt;&lt;code&gt;&lt;span style="color:#000000;"&gt;&lt;action&lt;br /&gt;        path="/reg/dispatch"&lt;br /&gt;        type="app.reg.RegDispatch"&lt;br /&gt;        name="regForm"&lt;br /&gt;        scope="request"&lt;br /&gt;        validate="true"&lt;br /&gt;        parameter="o"/&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;     &lt;/blockquote&gt;     &lt;p&gt;&lt;span style="color:#000000;"&gt;Again, very cool. But why use a JavaScript button     in the first place? Why not use several buttons named "dispatch"     and use a different value for each?&lt;/span&gt;&lt;/p&gt;     &lt;p&gt;&lt;span style="color:#000000;"&gt;You can, but the value of the button is also its     label. This means if the page designers want to label the button something     different, they have to coordinate the Action programmer. Localization     becomes virtually impossible. (Source: &lt;a href="http://husted.com/struts/tips/002.html" target="_blank"&gt;http://husted.com/struts/tips/002.html&lt;/a&gt;).&lt;br /&gt;        &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question: How Struts relates to J2EE?&lt;br /&gt;    Answer: &lt;/b&gt;Struts framework  is built on J2EE technologies (JSP,     Servlet, Taglibs), but it is itself not part of the J2EE standard.&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question: What is Struts actions and action mappings?&lt;br /&gt;    Answer: &lt;/b&gt;A Struts action is an instance of a subclass of an Action class, which implements a portion of a Web application and whose perform or execute method returns a forward.&lt;br /&gt;   &lt;br /&gt;    An action can perform tasks such as validating a user name and password.&lt;br /&gt;   &lt;br /&gt;An action mapping is a configuration file entry that, in general, associates an action name with an action. An action mapping can contain a reference to a form bean that the action can use, and can additionally define a list of local forwards that is visible only to this action.&lt;br /&gt;   &lt;br /&gt;An action servlet is a servlet that is started by the servlet container of a Web server to process a request that invokes an action. The servlet receives a forward from the action and asks the servlet container to pass the request to the forward's URL. An action servlet must be an instance of an org.apache.struts.action.ActionServlet class or of a subclass of that class. An action servlet is the primary component of the controller.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;h1 align="left"&gt;Struts Interview Questions&lt;/h1&gt;&lt;br /&gt;&lt;p align="center"&gt;           &lt;span style="color:#000000;"&gt;           &lt;a href="http://www.roseindia.net/interviewquestions/strutsinterviewquestions.shtml"&gt;&lt;img src="http://www.roseindia.net/images/previous.gif" border="0" /&gt;&lt;/a&gt;                    &lt;a href="http://www.roseindia.net/interviewquestions/index.shtml"&gt;&lt;img src="http://www.roseindia.net/images/bt_home.gif" border="0" /&gt;&lt;/a&gt;                    &lt;a href="http://www.roseindia.net/interviewquestions/jsp-interview-questions.shtml"&gt;&lt;img src="http://www.roseindia.net/images/next.gif" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; Can I setup Apache Struts to use multiple configuration files?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; Yes Struts can use multiple configuration files. Here is the configuration example:&lt;br /&gt;&lt;servlet&gt;&lt;br /&gt;        &lt;servlet-name&gt;banking&lt;/servlet-name&gt;&lt;br /&gt;        &lt;servlet-class&gt;org.apache.struts.action.ActionServlet&lt;br /&gt;        &lt;/servlet-class&gt;&lt;br /&gt;        &lt;init-param&gt;&lt;br /&gt;        &lt;param-name&gt;config&lt;/param-name&gt;&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color:#0000ff;"&gt;        &lt;param-value&gt;/WEB-INF/struts-config.xml,&lt;br /&gt;                /WEB-INF/struts-authentication.xml,&lt;br /&gt;                /WEB-INF/struts-help.xml&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="color:#0000ff;"&gt;&lt;/param-value&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000000;"&gt;    &lt;/init-param&gt;&lt;br /&gt;    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;&lt;br /&gt;&lt;/servlet&gt;&lt;br /&gt;&lt;/span&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What are the disadvantages of &lt;/span&gt;Struts&lt;span style="color:#000000;"&gt;?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; Struts is very robust framework and is being used extensively in the industry. But there are some disadvantages of the Struts:&lt;br /&gt;&lt;b&gt;a) High Learning Curve&lt;br /&gt;&lt;/b&gt;Struts requires lot of efforts to learn and master it. For any small project less experience developers could spend more time on learning the Struts.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;b) Harder to learn&lt;/b&gt;&lt;br /&gt;Struts are harder to learn, benchmark and optimize.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What is Struts Flow?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; Struts Flow is a port of Cocoon's Control Flow to Struts to allow complex workflow, like multi-form wizards, to be easily implemented using continuations-capable JavaScript. It provides the ability to describe the order of Web pages that have to be sent to the client, at any given point in time in an application. The code is based on a proof-of-concept Dave Johnson put together to show how the Control Flow could be extracted from Cocoon. (Ref: &lt;a href="http://struts.sourceforge.net/struts-flow/index.html" target="_blank"&gt;http://struts.sourceforge.net/struts-flow/index.html&lt;/a&gt; )&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt;  What are the difference between &lt;bean:message&gt; and &lt;bean:write&gt;?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt;  &lt;b&gt;&lt;bean:message&gt;&lt;/b&gt;: This tag is used to output locale-specific text (from the properties files) from a MessageResources bundle.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;bean:write&gt;&lt;/b&gt;: This tag is used to output property values from a bean. &lt;bean:write&gt; is a commonly used tag which enables the programmers to easily present the data.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What is LookupDispatchAction?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; An abstract Action that dispatches to the subclass mapped execute method. This is useful in cases where an HTML form has multiple submit buttons with the same name. The button name is specified by the parameter property of the corresponding ActionMapping. (Ref. &lt;a href="http://struts.apache.org/1.2.7/api/org/apache/struts/actions/LookupDispatchAction.html" target="_blank"&gt;http://struts.apache.org/1.2.7/api/org/apache/struts/actions/LookupDispatchAction.html&lt;/a&gt;).&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What are the components of Struts?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt;  Struts is based on the MVC design pattern. Struts components can be categories into &lt;b&gt;Model&lt;/b&gt;, &lt;b&gt;View&lt;/b&gt; and &lt;b&gt;Controller&lt;/b&gt;.&lt;br /&gt;&lt;b&gt;Model: &lt;/b&gt;Components like business logic / business processes and data are the part of Model.&lt;br /&gt;&lt;b&gt;View:&lt;/b&gt; JSP, HTML etc. are part of View&lt;br /&gt;&lt;b&gt;Controller:&lt;/b&gt; Action Servlet of Struts is part of Controller components which works as front controller to handle all the requests.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What are Tag Libraries provided with Struts?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt;  Struts provides a number of tag libraries that helps to create view components easily. These tag libraries are:&lt;br /&gt;&lt;b&gt;a) Bean Tags:&lt;/b&gt; Bean Tags are used to access the beans and their properties.&lt;br /&gt;&lt;b&gt;b) HTML Tags:&lt;/b&gt; HTML Tags provides tags for creating the view components like forms, buttons, etc..&lt;br /&gt;&lt;b&gt;c) Logic Tags:&lt;/b&gt; Logic Tags provides presentation logics that eliminate the need for scriptlets.&lt;br /&gt;&lt;b&gt;d) Nested Tags:&lt;/b&gt; Nested Tags helps to work with the nested context.&lt;/span&gt;&lt;/p&gt; &lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What are the core classes of the Struts Framework?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Answer:&lt;/b&gt;  &lt;/span&gt;&lt;span style="color:#000000;"&gt;Core classes of Struts Framework are ActionForm, Action, ActionMapping, ActionForward, ActionServlet etc.&lt;/span&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What are difference between ActionErrors and ActionMessage?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt;  &lt;b&gt;ActionMessage:&lt;/b&gt; A class that encapsulates messages. Messages can be either global or they are specific to a particular bean property.&lt;br /&gt;Each individual message is described by an ActionMessage object, which contains a message key (to be looked up in an appropriate message resources database), and up to four placeholder arguments used for parametric substitution in the resulting message.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;ActionErrors:&lt;/b&gt; A class that encapsulates the error messages being reported by the validate() method of an ActionForm. Validation errors are either global to the entire ActionForm bean they are associated with, or they are specific to a particular bean property (and, therefore, a particular input field on the corresponding form).&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt;  How you will handle exceptions in Struts?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt;  In Struts you can handle the exceptions in two ways:&lt;br /&gt;&lt;b&gt;a) Declarative Exception Handling: &lt;/b&gt;You can either define global exception handling tags in your struts-config.xml or define the exception handling tags within &lt;action&gt;..&lt;/action&gt; tag.&lt;br /&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;exception&gt; &lt;/o:p&gt; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;      key="database.error.duplicate"&lt;o:p&gt; &lt;/o:p&gt; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;      path="/UserExists.jsp"&lt;o:p&gt; &lt;/o:p&gt; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;      type="mybank.account.DuplicateUserException"/&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;b) Programmatic Exception Handling:&lt;/b&gt; Here you can use try{}catch{} block to handle the exception.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h1 align="left"&gt;JSP Interview Questions&lt;/h1&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What do you understand by JSP     Actions?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; JSP actions are XML tags that direct the server to use existing components or control the behavior of the JSP engine. JSP Actions consist of a typical (XML-based) prefix of "jsp" followed by a colon, followed by the action name followed by one or more attribute parameters.&lt;br /&gt;    There are six JSP Actions:&lt;/span&gt; &lt;p&gt;&lt;code&gt;&lt;span style="color:#000000;"&gt;&lt;jsp:include/&gt;&lt;/span&gt;&lt;/code&gt; &lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;span style="color:#000000;"&gt;&lt;jsp:forward/&gt;&lt;/span&gt;&lt;/code&gt; &lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;span style="color:#000000;"&gt;&lt;jsp:plugin/&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;span style="color:#000000;"&gt;&lt;jsp:usebean/&gt;&lt;/span&gt;&lt;/code&gt; &lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;span style="color:#000000;"&gt;&lt;jsp:setproperty/&gt;&lt;/span&gt;&lt;/code&gt; &lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;span style="color:#000000;"&gt;&lt;jsp:getproperty/&gt; &lt;/span&gt;&lt;/code&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;   &lt;code&gt;   &lt;/code&gt;&lt;/span&gt;&lt;/p&gt; &lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What is the difference between &lt;code&gt;&lt;jsp:include page =" ..."&gt;&lt;/code&gt; and &lt;code&gt;&lt;br /&gt;    &lt;%@ include file = ... &gt;&lt;/code&gt;?.&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  Both the tag includes the     information from one page in another. The differences are as follows:&lt;br /&gt;    &lt;code&gt;&lt;b&gt;&lt;jsp:include page =" ..."&gt;:&lt;/b&gt; This is like a function call     from one jsp to another jsp. It is executed ( the included page is     executed  and the generated html content is included in the content of     calling jsp) each time the client page is accessed by the client. This     approach is useful to for modularizing the web application. If the included     file changed then the new content will be included in the output.&lt;br /&gt;   &lt;br /&gt;    &lt;b&gt;&lt;%@ include file = ... &gt;&lt;/b&gt;: In this case the content     of the included file is textually embedded in the page that have &lt;%@     include file=".."&gt; directive. In this case in the included file     changes, the changed content will not included in the output. This approach     is used when the code from one jsp file required to include in multiple jsp     files.&lt;br /&gt;           &lt;/code&gt;&lt;/span&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What is the difference between &lt;code&gt;&lt;jsp:forward page =" ..."&gt;&lt;/code&gt; and &lt;code&gt;&lt;br /&gt;    &lt;/code&gt;response.sendRedirect(url),?.&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;   &lt;/span&gt;&lt;span style="color:#000000;"&gt;The &lt;jsp:forward&gt;     element forwards the request object containing the client request     information from one JSP file to another file. The target file can be an     HTML file, another JSP file, or a servlet, as long as it is in the same     application context as the forwarding JSP file.&lt;br /&gt;    &lt;b&gt;&lt;i&gt;sendRedirect&lt;/i&gt;&lt;/b&gt; sends HTTP temporary redirect response to the     browser, and browser creates a new request to go the redirected page.     The  response.sendRedirect kills the session variables.&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question: &lt;/b&gt;Identify the advantages of JSP over     Servlet.&lt;br /&gt;   &lt;br /&gt;    a) Embedding of Java code in HTML pages&lt;br /&gt;    b) Platform independence&lt;br /&gt;    c) Creation of database-driven Web applications&lt;br /&gt;    d) Server-side programming capabilities&lt;br /&gt;   &lt;br /&gt;    &lt;b&gt;Answer :- Embedding of Java code in HTML pages&lt;br /&gt;      &lt;/b&gt;&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;Write the following code for a JSP page:&lt;br /&gt;    &lt;%@ page language = "java" %&gt;&lt;br /&gt;   &lt;br /&gt;    &lt;html&gt;&lt;br /&gt;    &lt;head&gt;&lt;title&gt;RESULT PAGE&lt;/title&gt;&lt;/head&gt;&lt;br /&gt;    &lt;body&gt;&lt;br /&gt;    &lt;%&lt;br /&gt;   &lt;br /&gt;    PrintWriter print = request.getWriter();&lt;br /&gt;    print.println("Welcome");&lt;br /&gt;   &lt;br /&gt;    %&gt;&lt;br /&gt;    &lt;/body&gt;&lt;br /&gt;    &lt;/html&gt;&lt;br /&gt;    &lt;span style="font-family: Times New Roman;"&gt;Suppose     you access this JSP file, Find out your answer.&lt;br /&gt;    a) A blank page will be displayed.&lt;br /&gt;    b) A page with the text Welcome is displayed&lt;br /&gt;    c) An exception will be thrown because the implicit out object is not used&lt;br /&gt;    d) An exception will be thrown because PrintWriter can be used in servlets only&lt;br /&gt;   &lt;br /&gt;    &lt;b&gt;Answer :- A page with the text Welcome is displayed&lt;br /&gt;       &lt;/b&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question: &lt;/b&gt;&lt;span style="font-family: Times New Roman;"&gt;What     are implicit Objects available to the JSP Page?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:#000000;"&gt;&lt;b&gt;Answer: &lt;/b&gt;Implicit objects are the objects     available to the JSP page. These objects are created by Web container and     contain information related to a particular request, page, or application.     The JSP implicit objects are:&lt;br /&gt;    &lt;/span&gt;     &lt;table bg border="1" border cellpadding="0" cellspacing="0" width="654" style="color:#800000;"&gt;       &lt;tbody&gt;&lt;tr&gt;         &lt;th bg width="78" style="color:#ffff00;"&gt;&lt;span style="color:#000000;"&gt;Variable&lt;br /&gt;          &lt;/span&gt;&lt;/th&gt;         &lt;th bg width="187" style="color:#ffff00;"&gt;&lt;span style="color:#000000;"&gt;Class&lt;br /&gt;          &lt;/span&gt;&lt;/th&gt;         &lt;th bg width="381" style="color:#ffff00;"&gt;&lt;span style="color:#000000;"&gt;Description&lt;br /&gt;          &lt;/span&gt;&lt;/th&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td width="78"&gt;&lt;span style="color:#000000;"&gt;application&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width="187"&gt;&lt;span style="color:#000000;"&gt;javax.servlet.ServletContext&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width="381"&gt;&lt;span style="color:#000000;"&gt;The context for the JSP page's servlet and any Web           components contained in the same application.&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td width="78"&gt;&lt;span style="color:#000000;"&gt;config&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width="187"&gt;&lt;span style="color:#000000;"&gt;javax.servlet.ServletConfig&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width="381"&gt;&lt;span style="color:#000000;"&gt;Initialization information for the JSP page's           servlet.&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td width="78"&gt;&lt;span style="color:#000000;"&gt;exception&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width="187"&gt;&lt;span style="color:#000000;"&gt;java.lang.Throwable&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width="381"&gt;&lt;span style="color:#000000;"&gt;Accessible only from an error page.&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td width="78"&gt;&lt;span style="color:#000000;"&gt;out&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width="187"&gt;&lt;span style="color:#000000;"&gt;javax.servlet.jsp.JspWriter&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width="381"&gt;&lt;span style="color:#000000;"&gt;The output stream.&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td width="78"&gt;&lt;span style="color:#000000;"&gt;page&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width="187"&gt;&lt;span style="color:#000000;"&gt;java.lang.Object&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width="381"&gt;&lt;span style="color:#000000;"&gt;The instance of the JSP page's servlet processing the           current request. Not typically used by JSP page authors.&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td width="78"&gt;&lt;span style="color:#000000;"&gt;pageContext&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width="187"&gt;&lt;span style="color:#000000;"&gt;javax.servlet.jsp.PageContext&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width="381"&gt;&lt;span style="color:#000000;"&gt;The context for the JSP page. Provides a single API           to manage the various scoped attributes.&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td width="78"&gt;&lt;span style="color:#000000;"&gt;request&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width="187"&gt;&lt;span style="color:#000000;"&gt;Subtype of javax.servlet.ServletRequest&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width="381"&gt;&lt;span style="color:#000000;"&gt;The request triggering the execution of the JSP page.&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td width="78"&gt;&lt;span style="color:#000000;"&gt;response&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width="187"&gt;&lt;span style="color:#000000;"&gt;Subtype of javax.servlet.ServletResponse&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width="381"&gt;&lt;span style="color:#000000;"&gt;The response to be returned to the client. Not typically           used by JSP page authors.&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td width="78"&gt;&lt;span style="color:#000000;"&gt;session&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width="187"&gt;&lt;span style="color:#000000;"&gt;javax.servlet.http.HttpSession&lt;br /&gt;          &lt;/span&gt;&lt;/td&gt;         &lt;td width="381"&gt;&lt;span style="color:#000000;"&gt;The session object for the client.&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt;  &lt;span style="color:#000000;"&gt;     &lt;span style="font-family: Times New Roman;"&gt;     &lt;b&gt;            &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;  &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question: &lt;/b&gt;&lt;span style="font-family: Times New Roman;"&gt;What     are all the different scope values for the &lt;jsp:usebean&gt; tag?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:#000000;"&gt;&lt;b&gt;Answer:&lt;/b&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family: Times New Roman;"&gt;&lt;jsp:usebean&gt;     tag is used to use any java object in the jsp page. Here are the scope     values for &lt;jsp:usebean&gt; tag:&lt;br /&gt;    a) page&lt;br /&gt;    b) request&lt;br /&gt;    c) session and&lt;br /&gt;    d) application&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;       &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question: &lt;/b&gt;&lt;span style="font-family: Times New Roman;"&gt;What     is JSP Output Comments?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; JSP Output Comments are the comments that can be viewed in     the HTML source file.&lt;br /&gt;    Example:&lt;br /&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Times New Roman;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;!--     This file displays the user login screen --&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;    and&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;!-- This page was loaded on&lt;br /&gt; &lt;%= (new java.util.Date()).toLocaleString() %&gt; --&gt;&lt;br /&gt;       &lt;/span&gt;&lt;/span&gt; &lt;/p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question: &lt;/b&gt;What is expression in JSP?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; Expression tag is used to insert Java values directly into     the output. Syntax for the Expression tag is:&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="font-family: Times New Roman;"&gt;&lt;%= expression %&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;An expression tag contains a scripting language expression that is evaluated, converted to a String, and inserted where the expression appears in the JSP file. The following expression tag displays time on the output:&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="font-family: Times New Roman;"&gt;&lt;%=new     java.util.Date()%&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question: &lt;/b&gt;What types of comments are     available in the JSP?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; There are two types of comments are allowed in the JSP. These     are &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;i&gt;hidden&lt;/i&gt; &lt;/span&gt;&lt;span style="color:#000000;"&gt;and     &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;i&gt;output&lt;/i&gt; &lt;/span&gt;&lt;span style="color:#000000;"&gt;comments.     A hidden comments does not appear in the generated output in the html, while     output comments appear in the generated output.&lt;br /&gt;    Example of hidden comment:&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;%-- This is hidden comment --%&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;    Example of output comment:&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;!-- This is output comment --&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question: &lt;/b&gt;What is JSP declaration?&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Answer:&lt;/b&gt; JSP Decleratives are the JSP tag used to declare variables.     Declaratives are enclosed in the &lt;%! %&gt; tag and ends in semi-colon.     You declare variables and functions in the declaration tag and can use     anywhere in the JSP. Here is the example of declaratives:&lt;br /&gt;    &lt;/span&gt;     &lt;p&gt;&lt;span style="font-size:85%;color:#ff0000;"&gt;&lt;%@page contentType="text/html"     %&gt;&lt;/span&gt;     &lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;html&gt;&lt;/span&gt;&lt;/p&gt;     &lt;p&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;body&gt;&lt;/span&gt;&lt;/p&gt;     &lt;p&gt;&lt;span style="font-size:85%;color:#ff0000;"&gt;&lt;%!&lt;br /&gt;    int cnt=0;&lt;br /&gt;    private int getCount(){&lt;br /&gt;    //increment cnt and return the value&lt;br /&gt;    cnt++;&lt;br /&gt;    return cnt;&lt;br /&gt;    }&lt;br /&gt;    %&gt;&lt;/span&gt;&lt;/p&gt;     &lt;p&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;p&gt;Values of Cnt are:&lt;/p&gt;&lt;/span&gt;&lt;/p&gt;     &lt;p&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;p&gt;&lt;/span&gt;&lt;span style="font-size:85%;color:#ff0000;"&gt;&lt;%=getCount()%&gt;&lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;/p&gt;&lt;/span&gt;&lt;/p&gt;     &lt;p&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;/body&gt;&lt;/span&gt;&lt;/p&gt;     &lt;p&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;/html&gt;&lt;br /&gt;         &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question: &lt;/b&gt;What is JSP Scriptlet?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; JSP Scriptlet is jsp tag which is used to enclose java code     in the JSP pages. Scriptlets begins with &lt;b&gt;&lt;% &lt;/b&gt;tag and ends with&lt;b&gt;     %&gt; &lt;/b&gt;tag. Java code written inside scriptlet executes every time the     JSP is invoked.&lt;br /&gt;    Example:&lt;br /&gt;    &lt;span style="color:#ff0000;"&gt;  &lt;%&lt;br /&gt;      //java codes&lt;br /&gt;       String userName=null;&lt;br /&gt;       userName=request.getParameter("userName");&lt;br /&gt;       %&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;&gt;&lt;br /&gt;        &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question: &lt;/b&gt;What are the life-cycle methods of JSP?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  Life-cycle methods of the JSP are:&lt;br /&gt;    a) &lt;b&gt;jspInit()&lt;/b&gt;: The container calls the jspInit() to initialize the     servlet instance. It is called before any other method, and is called only     once for a servlet instance.&lt;br /&gt;    b)&lt;b&gt;_jspService(): &lt;/b&gt;The container calls the _jspservice() for each     request and it passes the request and the response objects. _jspService()     method cann't be overridden.&lt;br /&gt;    c) &lt;b&gt;jspDestroy(): &lt;/b&gt;The container calls this when its instance is about     to destroyed.&lt;br /&gt;    The jspInit() and jspDestroy() methods can be overridden within a JSP page.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align="center"&gt;           &lt;span style="color:#000000;"&gt;           &lt;a href="http://www.roseindia.net/interviewquestions/struts-interviewquestion-1.shtml"&gt;&lt;img src="http://www.roseindia.net/images/previous.gif" border="0" /&gt;&lt;/a&gt;                    &lt;a href="http://www.roseindia.net/interviewquestions/index.shtml"&gt;&lt;img src="http://www.roseindia.net/images/bt_home.gif" border="0" /&gt;&lt;/a&gt;                    &lt;a href="http://www.roseindia.net/interviewquestions/jsp-interview-questions2.shtml"&gt;&lt;img src="http://www.roseindia.net/images/next.gif" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;h1 align="left"&gt;JSP Interview Questions -2&lt;/h1&gt;&lt;br /&gt;&lt;p align="center"&gt;           &lt;span style="color:#000000;"&gt;           &lt;a href="http://www.roseindia.net/interviewquestions/jsp-interview-questions.shtml"&gt;&lt;img src="http://www.roseindia.net/images/previous.gif" border="0" /&gt;&lt;/a&gt;                    &lt;a href="http://www.roseindia.net/interviewquestions/index.shtml"&gt;&lt;img src="http://www.roseindia.net/images/bt_home.gif" border="0" /&gt;&lt;/a&gt;                    &lt;a href="http://www.roseindia.net/interviewquestions/j2ee-interview-questions.shtml"&gt;&lt;img src="http://www.roseindia.net/images/next.gif" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p&gt;&lt;span style="color:#000000;"&gt;Page of the JSP Interview Questions.&lt;/span&gt;&lt;/p&gt; &lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What is JSP Custom tags?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;   JSP Custom tags are user defined JSP language element. JSP     custom tags are user defined tags that can encapsulate common functionality.     For example you can write your own tag to access the database and performing     database operations. You can also write custom tag for &lt;span name="intelliTxt" id="intelliTxt"&gt;encapsulate     both simple and complex behaviors in an easy to use syntax and greatly     simplify the readability of JSP pages.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt; &lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What is JSP?&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Answer:&lt;/b&gt;  JavaServer Pages (JSP) technology is the Java platform     technology for delivering dynamic content to web clients in a portable,     secure and well-defined way. The JavaServer Pages specification extends the     Java Servlet API to provide web application developers&lt;/span&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What is the role of JSP in MVC Model?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; JSP is mostly used to develop the user interface, It plays are role of View in the MVC Model.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What do you understand by context initialization parameters?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; The context-param element contains the declaration of a web application's servlet context initialization parameters.&lt;br /&gt;&lt;context-param&gt;&lt;br /&gt;    &lt;param-name&gt;name&lt;/param-name&gt;&lt;br /&gt;    &lt;param-value&gt;value&lt;/param-value&gt;&lt;br /&gt;&lt;/context-param&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;The Context Parameters page lets you manage parameters that are accessed through the ServletContext.getInitParameterNames and ServletContext.getInitParameter methods.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; Can you extend JSP technology?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; JSP technology lets the programmer to extend the jsp to make the programming more easier. JSP can be extended and custom actions and tag libraries can be developed.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What do you understand by JSP translation?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; JSP translators generate standard Java code for a JSP page implementation class. This class is essentially a servlet class wrapped with features for JSP functionality.&lt;/span&gt;&lt;/p&gt; &lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What you can stop the browser to cash your page?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; Instead of deleting a cache, you can force the browser not to catch the page.&lt;br /&gt;&lt;%&lt;br /&gt;          response.setHeader("pragma","no-cache");//HTTP 1.1&lt;br /&gt;          response.setHeader("Cache-Control","no-cache");&lt;br /&gt;          response.setHeader("Cache-Control","no-store");&lt;br /&gt;          response.addDateHeader("Expires", -1);&lt;br /&gt;          response.setDateHeader("max-age", 0);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;           //response.setIntHeader ("Expires", -1); //prevents caching at the proxy server&lt;br /&gt;          response.addHeader("cache-Control", "private");&lt;br /&gt;&lt;br /&gt;        %&gt;&lt;br /&gt;put the above code in your page.&lt;/span&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What you will handle the runtime exception in your jsp page?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; The &lt;b&gt; errorPage&lt;/b&gt; attribute of the page directive can be used to catch run-time exceptions automatically and then forwarded to an error processing page. &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="color:#000000;"&gt; For example:&lt;br /&gt;&lt;%@ page errorPage="customerror.jsp" %&gt;&lt;br /&gt;above code forwards the request to "customerror.jsp"  page if an uncaught exception is encountered during request processing. Within "customerror.jsp", you must indicate that it is an error-processing page, via the directive: &lt;%@ page isErrorPage="true" %&gt;.&lt;/span&gt;&lt;/p&gt; &lt;p&gt; &lt;/p&gt;        &lt;p align="center"&gt;           &lt;span style="color:#000000;"&gt;           &lt;a href="http://www.roseindia.net/interviewquestions/jsp-interview-questions.shtml"&gt;&lt;img src="http://www.roseindia.net/images/previous.gif" border="0" /&gt;&lt;/a&gt;                    &lt;a href="http://www.roseindia.net/interviewquestions/index.shtml"&gt;&lt;img src="http://www.roseindia.net/images/bt_home.gif" border="0" /&gt;&lt;/a&gt;                    &lt;a href="http://www.roseindia.net/interviewquestions/j2ee-interview-questions.shtml"&gt;&lt;img src="http://www.roseindia.net/images/next.gif" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;h1 align="left"&gt;J2EE Interview Questions&lt;/h1&gt;&lt;br /&gt;&lt;p align="center"&gt;           &lt;span style="color:#000000;"&gt;           &lt;a href="http://www.roseindia.net/interviewquestions/jsp-interview-questions2.shtml"&gt;&lt;img src="http://www.roseindia.net/images/previous.gif" border="0" /&gt;&lt;/a&gt;                    &lt;a href="http://www.roseindia.net/interviewquestions/index.shtml"&gt;&lt;img src="http://www.roseindia.net/images/bt_home.gif" border="0" /&gt;&lt;/a&gt;                    &lt;a href="http://www.roseindia.net/interviewquestions/j2ee-interview-questions-2.shtml"&gt;&lt;img src="http://www.roseindia.net/images/next.gif" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;    &lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What is J2EE?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; J2EE Stands for Java 2 Enterprise Edition. J2EE is an environment for developing and deploying enterprise     applications. J2EE specification is defined by Sun Microsystems Inc. The J2EE platform     is one of the best platform for the development and deployment of enterprise     applications. The J2EE platform is consists of a set of services, application programming interfaces (APIs), and protocols,     which provides the functionality necessary for developing multi-tiered, web-based applications.     You can download the J2EE SDK and development tools from &lt;a href="http://java.sun.com/"&gt;http://java.sun.com/&lt;/a&gt;.&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000000;"&gt; What     do you understand by a J2EE module?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; A J2EE module is a software unit that consists of one or more J2EE components of the same container type     along with one deployment descriptor of that type. J2EE specification     defines four types of modules:&lt;br /&gt;    a) EJB&lt;br /&gt;    b) Web&lt;br /&gt;    c) application client and&lt;br /&gt;    d) resource adapter&lt;br /&gt;      &lt;br /&gt;    In the J2EE applications modules can be deployed as stand-alone units. Modules     can also be assembled into J2EE applications.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000000;"&gt; Tell     me something about J2EE component?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; J2EE component is&lt;/span&gt; &lt;span style="color:#000000;"&gt;a     self-contained functional software unit supported by a &lt;a href="http://java.sun.com/j2ee/1.4/docs/glossary.html#88608" target="_blank"&gt;container&lt;/a&gt;     and configurable at deployment time. The J2EE specification defines the     following J2EE components:&lt;/span&gt;     &lt;/p&gt;&lt;ul&gt;&lt;a name="114209"&gt;&lt;/a&gt;&lt;li&gt;&lt;span style="color:#000000;"&gt;&lt;a href="http://java.sun.com/j2ee/1.4/docs/glossary.html#108715" target="_blank"&gt;Application         clients&lt;/a&gt; and &lt;a href="http://java.sun.com/j2ee/1.4/docs/glossary.html#88499" target="_blank"&gt;applets&lt;/a&gt;         are components that run on the client.&lt;br /&gt;        &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000000;"&gt;Java servlet and JavaServer Pages (JSP)         technology components are &lt;a href="http://java.sun.com/j2ee/1.4/docs/glossary.html#89333" target="_blank"&gt;Web         components&lt;/a&gt; that run on the server.&lt;br /&gt;        &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000000;"&gt;Enterprise JavaBeans (EJB) components (&lt;a href="http://java.sun.com/j2ee/1.4/docs/glossary.html#109200" target="_blank"&gt;enterprise         beans&lt;/a&gt;) are business components that run on the server. &lt;/span&gt;&lt;span style="color:#000000;"&gt;J2EE components are written in the Java             programming language and are compiled in the same way as any program             in the language. The difference between J2EE components and "standard" Java classes is that J2EE components are             assembled into a J2EE application, verified to be well formed and in             compliance with the J2EE specification, and deployed to production,             where they are run and managed by the J2EE server or client             container.&lt;/span&gt;         &lt;dl&gt;&lt;dt&gt;&lt;span style="color:#000000;"&gt;Source: &lt;a href="http://java.sun.com/j2ee/1.4/docs/glossary.html" target="_blank"&gt;J2EE v1.4 Glossar&lt;/a&gt;&lt;/span&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000000;"&gt; What     are the contents of web module?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; A web module may contain:&lt;br /&gt;    a) JSP files&lt;br /&gt;    b) Java classes&lt;br /&gt;    c) gif and html files and&lt;br /&gt;    d) web component deployment descriptors&lt;br /&gt;      &lt;/span&gt; &lt;p&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000000;"&gt;     Differentiate between .ear,  .jar and .war files.&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; These files are simply zipped file using java jar tool. These     files are created for different purposes. Here is the description of these     files:&lt;br /&gt;    &lt;b&gt;.jar files:&lt;/b&gt; These files are with the .jar extenstion. The .jar files     contains the libraries, resources and accessories files like property files.&lt;br /&gt;    &lt;b&gt;.war files:&lt;/b&gt; These files are with the .war extension. The war file     contains the web application that can be deployed on the any servlet/jsp     container. The .war file contains jsp, html, javascript and other files for     necessary for the development of web applications.&lt;br /&gt;    &lt;b&gt;.ear files:&lt;/b&gt; The .ear file contains the EJB modules of the     application.&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000000;"&gt;     What is the difference between Session Bean and Entity Bean?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  &lt;/span&gt;&lt;br /&gt;    &lt;span style="color:#000000;"&gt;&lt;b&gt;Session Bean:&lt;/b&gt; Session is one of the EJBs and it represents a single client inside the Application Server. Stateless session is easy to develop and its efficient. As compare to entity beans session beans require few server resources.&lt;br /&gt;   &lt;br /&gt;A session bean is similar to an interactive session and is not shared; it can have only one client, in the same way that an interactive session can have only one user. A session bean is not persistent and it is destroyed once the session terminates.&lt;br /&gt;     &lt;br /&gt;    &lt;b&gt;Entity Bean:&lt;/b&gt; An entity bean represents persistent global data from the     database. Entity beans data are stored into database.&lt;br /&gt;        &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000000;"&gt; Why     J2EE is suitable for the development distributed multi-tiered enterprise     applications?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; The J2EE platform consists of multi-tiered distributed application model.     J2EE applications allows the developers to design and implement the business     logic into components according to business requirement. J2EE architecture     allows the development of multi-tired applications and the developed     applications can be installed on different machines depending on the tier in the     multi-tiered J2EE environment . The J2EE application parts are:&lt;br /&gt;   &lt;br /&gt;    a) Client-tier components run on the client machine.&lt;br /&gt;    b) Web-tier components run on the J2EE server.&lt;br /&gt;    c) Business-tier components run on the J2EE server and the&lt;br /&gt;    d) Enterprise information system (EIS)-tier software runs on the EIS servers&lt;br /&gt;        &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000000;"&gt; Why do     understand by a container?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt; Normally, thin-client multi-tiered applications are hard to write because they involve many lines of intricate code to handle transaction and state management, multithreading, resource pooling, and other complex low-level details. The component-based and platform-independent J2EE architecture makes J2EE applications easy to write because business logic is organized into reusable components. In addition, the J2EE server provides &lt;b&gt; underlying services in the form of a container&lt;/b&gt; for every component type. Because you do not have to develop these services yourself, you are free to concentrate on solving the business problem at hand (Source: &lt;a href="http://java.sun.com/j2ee/1.3/docs/tutorial/doc/Overview4.html"&gt;http://java.sun.com/j2ee/1.3/docs/tutorial/doc/Overview4.html&lt;/a&gt;     ).&lt;br /&gt;   &lt;br /&gt;In short containers are the interface between a component and the low-level platform specific functionality that supports the component. The application like Web, enterprise bean, or application client component must be assembled and deployed on the J2EE container before executing.&lt;br /&gt;      &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000000;"&gt; What     are the services provided by a container?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  The services provided by container are as follows:&lt;br /&gt;    a) Transaction management for the bean&lt;br /&gt;    b) Security for the bean&lt;br /&gt;    c) Persistence of the bean&lt;br /&gt;    d) Remote access to the bean&lt;br /&gt;    e) Lifecycle management of the bean&lt;br /&gt;    f) Database-connection pooling&lt;br /&gt;    g) Instance pooling for the bean&lt;br /&gt;       &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000000;"&gt; What     are types of J2EE clients?&lt;br /&gt;    &lt;b&gt;Answer:&lt;/b&gt;  J2EE clients are the software that access the services     components installed on the J2EE container. Following are the J2EE clients:&lt;br /&gt;    a) Applets&lt;br /&gt;    b) Java-Web Start clients&lt;br /&gt;    c) Wireless clients&lt;br /&gt;    d) Web applications&lt;br /&gt;       &lt;/span&gt;      &lt;/p&gt;&lt;p align="center"&gt;           &lt;span style="color:#000000;"&gt;           &lt;a href="http://www.roseindia.net/interviewquestions/jsp-interview-questions2.shtml"&gt;&lt;img src="http://www.roseindia.net/images/previous.gif" border="0" /&gt;&lt;/a&gt;                    &lt;a href="http://www.roseindia.net/interviewquestions/index.shtml"&gt;&lt;img src="http://www.roseindia.net/images/bt_home.gif" border="0" /&gt;&lt;/a&gt;                    &lt;a href="http://www.roseindia.net/interviewquestions/j2ee-interview-questions-2.shtml"&gt;&lt;img src="http://www.roseindia.net/images/next.gif" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Question:&lt;/b&gt; What is Deployment Descriptor?&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; A deployment descriptor is simply an XML(Extensible Markup Language) file with the extension of .xml. Deployment descriptor describes the component deployment settings. Application servers reads the deployment descriptor to deploy the components contained in the deployment unit. For example ejb-jar.xml file is used to describe the setting of the EJBs.&lt;br /&gt;   &lt;/span&gt; &lt;b&gt;&lt;span style="color:#000000;"&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000000;"&gt; What do you understand by JTA and JTS?&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;b&gt;Answer:&lt;/b&gt; JTA stands for Java Transaction API and JTS stands for Java Transaction Service. JTA provides a standard interface which allows the developers to demarcate transactions in a manner that is independent of the transaction manager implementation. The J2EE SDK uses the JTA transaction manager to implement the  transaction. The code developed by developers does not calls the JTS methods directly, but only invokes the JTA methods. Then JTA internally invokes the JTS routines. JTA is a high level transaction interface used by the application code to control the transaction.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000000;"&gt; What is JAXP?&lt;br /&gt;      &lt;b&gt;Answer:&lt;/b&gt; The Java API for XML Processing (JAXP) enables applications to parse and transform XML documents independent of a particular XML processing implementation. JAXP or Java API for XML Parsing is an optional API provided by Javasoft. It provides basic functionality for reading, manipulating, and generating XML documents through pure Java APIs. It is a thin and lightweight API that provides a standard way to seamlessly integrate any XML-compliant parser with a Java application.&lt;br /&gt;  More at &lt;a href="http://java.sun.com/xml/" target="_blank"&gt;http://java.sun.com/xml/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000000;"&gt; What is J2EE Connector architecture?&lt;br /&gt;      &lt;b&gt;Answer:&lt;/b&gt; J2EE Connector Architecture (JCA) is a Java-based technology solution for connecting application servers and enterprise information systems (EIS) as part of enterprise application integration (EAI) solutions. While JDBC is specifically used to connect Java EE applications to databases, JCA is a more generic architecture for connection to legacy systems (including databases). JCA was developed under the Java Community Process as JSR 16 (JCA 1.0) and JSR 112 (JCA 1.5). As of 2006, the current version of JCA is version 1.5. &lt;/span&gt;&lt;span style="color:#000000;"&gt;The J2EE Connector API is used by J2EE tools developers and system integrators to create resource adapters. Home page for J2EE Connector architecture &lt;a href="http://java.sun.com/j2ee/connector/" target="_blank"&gt;http://java.sun.com/j2ee/connector/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#000000;"&gt;What is difference between Java Bean and Enterprise Java Bean?&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;      &lt;b&gt;Answer:&lt;/b&gt; Java Bean as is a plain java class with member variables and getter setter methods. Java Beans are defined under JavaBeans specification as Java-Based software component model which includes the features like introspection, customization,  events,  properties and  persistence.&lt;br /&gt;Enterprise JavaBeans or EJBs for short are Java-based software components that comply with Java's  EJB specification. EJBs are delpoyed on the EJB container and executes in the EJB container. EJB is not that simple,  it is used for building distributed applications. Examples of EJB are Session Bean, Entity Bean and Message Driven Bean. EJB is used for server side programming whereas java bean is a client side. Bean is only development but the EJB is developed and then deploy on EJB Container.&lt;br /&gt;   &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000000;"&gt; What is the difference between JTS and JTA?&lt;br /&gt;      &lt;b&gt;Answer:&lt;/b&gt; In any J2EE application &lt;/span&gt;&lt;span style="color:#000000;"&gt;transaction management is one of the most crucial requirements of the application. Given the complexity of today's business requirements, transaction processing occupies one of the most complex segments of enterprise level distributed applications to build, deploy and maintain.  JTS specifies the implementation of a Java transaction manager. JTS specifies the implementation of a Transaction Manager which supports the Java Transaction API (JTA) 1.0 This transaction manager supports the JTA, using which application servers can be built to support transactional Java applications. Internally the JTS implements the Java mapping of the OMG OTS 1.1 specifications. The Java mapping is specified in two packages: org.omg.CosTransactions and org.omg.CosTSPortability. The JTS thus provides a new architecture for transactional application servers and applications, while complying to the OMG OTS 1.1 interfaces internally. This allows the JTA compliant applications to interoperate with other OTS 1.1 complaint applications through the standard IIOP. Java-based applications and Java-based application servers access transaction management functionality via the JTA interfaces. The JTA interacts with a transaction management implementation via JTS. Similarly, the JTS can access resources via the JTA XA interfaces or can access OTS-enabled non-XA resources. JTS implementations can interoperate via CORBA OTS interfaces.&lt;br /&gt;     &lt;br /&gt;The JTA specifies an architecture for building transactional application servers and defines a set of interfaces for various components of this architecture. The components are: the application, resource managers, and the application server. The JTA specifies standard interfaces for Java-based applications and application servers to interact with transactions, transaction managers, and resource managers JTA transaction management provides a set of interfaces utilized by an application server to manage the beginning and completion of transactions. Transaction synchronization and propagation services are also provided under the domain of transaction management.&lt;br /&gt; &lt;br /&gt;In the Java transaction model, the Java application components can conduct transactional operations on JTA compliant resources via the JTS. The JTS acts as a layer over the OTS. The applications can therefore initiate global transactions to include other OTS transaction managers, or participate in global transactions initiated by other OTS compliant transaction managers.&lt;br /&gt;   &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000000;"&gt; Can Entity Beans have no create() methods?&lt;br /&gt;      &lt;b&gt;Answer:&lt;/b&gt; &lt;/span&gt;&lt;span style="color:#000000;"&gt;Entity Beans can have no create() methods. Entity Beans have no create() method, when entity bean is not used to store the data in the database. In this case entity bean is used to retrieve the data from database.&lt;br /&gt;  &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000000;"&gt; What are the call back methods in Session bean?&lt;br /&gt;      &lt;b&gt;Answer:&lt;/b&gt; &lt;/span&gt;&lt;span style="color:#000000;"&gt;Callback methods are called by the container to notify the important events to the beans in its life cycle&lt;/span&gt;&lt;span style="color:#000000;"&gt;.  The callback methods are defined in the javax.ejb.EntityBean interface.The callback methods example are ejbCreate(), ejbPassivate(), and ejbActivate().&lt;br /&gt;  &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000000;"&gt; What is bean managed transaction?&lt;br /&gt;      &lt;b&gt;Answer:&lt;/b&gt; &lt;/span&gt;&lt;span style="color:#000000;"&gt;In EJB transactions can be maintained by the container or developer can write own code to maintain the transaction. &lt;/span&gt;&lt;span style="color:#000000;"&gt;If a developer doesn’t want a Container to manage transactions, developer can write own code to maintain the database transaction.&lt;br /&gt;   &lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Question:&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000000;"&gt; What are transaction isolation levels in EJB?&lt;br /&gt;      &lt;b&gt;Answer:&lt;/b&gt; Thre are four levels of transaction isolation are:&lt;br /&gt;  * Uncommitted Read&lt;br /&gt;  * Committed Read&lt;br /&gt;  * Repeatable Read&lt;br /&gt;  * Serializable&lt;br /&gt;  &lt;/span&gt;&lt;span style="color:#000000;"&gt;The four transaction isolation levels and the corresponding behaviors are described below:&lt;br /&gt;  &lt;/span&gt; &lt;table border="1" cellpadding="0" cellspacing="0" width="537"&gt;   &lt;tbody&gt;     &lt;tr valign="top"&gt;       &lt;td width="147"&gt;&lt;p class="Body"&gt;&lt;span class="GUI"&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Isolation Level&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width="88"&gt;&lt;p class="Body"&gt;&lt;span class="GUI"&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Dirty Read&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width="179"&gt;&lt;p class="Body"&gt;&lt;span class="GUI"&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Non-Repeatable Read&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width="113"&gt;&lt;p class="Body"&gt;&lt;span class="GUI"&gt;&lt;b&gt;&lt;span style="color:#000000;"&gt;Phantom Read&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr valign="top"&gt;       &lt;td width="147"&gt;&lt;p class="Body"&gt;&lt;span style="font-style: normal; font-weight: bold; text-decoration: none; text-transform: none; vertical-align: baseline;"&gt;&lt;span style="color:#000000;"&gt;Read Uncommitted&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width="88"&gt;&lt;p class="Body"&gt;&lt;span style="color:#000000;"&gt;Possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width="179"&gt;&lt;p class="Body"&gt;&lt;span style="color:#000000;"&gt;Possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width="113"&gt;&lt;p class="Body"&gt;&lt;span style="color:#000000;"&gt;Possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr valign="top"&gt;       &lt;td width="147"&gt;&lt;p class="Body"&gt;&lt;span style="font-style: normal; font-weight: bold; text-decoration: none; text-transform: none; vertical-align: baseline;"&gt;&lt;span style="color:#000000;"&gt;Read Committed&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width="88"&gt;&lt;p class="Body"&gt;&lt;span style="color:#000000;"&gt;Not possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width="179"&gt;&lt;p class="Body"&gt;&lt;span style="color:#000000;"&gt;Possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width="113"&gt;&lt;p class="Body"&gt;&lt;span style="color:#000000;"&gt;Possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr valign="top"&gt;       &lt;td width="147"&gt;&lt;p class="Body"&gt;&lt;span style="font-style: normal; font-weight: bold; text-decoration: none; text-transform: none; vertical-align: baseline;"&gt;&lt;span style="color:#000000;"&gt;Repeatable Read&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width="88"&gt;&lt;p class="Body"&gt;&lt;span style="color:#000000;"&gt;Not possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width="179"&gt;&lt;p class="Body"&gt;&lt;span style="color:#000000;"&gt;Not possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width="113"&gt;&lt;p class="Body"&gt;&lt;span style="color:#000000;"&gt;Possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr valign="top"&gt;       &lt;td width="147"&gt;&lt;p class="Body"&gt;&lt;span style="font-style: normal; font-weight: bold; text-decoration: none; text-transform: none; vertical-align: baseline;"&gt;&lt;span style="color:#000000;"&gt;Serializable&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width="88"&gt;&lt;p class="Body"&gt;&lt;span style="color:#000000;"&gt;Not possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width="179"&gt;&lt;p class="Body"&gt;&lt;span style="color:#000000;"&gt;Not possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;       &lt;td width="113"&gt;&lt;p class="Body"&gt;&lt;span style="color:#000000;"&gt;Not possible&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt; &lt;/table&gt;  &lt;/p&gt;&lt;p align="center"&gt; &lt;span style="color:#000000;"&gt; &lt;a href="http://www.roseindia.net/interviewquestions/jsp-interview-questions.shtml"&gt;&lt;img src="http://www.roseindia.net/images/previous.gif" border="0" /&gt;&lt;/a&gt;                &lt;a href="http://www.roseindia.net/interviewquestions/index.shtml"&gt;&lt;img src="http://www.roseindia.net/images/bt_home.gif" border="0" /&gt;&lt;/a&gt;          &lt;a href="http://www.roseindia.net/interviewquestions/index.shtml"&gt;&lt;img src="http://www.roseindia.net/images/next.gif" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;                 &lt;!-- Bottom --&gt;            &lt;h3 class="formtitle"&gt;&lt;br /&gt;&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="center"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;         &lt;/p&gt;&lt;br /&gt;&lt;p&gt; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;&lt;/span&gt;     &lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;************************************************************************************&lt;br /&gt;Here we are.. this time with a small Java tip.. being Java fans..we just cant wait to post on Java. So, decided to start of with something which most of us might not be aware of.&lt;br /&gt;&lt;br /&gt;You can write a runnable Java program which does not have main method at all. This can be done using the static block of the class.&lt;br /&gt;&lt;br /&gt;The reason this works is that static initialization blocks get executed as soon as the class is loaded, even before the main method is called. During run time JVM will search for the main method after exiting from this block. If it does not find the main method, it throws an exception. To avoid the exception System.exit(0); statement is used which terminates the program at the end of the static block itself.&lt;br /&gt;&lt;br /&gt;class MainMethodNot&lt;br /&gt;{&lt;br /&gt;static&lt;br /&gt;{&lt;br /&gt;System.out.println(“This java program has run without the main method”);&lt;br /&gt;System.exit(0);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/664651663704607214-1253644019974666235?l=vindeshmohariya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/uWOsiXxvwG2UsA-t6QkQJpDo3kw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uWOsiXxvwG2UsA-t6QkQJpDo3kw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/uWOsiXxvwG2UsA-t6QkQJpDo3kw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uWOsiXxvwG2UsA-t6QkQJpDo3kw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnTechnicalSkills/~4/eSvET9Jy9p4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://vindeshmohariya.blogspot.com/feeds/1253644019974666235/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=664651663704607214&amp;postID=1253644019974666235" title="7 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/1253644019974666235?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/1253644019974666235?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnTechnicalSkills/~3/eSvET9Jy9p4/core-java-interview-questions.html" title="Core Java Interview Questions" /><author><name>vini@riya</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>7</thr:total><feedburner:origLink>http://vindeshmohariya.blogspot.com/2007/04/core-java-interview-questions.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C04DR3gycCp7ImA9WBFWEUo.&quot;"><id>tag:blogger.com,1999:blog-664651663704607214.post-3892700784250057526</id><published>2007-03-29T05:23:00.000-07:00</published><updated>2007-03-29T05:39:36.698-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-03-29T05:39:36.698-07:00</app:edited><title>DataBase Questions For Interview?</title><content type="html">&lt;p&gt;&lt;span style="font-weight: bold;"&gt;What is SQL?&lt;/span&gt;&lt;br /&gt;SQL stands for ‘Structured Query Language‘.&lt;/p&gt;   &lt;p&gt;&lt;span style="font-weight: bold;"&gt;What is SELECT statement?&lt;/span&gt;&lt;br /&gt;The &lt;span class="caps"&gt;SELECT&lt;/span&gt; statement lets you select a set of values from a table in a database. The values selected from the database table would depend on the various conditions that are specified in the &lt;span class="caps"&gt;SQL&lt;/span&gt; query.&lt;/p&gt;   &lt;p&gt;&lt;span style="font-weight: bold;"&gt;How can you compare a part of the name rather than the entire name?&lt;/span&gt;&lt;br /&gt;SELECT * &lt;span class="caps"&gt;FROM&lt;/span&gt; people &lt;span class="caps"&gt;WHERE&lt;/span&gt; empname &lt;span class="caps"&gt;LIKE &lt;/span&gt;‘%ab%‘&lt;br /&gt;&lt;/p&gt;&lt;p&gt;would return a recordset with records consisting empname the sequence ‘ab‘ in empname.&lt;/p&gt;   &lt;p&gt;&lt;span style="font-weight: bold;"&gt;What is the INSERT statement? &lt;/span&gt;&lt;br /&gt;The &lt;span class="caps"&gt;INSERT&lt;/span&gt; statement lets you insert information into a database.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;-&gt;&lt;span class="caps"&gt;INSERT INTO EMP &lt;/span&gt;(empname, age, city) &lt;span class="caps"&gt;VALUES &lt;/span&gt;(?VINDESH?, 25, ?INDORE?);&lt;/p&gt;   &lt;p&gt;&lt;span style="font-weight: bold;"&gt;How do you delete a record from a database?&lt;/span&gt;&lt;br /&gt;Use the &lt;span class="caps"&gt;DELETE&lt;/span&gt; statement to remove records or any particular column values from a database.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Example: &lt;span class="caps"&gt;DELETE FROM &lt;/span&gt;?EMPNAME? &lt;span class="caps"&gt;WHERE&lt;/span&gt; id=420;&lt;/p&gt;   &lt;p&gt;&lt;span style="font-weight: bold;"&gt;How could I get distinct entries from a table?&lt;/span&gt;&lt;br /&gt;The &lt;span class="caps"&gt;SELECT&lt;/span&gt; statement in conjunction with &lt;span class="caps"&gt;DISTINCT&lt;/span&gt; lets you select a set of distinct values from a table in a database. The values selected from the database table would of course depend on the various conditions that are specified in the &lt;span class="caps"&gt;SQL&lt;/span&gt; query.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Example: &lt;span class="caps"&gt;SELECT DISTINCT&lt;/span&gt; empname &lt;span class="caps"&gt;FROM&lt;/span&gt; emptable&lt;/p&gt;   &lt;p&gt;&lt;span style="font-weight: bold;"&gt;How to get the results of a Query sorted in any order?&lt;/span&gt;&lt;br /&gt;You can sort the results and return the sorted results to your program by using &lt;span class="caps"&gt;ORDER BY&lt;/span&gt; keyword thus saving you the pain of carrying out the sorting yourself. The &lt;span class="caps"&gt;ORDER BY&lt;/span&gt; keyword is used for sorting.&lt;br /&gt;&lt;br /&gt;Example: &lt;span class="caps"&gt;SELECT&lt;/span&gt; empname, age, city &lt;span class="caps"&gt;FROM&lt;/span&gt; emptable &lt;span class="caps"&gt;ORDER BY&lt;/span&gt; empname&lt;/p&gt;   &lt;p&gt;&lt;span style="font-weight: bold;"&gt;How can I find the total number of records in a table?&lt;/span&gt;&lt;br /&gt;You could use the &lt;span class="caps"&gt;COUNT&lt;/span&gt; keyword, example&lt;/p&gt;   &lt;p&gt;SELECT COUNT(*) FROM emp WHERE age&gt;40&lt;/p&gt;   &lt;p&gt;&lt;span style="font-weight: bold;"&gt;What is GROUP BY?&lt;/span&gt;&lt;br /&gt;The &lt;span class="caps"&gt;GROUP BY&lt;/span&gt; keywords has been added to &lt;span class="caps"&gt;SQL&lt;/span&gt; because aggregate functions (like &lt;span class="caps"&gt;SUM&lt;/span&gt;) return the aggregate of all column values every time they are called. Without the &lt;span class="caps"&gt;GROUP BY&lt;/span&gt; functionality, finding the sum for each individual group of column values was not possible.&lt;/p&gt;   &lt;p&gt;&lt;span style="font-weight: bold;"&gt;What is the difference among "dropping a table", "truncating a table" and "deleting all records" from a table?&lt;/span&gt;&lt;br /&gt;Dropping :  (Table structure  + Data are deleted), Invalidates the dependent objects ,Drops the indexes&lt;br /&gt;&lt;br /&gt;Truncating:  (Data alone deleted), Performs an automatic commit, Faster than delete&lt;br /&gt;&lt;br /&gt;Delete : (Data alone deleted), Doesn?t perform automatic commit&lt;/p&gt;   &lt;p&gt;&lt;span style="font-weight: bold;"&gt;What are the Large object types suported by Oracle?&lt;/span&gt;&lt;br /&gt;Blob and Clob.&lt;/p&gt;   &lt;p&gt;&lt;span style="font-weight: bold;"&gt;Difference between a "where" clause and a "having" clause ?&lt;/span&gt;&lt;br /&gt;Having clause is used only with group functions whereas Where is not used with.&lt;/p&gt;   &lt;p&gt;&lt;span style="font-weight: bold;"&gt;What's the difference between a primary key and a unique key?&lt;/span&gt;&lt;br /&gt;Both primary key and unique enforce uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a nonclustered index by default. Another major difference is that, primary key doesn‘t allow &lt;span class="caps"&gt;NUL&lt;/span&gt;Ls, but unique key allows one &lt;span class="caps"&gt;NULL&lt;/span&gt; only.&lt;/p&gt;   &lt;p&gt;&lt;span style="font-weight: bold;"&gt;What are cursors? Explain different types of cursors. What are the disadvantages of cursors? How can you avoid cursors?&lt;/span&gt;&lt;br /&gt;Cursors allow row-by-row processing of the resultsets.&lt;/p&gt;   &lt;p&gt;Types of cursors: Static, Dynamic, Forward-only, Keyset-driven. See books online for more information.&lt;/p&gt;   &lt;p&gt;Disadvantages of cursors: Each time you fetch a row from the cursor, it results in a network roundtrip; where as a normal SELECT query makes only one roundtrip, however large the resultset is. Cursors are also costly because they require more resources and temporary storage (results in more IO operations). Further, there are restrictions on the SELECT statements that can be used with some types of cursors.&lt;/p&gt;   &lt;p&gt;Most of the times, set based operations can be used instead of cursors.&lt;/p&gt;   &lt;p&gt;&lt;span style="font-weight: bold;"&gt;What are triggers? How to invoke a trigger on demand?&lt;/span&gt;&lt;br /&gt;Triggers are special kind of stored procedures that get executed automatically when an &lt;span class="caps"&gt;INSERT&lt;/span&gt;, UPDATE or &lt;span class="caps"&gt;DELETE&lt;/span&gt; operation takes place on a table.&lt;br /&gt;&lt;br /&gt;Triggers can‘t be invoked on demand. They get triggered only when an associated action (INSERT, &lt;span class="caps"&gt;UPDATE&lt;/span&gt;, and &lt;span class="caps"&gt;DELETE&lt;/span&gt;) happens on the table on which they are defined.&lt;br /&gt;&lt;br /&gt;Triggers are generally used to implement business rules, auditing. Triggers can also be used to extend the referential integrity checks, but wherever possible, use constraints for this purpose, instead of triggers, as constraints are much faster.&lt;/p&gt;   &lt;p&gt;&lt;span style="font-weight: bold;"&gt;What is a join and explain different types of joins?&lt;/span&gt;&lt;br /&gt;Joins are used in queries to explain how different tables are related. Joins also let you select data from a table depending upon data from another table.&lt;br /&gt;&lt;br /&gt;Types of joins: &lt;span class="caps"&gt;INNER JOI&lt;/span&gt;Ns, &lt;span class="caps"&gt;OUTER JOI&lt;/span&gt;Ns, &lt;span class="caps"&gt;CROSS JOI&lt;/span&gt;Ns. &lt;span class="caps"&gt;OUTER JOI&lt;/span&gt;Ns are further classified as &lt;span class="caps"&gt;LEFT OUTER JOINS&lt;/span&gt;, RIGHT &lt;span class="caps"&gt;OUTER JOINS&lt;/span&gt; and &lt;span class="caps"&gt;FULL OUTER JOINS&lt;/span&gt;.&lt;/p&gt;   &lt;p&gt;&lt;span style="font-weight: bold;"&gt;What is a self join?&lt;/span&gt;&lt;br /&gt;Self join is just like any other join, except that two instances of the same table will be joined in the query.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/664651663704607214-3892700784250057526?l=vindeshmohariya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/IXbhJ5I--tKq6Tq8NJR7z1i10_A/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IXbhJ5I--tKq6Tq8NJR7z1i10_A/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/IXbhJ5I--tKq6Tq8NJR7z1i10_A/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IXbhJ5I--tKq6Tq8NJR7z1i10_A/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnTechnicalSkills/~4/UbJ-RhABUlQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://vindeshmohariya.blogspot.com/feeds/3892700784250057526/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=664651663704607214&amp;postID=3892700784250057526" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/3892700784250057526?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/3892700784250057526?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnTechnicalSkills/~3/UbJ-RhABUlQ/database-questions-for-interview.html" title="DataBase Questions For Interview?" /><author><name>vini@riya</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://vindeshmohariya.blogspot.com/2007/03/database-questions-for-interview.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkEFSX8zeCp7ImA9WBFWEUo.&quot;"><id>tag:blogger.com,1999:blog-664651663704607214.post-1844698968584823680</id><published>2007-03-29T05:09:00.000-07:00</published><updated>2007-03-29T05:16:58.180-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-03-29T05:16:58.180-07:00</app:edited><title>OOPS-Object Oriented programming?</title><content type="html">&lt;p&gt;&lt;span style="font-weight: bold;"&gt;What is OOPS?&lt;/span&gt;&lt;br /&gt;OOP is the common abbreviation for Object-Oriented Programming.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; Describe the principles of &lt;/span&gt;&lt;span style="font-weight: bold;" class="caps"&gt;OOPS&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;?&lt;/span&gt;&lt;br /&gt;There are three main principals of oops which are called Polymorphism, Inheritance and Encapsulation.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; Explain the Encapsulation principle?&lt;/span&gt;&lt;br /&gt;Encapsulation is a process of binding or wrapping the data and the codes that operates on the data into a single entity. This keeps the data safe from outside interface and misuse. One way to think ab…&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; Explain the Inheritance principle?  &lt;/span&gt;&lt;br /&gt;Inheritance is the process by which one object acquires the properties of another object.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; Explain the Polymorphism principle?&lt;/span&gt;&lt;br /&gt;The meaning of Polymorphism is something like one name many forms. Polymorphism enables one entity to be used as general category for different types of actions. The specific action is determined b…&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; Explain the different forms of Polymorphism?&lt;/span&gt;&lt;br /&gt;From a practical programming viewpoint, polymorphism exists in three distinct forms in Java:&lt;br /&gt;&lt;br /&gt;Method overloading&lt;br /&gt;&lt;br /&gt;Method overriding through inheritance&lt;br /&gt;&lt;br /&gt;Method overriding through the Java int…&lt;/p&gt;   &lt;p&gt;Ans-2: The ability of a superclass reference to denote object of its own class and its subclasses at runtime is called polymorphism.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; What is Class?&lt;/span&gt;&lt;br /&gt;PHP: A class is a collection of variables and functions working with these variables.&lt;/p&gt;   &lt;p&gt;JAVA: A class denotes a category of objects, and acts as a blueprint for creating such objects. A class models an abstraction by defining the properties and behaviors for the objects representing the abstraction. The properties of an object of a class are called attributes, and are defined by field in java. A field in a class definition is a variable which can store a value that represents a particular property. The behavior of an objects of a class are also known as operations, and are defined using methods in java. Fields and methods in a class definition are collectively called members.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; What is method overriding? &lt;/span&gt;&lt;br /&gt;Same signature (i.e. method name &amp; parameters) and the same return type this is called method overriding.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; What is method overloading?&lt;/span&gt;&lt;br /&gt;The method names are same, but the parameter list must be different. (Parameter must diff. in type, order &amp;amp; number) return type is not a part of the signature.&lt;/p&gt;&lt;p&gt;More Info: &lt;a href="http://www.jroller.com/page/love1c/"&gt;http://www.jroller.com/page/love1c/&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/664651663704607214-1844698968584823680?l=vindeshmohariya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/OuzDRmJG6I5AjinGA9V-30wKslc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OuzDRmJG6I5AjinGA9V-30wKslc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/OuzDRmJG6I5AjinGA9V-30wKslc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OuzDRmJG6I5AjinGA9V-30wKslc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnTechnicalSkills/~4/a5fwpA3ekuE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://vindeshmohariya.blogspot.com/feeds/1844698968584823680/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=664651663704607214&amp;postID=1844698968584823680" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/1844698968584823680?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/1844698968584823680?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnTechnicalSkills/~3/a5fwpA3ekuE/oops-object-oriented-programming.html" title="OOPS-Object Oriented programming?" /><author><name>vini@riya</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://vindeshmohariya.blogspot.com/2007/03/oops-object-oriented-programming.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkEDRHc8fCp7ImA9WBFRFE8.&quot;"><id>tag:blogger.com,1999:blog-664651663704607214.post-6402455966622606036</id><published>2007-02-25T08:22:00.000-08:00</published><updated>2007-02-25T08:24:35.974-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-02-25T08:24:35.974-08:00</app:edited><title>Stupidity</title><content type="html">&lt;a title="Click for further information about this quotation" href="http://www.quotationspage.com/quote/9.html"&gt;Only two things are infinite, the universe and human stupidity, &lt;/a&gt;&lt;a title="Click for further information about this quotation" href="http://www.quotationspage.com/quote/9.html"&gt;and I'm not sure about the former.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/664651663704607214-6402455966622606036?l=vindeshmohariya.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/D-9osdrnQ72lhArrFbdxBBRiPjk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/D-9osdrnQ72lhArrFbdxBBRiPjk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/D-9osdrnQ72lhArrFbdxBBRiPjk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/D-9osdrnQ72lhArrFbdxBBRiPjk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/LearnTechnicalSkills/~4/UEdceYukOdY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://vindeshmohariya.blogspot.com/feeds/6402455966622606036/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=664651663704607214&amp;postID=6402455966622606036" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/6402455966622606036?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/664651663704607214/posts/default/6402455966622606036?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/LearnTechnicalSkills/~3/UEdceYukOdY/stupidity.html" title="Stupidity" /><author><name>vini@riya</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://vindeshmohariya.blogspot.com/2007/02/stupidity.html</feedburner:origLink></entry></feed>

