<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"><channel><title>Java Specialization Topics</title><description></description><managingEditor>noreply@blogger.com (Yash Vysya)</managingEditor><pubDate>Sat, 31 Aug 2024 17:01:23 +0530</pubDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">20</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">25</openSearch:itemsPerPage><link>http://javaspecialization.blogspot.com/</link><language>en-us</language><itunes:explicit>yes</itunes:explicit><itunes:subtitle/><itunes:category text="Technology"><itunes:category text="Software How-To"/></itunes:category><itunes:owner><itunes:email>noreply@blogger.com</itunes:email></itunes:owner><item><title>Dojo Tutorials and Examples</title><link>http://javaspecialization.blogspot.com/2009/09/dojo-tutorials-and-examples.html</link><category>Dojo Ajax</category><author>noreply@blogger.com (Yash Vysya)</author><pubDate>Wed, 16 Sep 2009 12:50:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8981950642035125982.post-5352773640313999124</guid><description>&lt;span style="color:#000080;"&gt;&lt;b&gt;&lt;u&gt;&lt;div align="center"&gt;Dojo Tutorials and Examples&lt;/div&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;

&lt;span style="color:#000000;"&gt;&lt;div align="justify"&gt;Dojo is another great framework for developing ajax based applications. Dojo is selected by Struts 2 for providing ajax support in applications. Dojo is one of the most powerful language for constructing rich internet applications. In this Dojo tutorials you will find everything about Dojo.&lt;/div&gt;&lt;/span&gt;

&lt;span style="color:#000000;"&gt;&lt;div align="justify"&gt;Learn Dojo in detail from the following Dojo Tutorials.&lt;/div&gt;&lt;/span&gt;

&lt;b&gt;&lt;span style="color:#800000;"&gt;1. About Dojo Tutorial&lt;/span&gt;&lt;/b&gt;


In this tutorial, you will learn everything about the dojo. After completing the tutorial you will be able to develop good applications using Dojo framework.

This advanced Dojo tutorial covers:
&lt;ul&gt;
   &lt;li&gt; Introduction to DOJO&lt;/li&gt;
   &lt;li&gt; Dojo Events&lt;/li&gt;
   &lt;li&gt; Dojo Widgets&lt;/li&gt;
   &lt;li&gt; Dojo Effects&lt;/li&gt;
   &lt;li&gt; Dojo Vector Graphics&lt;/li&gt;
   &lt;li&gt; Dojo accessibility&lt;/li&gt;
   &lt;li&gt; Dojo local storage&lt;/li&gt;
   &lt;li&gt; Dojo DOM&lt;/li&gt;
   &lt;li&gt; Dojo HTML and CSS&lt;/li&gt;
   &lt;li&gt; Dojo Ajax Functions&lt;/li&gt;
   &lt;li&gt; Dojo Comet&lt;/li&gt;
   &lt;li&gt; Extending Dojo&lt;/li&gt;
   &lt;li&gt; Debugging Dojo applications&lt;/li&gt;
   &lt;li&gt; Digit toolkit&lt;/li&gt;
&lt;/ul&gt;
&lt;span style="color:#000000;"&gt;&lt;div align="justify"&gt;Our Dojo tutorial will also explain you the steps necessary to start developing and testing the example using Dojo framework. We will also explain you the Dojo framework structure, development and testing process.
Dojo is actually based on JavaScript and HTML, so its easy to learn. You can learn Dojo very fast and start developing your next highly interactive web applications.&lt;/div&gt;&lt;/span&gt;

&lt;span style="color:#000000;"&gt;&lt;div align="justify"&gt;In the next section we will introduce you with the Dojo framework. Get ready to learn Dojo in detail.
 &lt;/div&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>XML Topics</title><link>http://javaspecialization.blogspot.com/2009/09/xml.html</link><category>XML</category><author>noreply@blogger.com (Yash Vysya)</author><pubDate>Tue, 8 Sep 2009 16:41:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8981950642035125982.post-238068647434428465</guid><description>&lt;div align="left"&gt;&lt;font color="#000080"&gt;&lt;b&gt;1) Explain and describe about XML?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div align="left"&gt;XML is defined as an extensible markup language because it gives the user to define his own elements. It facilitates transfer and sharing of structure data across various platforms and particularly through internet. It is also used to serialize and encode data.&lt;/div&gt;&lt;br /&gt;
&lt;div align="left"&gt;&lt;font color="#000080"&gt;&lt;b&gt;2) Write about well formed and valid XML documents?&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div align="left"&gt;There are two levels of correctness for an XML document they are&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a) Well formed XML documents&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;b) Correctness document&lt;br /&gt;
A well formed document is one which has appropriate starting and closing tags and it should primarily meet the standards laid out in the XML guidelines. In a well formed document well a conforming parser is not allowed to parse it.
A valid document contain additional rules such as user defined guidelines, XML schema, DTD, Guidelines laid down as per the rules and regulation present in the format. A validating parser is not allowed to parse it.&lt;/div&gt;&lt;br /&gt;
&lt;div align="left"&gt;&lt;font color="#000080"&gt;&lt;b&gt;3) Explain about the DTD features?&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div align="left"&gt;This is the oldest form of format for XML is DTD. The full form for DTD is document type definition and it is inherited from SGML. It can be said that inclusion of DTD has increased the popularity of XML but DTD has its share of limitations.&lt;/div&gt;
&lt;div align="left"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a) DTD does not have features to support new inclusions such as namespaces.&lt;br /&gt;&lt;/div&gt;
&lt;div align="left"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;b) Certain aspects of XML do not correlate with DTD.&lt;br /&gt;&lt;/div&gt;
&lt;div align="left"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;c) Due to its inheritance from SGML it uses a non XML syntax.&lt;/div&gt;
&lt;P&gt;
&lt;font color="#000080"&gt;&lt;div align="left"&gt;&lt;b&gt;4) Explain about the techniques for processing XML files?&lt;/b&gt;&lt;/div&gt;&lt;/font&gt;
&lt;div align="left"&gt;There are traditional techniques to process XML files and out of these some of them are.&lt;/div&gt;
&lt;div align="left"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a) Using SAX API and a programming language&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;b) Using DOM API and a programming language&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;c) Using filter and transformation engine&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;d) Data parsing and pull parsing are also used for convenience.&lt;/div&gt;
&lt;P&gt;
&lt;div align="left"&gt;&lt;b&gt;&lt;font color="#000080"&gt;5) State some advantages of XML?&lt;/font&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div align="left"&gt;These are some of the main advantages of XML.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a) XML is text based&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;b) Information written in human language can be understood by XML due to its Unicode structure.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;c) This is used for formatting language and data either offline or online.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;d) It supports most of the documents&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;e) It is platform independent which makes it very easy to use.&lt;br /&gt;&lt;/div&gt;
&lt;P&gt;
&lt;div align="left"&gt;&lt;font color="#000080"&gt;&lt;b&gt;6)  State some disadvantages of XML?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div align="left"&gt;These are some of the disadvantages regarding XML&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a) XML syntax is large when compared to binary representations and is redundant.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;b) Due to redundancy it occupies much higher memory and this increases costs on transmission, storage and processing costs.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;c) Overlapping relationships require extra effort.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;d)  XML namespaces are problematic and namespace support can be difficult to implement in XML.&lt;br /&gt;&lt;/div&gt;
&lt;P&gt;
&lt;div align="left"&gt;&lt;font color="#000080"&gt;&lt;b&gt;7) Explain about XML data binding?&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div align="left"&gt;XML data binding allows the user to access the information in XML format rather than in the format of DOM. Data is referred and stored in the computer memory as an object in the form of an XML document. Some information requires different approach to store it in the format of an object. As the data contains links it is always not easy to preserve the data in the form of an object.&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;&lt;div align="left"&gt;&lt;font color="#000080"&gt;8) Explain about DOM interface?&lt;/font&gt;&lt;/div&gt;&lt;/b&gt;
&lt;div align="left"&gt;DOM interface and its specifications are modulated by world wide consortium. DOM allows the user to transfer the entire content of a document into an object. In DOM the entire package is loaded into the memory and then it is modulated into nodes of tree after which the entire document is converted into an object which makes it easier.&lt;/div&gt;&lt;br /&gt;
&lt;div align="left"&gt;&lt;font color="#000080"&gt;&lt;b&gt;9) Explain about XML namespaces?&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div align="left"&gt;Namespaces are guided by the guidelines of w3c. These are used to uniquely identify the named elements and attributes of an XML document. As XML supports human interpreted language and structure it is necessary for namespaces to differentiate different elements present in an XML document. It is declared using XML attribute xmlns and the value of it should be Uniform resource identifier.&lt;/div&gt;&lt;br /&gt;
&lt;div align="left"&gt;&lt;font color="#000080"&gt;&lt;b&gt;10)  How do you display XML with XSLT?&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div align="left"&gt;XSLT is the recommended style sheet for XML and it is very popular. To display XML with XSLT one has to convert XML into HTML before displaying it in the browser. Different browsers interpret XSLT in different ways which makes it a necessary to amend changes to XSLT on the server.&lt;/div&gt;
&lt;P&gt;
&lt;div align="left"&gt;&lt;font color="#000080"&gt;&lt;b&gt;11)  State and explain about XML encoding errors?&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div align="left"&gt;When loading an XML document you have two kinds of errors they are&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a) Invalid character found&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;b) Switch from current encoding&lt;br /&gt;
You would obtain an invalid character found error if your XML document contains non ASCII characters. When your document contains ASCII characters make sure that you save the document as ASCII characters with encoding
Switch from current encoding is obtained if your XML was saved as double byte where the actual specification for the document was single byte.&lt;/div&gt;&lt;br /&gt;
&lt;div align="left"&gt;&lt;font color="#000080"&gt;&lt;b&gt;12)  Describe about the syntax rules which form the XML documents?&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div align="left"&gt;Some of the basic syntax rules which are to be implemented are&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1) XML documents should have a root element&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2) They should have a closing tag&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3) Make sure that you type exact case, as these documents are case sensitive.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4) These elements should be properly nested&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5) Attribute elements must be quoted correctly.&lt;/div&gt;&lt;br /&gt;
&lt;div align="left"&gt;&lt;font color="#000080"&gt;&lt;b&gt;13)  Explain about XQuery?&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div align="left"&gt;Xquery is a useful query language which is designed to query XML data and it is very useful in making changes to query. Its subset is Xpath. This XQuery is formed from the experts of w3c. This facilitates extraction of data from many different databases. This can be rightly said that in future it will be used as SQL.&lt;/div&gt;
&lt;div align="left"&gt;&lt;font color="#000080"&gt;&lt;b&gt;14)  State some features of XQuery.&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div align="left"&gt;Some of the features which are present in XQuery language are as follows: -&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a) Logical and physical data independence&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;b) Declarative&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;c) High level&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;d) Side effect free&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;e) Strongly typed language&lt;/div&gt;&lt;br /&gt;
&lt;div align="left"&gt;&lt;font color="#000080"&gt;&lt;b&gt;15)  Explain about XML signature?&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div align="left"&gt;XML signature is recommended by w3c. It acts as a digital signature for XML documents. This technology is used by various technologies such as SAML, SOAP, etc. You can use this technology whenever you can access a specific XML document in a URL. If the signature is contained outside the document then it is called as a detached signature. When it is contained inside the document then it is called as enveloping signature.&lt;/div&gt;&lt;br /&gt;
&lt;div align="left"&gt;&lt;font color="#000080"&gt;&lt;b&gt;16)  Explain about XML Canonicalization?&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div align="left"&gt;Often it happens that documents are identical in many different ways either logical of statistical. It becomes a major problem when you try to sign a digital signature on two identical documents, to eliminate this problem you have to use Canonicalization which helps people in identifying two similar documents with similar digital signature. Similar documents use Canonicalization to identify similar patterns and signature.&lt;/div&gt;&lt;br /&gt;
&lt;div align="left"&gt;&lt;font color="#000080"&gt;&lt;b&gt;17)  Explain about core validation?&lt;/b&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div align="left"&gt;During the process of XML validation two processes are followed which are
1) Reference validation and
2) Signature validation
Record digest value is used to verify digital signature. In signature validation a process called Canonicalization is used, in this key info is used to verify the signature.&lt;/div&gt;

&lt;script type="text/javascript"&gt;&lt;!--
amazon_ad_tag="javaspecializ-20"; 
amazon_ad_width="728"; 
amazon_ad_height="90"; 
amazon_color_background="EFEFCC"; 
amazon_color_border="A43907"; 
amazon_color_logo="FFFFFF"; 
amazon_color_link="A43907"; 
amazon_ad_logo="hide"; 
amazon_ad_title="My Associates Store"; //--&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="http://www.assoc-amazon.com/s/asw.js"&gt;&lt;/script&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Spring Framework</title><link>http://javaspecialization.blogspot.com/2009/09/spring-framework.html</link><category>Spring Framework</category><author>noreply@blogger.com (Yash Vysya)</author><pubDate>Mon, 7 Sep 2009 17:16:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8981950642035125982.post-1101294642334353421</guid><description>&lt;P&gt;

&lt;b&gt;&lt;font color="#0000A0"&gt;Q. Explain DI or IOC pattern.&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;
A:  Dependency injection (DI) is a programming design pattern and architectural model, sometimes also referred to as inversion of control or IOC, although technically speaking, dependency injection specifically refers to an implementation of a particular form of IOC. Dependancy Injection describes the situation where one object uses a second object to provide a particular capacity. For example, being passed a database connection as an argument to the constructor instead of creating one internally. The term "Dependency injection" is a misnomer, since it is not a dependency that is injected, rather it is a provider of some capability or resource that is injected. There are three common forms of dependency injection: setter-, constructor- and interface-based injection. Dependency injection is a way to achieve loose coupling. Inversion of control (IOC) relates to the way in which an object obtains references to its dependencies. This is often done by a lookup method. The advantage of inversion of control is that it decouples objects from specific lookup mechanisms and implementations of the objects it depends on. As a result, more flexibility is obtained for production applications as well as for testing.
&lt;P&gt;
&lt;b&gt;&lt;font color="#0000A0"&gt;Q. What are the different IOC containers available?&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;
A. Spring is an IOC container. Other IOC containers are HiveMind, Avalon, PicoContainer.
&lt;P&gt;
&lt;b&gt;&lt;font color="#0000A0"&gt;Q. What are the different types of dependency injection. Explain with examples.&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;
A: There are two types of dependency injection: setter injection and constructor injection.
Setter Injection:  Normally in all the java beans, we will use setter and getter method to set and get the value of property as follows:

&lt;P&gt;
    public class namebean {&lt;br /&gt;
     String      name;  &lt;br /&gt;
     public void setName(String a) {&lt;br /&gt;
        name = a; }&lt;br /&gt;
     public String getName() {&lt;br /&gt;
        return name; }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We will create an instance of the bean 'namebean' (say bean1) and set property as bean1.setName("tom"); Here in setter injection, we will set the property 'name'  in spring configuration file as showm below:&lt;br /&gt;

&lt;p&gt;&lt;&lt;b&gt;bean id="bean1"   class="namebean"&lt;/b&gt;&gt;&lt;br /&gt;
   &lt;&lt;b&gt;property   name="name" &lt;/b&gt;&gt;&lt;br /&gt;
       &lt;&lt;b&gt;value&lt;/b&gt;&gt;tom&lt;&lt;b&gt;/value&lt;/b&gt;&gt;&lt;br /&gt;
   &lt;&lt;b&gt;/property&lt;/b&gt;&gt;&lt;br /&gt;
&lt;&lt;b&gt;/bean&gt;&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;

The subelement &lt;value&gt; sets the 'name' property by calling the set method as setName("tom"); This process is called setter injection.
To set properties that reference other beans &lt;&lt;b&gt;ref&lt;/b&gt;&gt;, subelement of &lt;&lt;b&gt;property&lt;/b&gt;&gt; is used as shown below,
&lt;p&gt; &lt;&lt;b&gt;bean id="bean1"   class="bean1impl"&lt;/b&gt;&gt;&lt;br /&gt;
   &lt;&lt;b&gt;property name="game"&lt;/b&gt;&gt;&lt;br /&gt;
       &lt;&lt;b&gt;ref bean="bean2"/&lt;/b&gt;&gt;&lt;br /&gt;
   &lt;&lt;b&gt;/property&lt;/b&gt;&gt;&lt;br /&gt;
&lt;&lt;b&gt;/bean&lt;/b&gt;&gt;&lt;br /&gt;
&lt;&lt;b&gt;bean id="bean2"   class="bean2impl" /&lt;/b&gt;&gt;&lt;br /&gt;&lt;/p&gt;

Constructor injection:  For constructor injection, we use constructor with parameters as shown below,

&lt;P&gt;
 public class namebean {&lt;br /&gt;
     String name;&lt;br /&gt;
     public namebean(String a) {&lt;br /&gt;
        name = a;&lt;br /&gt;
     }   &lt;br /&gt;
}&lt;br /&gt;

We will set the property 'name' while creating an instance of the bean 'namebean' as &lt;br /&gt;namebean bean1 = new namebean("tom");&lt;br /&gt;

Here we use the &lt;&lt;b&gt;constructor-arg&lt;/b&gt;&gt; element to set the the property by constructor injection as&lt;br /&gt;&lt;br /&gt;
 &lt;&lt;b&gt;bean id="bean1"  class="namebean"&lt;/b&gt;&gt;&lt;br /&gt;
    &lt;&lt;b&gt;constructor-arg&lt;/b&gt;&gt;&lt;br /&gt;
       &lt;&lt;b&gt;value&lt;/b&gt;&gt;My Bean Value&lt;&lt;b&gt;/value&lt;/b&gt;&gt;&lt;br /&gt;
   &lt;&lt;b&gt;/constructor-arg&lt;/b&gt;&gt;&lt;br /&gt;
&lt;&lt;b&gt;/bean&lt;/b&gt;&gt;&lt;br /&gt;

&lt;P&gt;
&lt;b&gt;&lt;font color="#0000A0"&gt;Q. What is spring? What are the various parts of spring framework? What are the different persistence frameworks which could be used with spring?&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;
A. Spring is an open source framework created to address the complexity of enterprise application development. One of the chief advantages of the Spring framework is its layered architecture, which allows you to be selective about which of its components you use while also providing a cohesive framework for J2EE application development. The Spring modules are built on top of the core container, which defines how beans are created, configured, and managed, as shown in the following figure. Each of the modules (or components) that comprise the Spring framework can stand on its own or be implemented jointly with one or more of the others. The functionality of each component is as follows:
&lt;P&gt;
&lt;b&gt;&lt;font color="#800000"&gt;The core container&lt;/font&gt;&lt;/b&gt;: The core container provides the essential functionality of the Spring framework. A primary component of the core container is the BeanFactory, an implementation of the Factory pattern. The BeanFactory applies the Inversion of Control (IOC) pattern to separate an application’s configuration and dependency specification from the actual application code.
&lt;P&gt;
&lt;b&gt;&lt;font color="#800000"&gt;Spring context&lt;/font&gt;&lt;/b&gt;: The Spring context is a configuration file that provides context information to the Spring framework. The Spring context includes enterprise services such as JNDI, EJB, e-mail, internalization, validation, and scheduling functionality.
&lt;P&gt;
&lt;b&gt;&lt;font color="#800000"&gt;Spring AOP&lt;/font&gt;&lt;/b&gt;: The Spring AOP module integrates aspect-oriented programming functionality directly into the Spring framework, through its configuration management feature. As a result you can easily AOP-enable any object managed by the Spring framework. The Spring AOP module provides transaction management services for objects in any Spring-based application. With Spring AOP you can incorporate declarative transaction management into your applications without relying on EJB components.
&lt;P&gt;
&lt;b&gt;&lt;font color="#800000"&gt;Spring DAO&lt;/font&gt;&lt;/b&gt;: The Spring JDBC DAO abstraction layer offers a meaningful exception hierarchy for managing the exception handling and error messages thrown by different database vendors. The exception hierarchy simplifies error handling and greatly reduces the amount of exception code you need to write, such as opening and closing connections. Spring DAO’s JDBC-oriented exceptions comply to its generic DAO exception hierarchy.
&lt;P&gt;
&lt;font color="#800000"&gt;&lt;b&gt;Spring ORM&lt;/b&gt;&lt;/font&gt;: The Spring framework plugs into several ORM frameworks to provide its Object Relational tool, including JDO, Hibernate, and iBatis SQL Maps. All of these comply to Spring’s generic transaction and DAO exception hierarchies.
&lt;P&gt;
&lt;font color="#800000"&gt;&lt;b&gt;Spring Web module&lt;/b&gt;&lt;/font&gt;: The Web context module builds on top of the application context module, providing contexts for Web-based applications. As a result, the Spring framework supports integration with Jakarta Struts. The Web module also eases the tasks of handling multi-part requests and binding request parameters to domain objects.
&lt;P&gt;
&lt;font color="#800000"&gt;&lt;b&gt;Spring MVC framework&lt;/b&gt;&lt;/font&gt;: The Model-View-Controller (MVC) framework is a full-featured MVC implementation for building Web applications. The MVC framework is highly configurable via strategy interfaces and accommodates numerous view technologies including JSP, Velocity, Tiles, iText, and POI.
&lt;P&gt;
&lt;font color="#0000A0"&gt;&lt;b&gt;Q. What is AOP? How does it relate with IOC? What are different tools to utilize AOP?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A:  Aspect-oriented programming, or AOP, is a programming technique that allows programmers to modularize crosscutting concerns, or behavior that cuts across the typical divisions of responsibility, such as logging and transaction management. The core construct of AOP is the aspect, which encapsulates behaviors affecting multiple classes into reusable modules. AOP and IOC are complementary technologies in that both apply a modular approach to complex problems in enterprise application development. In a typical object-oriented development approach you might implement logging functionality by putting logger statements in all your methods and Java classes. In an AOP approach you would instead modularize the logging services and apply them declaratively to the components that required logging. The advantage, of course, is that the Java class doesn't need to know about the existence of the logging service or concern itself with any related code. As a result, application code written using Spring AOP is loosely coupled. The best tool to utilize AOP to its capability is AspectJ. However AspectJ works at he byte code level and you need to use AspectJ compiler to get the aop features built into your compiled code. Nevertheless AOP functionality is fully integrated into the Spring context for transaction management, logging, and various other features.  In general any AOP framework control aspects in three possible ways:

&lt;P&gt;
Joinpoints: Points in a program's execution. For example, joinpoints could define calls to specific methods in a class
Pointcuts: Program constructs to designate joinpoints and collect specific context at those points
Advices: Code that runs upon meeting certain conditions. For example, an advice could log a message before executing a joinpoint&lt;p&gt;&lt;/p&gt;

&lt;font color="#0000A0"&gt;&lt;b&gt;Q. What are the advantages of spring framework?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A. 
Spring has layed architecture. Use what you need and leave you don't need now.
Spring Enables POJO Programming. There is no behind the scene magic here. POJO programming enables continous integration and testability.
Dependency Injection and Inversion of Control Simplifies JDBC (Read the first question.)
Open source and no vendor lock-in.&lt;br /&gt;
&lt;font color="#0000A0"&gt;&lt;b&gt;Q. Can you name a tool which could provide the initial ant files and directory structure for a new spring project.&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A: Appfuse or equinox.
&lt;P&gt;
&lt;font color="#0000A0"&gt;&lt;b&gt;Q. Explain BeanFactory in spring.&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A: Bean factory is an implementation of the factory design pattern and its function is to create and dispense beans. As the bean factory knows about many objects within an application, it is able to create association between collaborating objects as they are instantiated. This removes the burden of configuration from the bean and the client. There are several implementation of BeanFactory. The most useful one is "org.springframework.beans.factory.xml.XmlBeanFactory" It loads its beans based on the definition contained in an XML file. To create an XmlBeanFactory, pass a InputStream to the constructor. The resource will provide the XML to the factory. BeanFactory  factory = new XmlBeanFactory(new FileInputStream("myBean.xml"));
This line tells the bean factory to read the bean definition from the XML file. The bean definition includes the description of beans and their properties. But the bean factory doesn't instantiate the bean yet. To retrieve a bean from a 'BeanFactory', the getBean() method is called. When getBean() method is called, factory will instantiate the bean and begin setting the bean's properties using dependency injection. myBean bean1 = (myBean)factory.getBean("myBean");
&lt;P&gt;
&lt;font color="#0000A0"&gt;&lt;b&gt;Q. Explain the role of ApplicationContext in spring.&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A. While Bean Factory is used for simple applications, the Application Context is spring's more advanced container. Like 'BeanFactory' it can be used to load bean definitions, wire beans together and dispense beans upon request. It also provide

&lt;P&gt;
1) a means for resolving text messages, including support for internationalization.&lt;br /&gt;
2) a generic way to load file resources.&lt;br /&gt;
3) events to beans that are registered as listeners.&lt;br /&gt;

Because of additional functionality, 'Application Context' is preferred over a BeanFactory. Only when the resource is scarce like mobile devices, 'BeanFactory' is used. The three commonly used implementation of 'Application Context' are

&lt;P&gt;
1. &lt;font color="#800000"&gt;&lt;b&gt;ClassPathXmlApplicationContext&lt;/b&gt;&lt;/font&gt; : It Loads  context definition from an XML file located in the classpath, treating context definitions as classpath resources. The application context is loaded from the application's classpath by using the code&lt;br /&gt;
ApplicationContext    context = new ClassPathXmlApplicationContext("bean.xml");&lt;br /&gt;
2. &lt;font color="#800000"&gt;&lt;b&gt;FileSystemXmlApplicationContext&lt;/b&gt;&lt;/font&gt; : It loads context definition from an XML file in the filesystem. The application context is loaded from the file system by using the code&lt;br /&gt;
ApplicationContext    context = new FileSystemXmlApplicationContext("bean.xml");&lt;br /&gt;
3. &lt;font color="#800000"&gt;&lt;b&gt;XmlWebApplicationContext&lt;/b&gt;&lt;/font&gt; : It loads context definition from an XML file contained within a web application.&lt;br /&gt;

&lt;font color="#0000A0"&gt;&lt;b&gt;Q. How does Spring supports DAO in hibernate?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A. Spring’s HibernateDaoSupport class is a convenient super class for Hibernate DAOs. It has handy methods you can call to get a Hibernate Session, or a SessionFactory. The most convenient method is getHibernateTemplate(), which returns a HibernateTemplate. This template wraps Hibernate checked exceptions with runtime exceptions, allowing your DAO interfaces to be Hibernate exception-free.&lt;br /&gt;
Example:&lt;br /&gt;

&lt;P&gt;
public class UserDAOHibernate extends HibernateDaoSupport {&lt;br /&gt;

public User getUser(Long id) {&lt;br /&gt;
return (User) getHibernateTemplate().get(User.class, id);&lt;br /&gt;
}&lt;br /&gt;
public void saveUser(User user) {&lt;br /&gt;
getHibernateTemplate().saveOrUpdate(user);&lt;br /&gt;
if (log.isDebugEnabled()) {&lt;br /&gt;
log.debug(“userId set to: “ + user.getID());&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
public void removeUser(Long id) {&lt;br /&gt;
Object user = getHibernateTemplate().load(User.class, id);&lt;br /&gt;
getHibernateTemplate().delete(user);&lt;br /&gt;
}&lt;br /&gt;

}&lt;br /&gt;

&lt;P&gt;
&lt;font color="#0000A0"&gt;&lt;b&gt;Q. What are the id generator classes in hibernate?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A:  increment: It generates identifiers of type long, short or int that are unique only when no other process is inserting data into the same table. It should not the used in the clustered environment.
&lt;font color="#800000"&gt;&lt;b&gt;identity&lt;/b&gt;&lt;/font&gt;: It supports identity columns in DB2, MySQL, MS SQL Server, Sybase and HypersonicSQL. The returned identifier is of type long, short or int.&lt;br /&gt;
&lt;font color="#800000"&gt;&lt;b&gt;sequence&lt;/b&gt;&lt;/font&gt;: The sequence generator uses a sequence in DB2, PostgreSQL, Oracle, SAP DB, McKoi or a generator in Interbase. The returned identifier is of type long, short or int&lt;br /&gt;
&lt;font color="#800000"&gt;&lt;b&gt;hilo&lt;/b&gt;&lt;/font&gt;: The hilo generator uses a hi/lo algorithm to efficiently generate identifiers of type long, short or int, given a table and column (by default hibernate_unique_key and next_hi respectively) as a source of hi values. The hi/lo algorithm generates identifiers that are unique only for a particular database. Do not use this generator with connections enlisted with JTA or with a user-supplied connection.&lt;br /&gt;
&lt;font color="#800000"&gt;&lt;b&gt;seqhilo&lt;/b&gt;&lt;/font&gt;: The seqhilo generator uses a hi/lo algorithm to efficiently generate identifiers of type long, short or int, given a named database sequence.&lt;br /&gt;
&lt;font color="#800000"&gt;&lt;b&gt;uuid&lt;/b&gt;&lt;/font&gt;: The uuid generator uses a 128-bit UUID algorithm to generate identifiers of type string, unique within a network (the IP address is used). The UUID is encoded as a string of hexadecimal digits of length 32.&lt;br /&gt;
&lt;font color="#800000"&gt;&lt;b&gt;guid&lt;/b&gt;&lt;/font&gt;: It uses a database-generated GUID string on MS SQL Server and MySQL.&lt;br /&gt;
&lt;font color="#800000"&gt;&lt;b&gt;native&lt;/b&gt;&lt;/font&gt;: It picks identity, sequence or hilo depending upon the capabilities of the underlying database.&lt;br /&gt;
&lt;font color="#800000"&gt;&lt;b&gt;assigned&lt;/b&gt;&lt;/font&gt;: lets the application to assign an identifier to the object before save() is called. This is the default strategy if no &lt;generator&gt; element is specified.&lt;br /&gt;
&lt;font color="#800000"&gt;&lt;b&gt;select&lt;/b&gt;&lt;/font&gt;: retrieves a primary key assigned by a database trigger by selecting the row by some unique key and retrieving the primary key value.&lt;br /&gt;
&lt;font color="#800000"&gt;&lt;b&gt;foreign&lt;/b&gt;&lt;/font&gt;: uses the identifier of another associated object. Usually used in conjunction with a &lt;one-to-one&gt; primary key association.&lt;br /&gt;
&lt;P&gt;
&lt;font color="#000080"&gt;&lt;b&gt;Q. How is a typical spring implementation look like?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A. For a typical Spring Application we need the following files

&lt;P&gt;
1. An interface that defines the functions.&lt;br /&gt;
2. An Implementation that contains properties, its setter and getter methods, functions etc.,&lt;br /&gt;
3. A XML file called Spring configuration file.&lt;br /&gt;
4. Client program that uses the function.&lt;br /&gt;
&lt;P&gt;

&lt;font color="#000080"&gt;&lt;b&gt;Q. How do you define hibernate mapping file in spring?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A. Add the hibernate mapping file entry in mapping resource inside Spring’s applicationContext.xml file in the web/WEB-INF directory.

&lt;P&gt;
&lt;&lt;b&gt;property name="mappingResources"&lt;/b&gt;&gt;&lt;br /&gt;
    &lt;&lt;b&gt;list&lt;/b&gt;&gt;&lt;br /&gt;
        &lt;&lt;b&gt;value&lt;/b&gt;&gt;org/appfuse/model/User.hbm.xml&lt;&lt;b&gt;/value&lt;/b&gt;&gt;&lt;br /&gt;
    &lt;&lt;b&gt;/list&lt;/b&gt;&gt;&lt;br /&gt;
&lt;&lt;b&gt;/property&lt;/b&gt;&gt;&lt;br /&gt;

&lt;P&gt;
&lt;font color="#000080"&gt;&lt;b&gt;Q. How do you configure spring in a web application?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A. It is very easy to configure any J2EE-based web application to use Spring. At the very least, you can simply add Spring’s ContextLoaderListener to your web.xml file:

&lt;P&gt;
&lt;&lt;b&gt;listener&lt;/b&gt;&gt;&lt;br /&gt;
    &lt;&lt;b&gt;listener-class&lt;/b&gt;&gt;org.springframework.web.context.ContextLoaderListener&lt;&lt;b&gt;/listener-class&lt;/b&gt;&gt;&lt;br /&gt;
&lt;&lt;b&gt;/listener&lt;/b&gt;&gt;&lt;br /&gt;
&lt;P&gt;

&lt;font color="#000080"&gt;&lt;b&gt;Q. Can you have xyz.xml file instead of applicationcontext.xml?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A. ContextLoaderListener is a ServletContextListener that initializes when your webapp starts up. By default, it looks for Spring’s configuration file at WEB-INF/applicationContext.xml. You can change this default value by specifying a &lt;&lt;b&gt;context-param&lt;/b&gt;&gt; element named “contextConfigLocation.” Example:

&lt;P&gt;
&lt;&lt;b&gt;listener&lt;/b&gt;&gt;&lt;br /&gt;
    &lt;&lt;b&gt;listener-class&lt;/b&gt;&gt;org.springframework.web.context.ContextLoaderListener&lt;br /&gt;

    &lt;&lt;b&gt;context-param&lt;/b&gt;&gt;&lt;br /&gt;
        &lt;&lt;b&gt;param-name&lt;/b&gt;&gt;contextConfigLocation&lt;&lt;b&gt;/param-name&lt;/b&gt;&gt;&lt;br /&gt;
        &lt;&lt;b&gt;param-value&lt;/b&gt;&gt;/WEB-INF/xyz.xml&lt;&lt;b&gt;/param-value&lt;/b&gt;&gt;&lt;br /&gt;
    &lt;&lt;b&gt;/context-param&lt;/b&gt;&gt;&lt;br /&gt;

    &lt;&lt;b&gt;/listener-class&lt;/b&gt;&gt;&lt;br /&gt;
&lt;&lt;b&gt;/listener&lt;/b&gt;&gt;&lt;br /&gt;

&lt;P&gt;

&lt;font color="#000080"&gt;&lt;b&gt;Q. How do you configure your database driver in spring?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A. Using datasource "org.springframework.jdbc.datasource.DriverManagerDataSource".&lt;br /&gt; Example:&lt;br /&gt;

&lt;P&gt;
&lt;&lt;b&gt;bean id&lt;/b&gt;="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;&lt;br /&gt;
    &lt;&lt;b&gt;property name&lt;/b&gt;="driverClassName"&gt;&lt;br /&gt;
        &lt;&lt;b&gt;value&lt;/b&gt;&gt;org.hsqldb.jdbcDriver&lt;&lt;b&gt;/value&lt;/b&gt;&gt;&lt;br /&gt;
    &lt;&lt;b&gt;/property&lt;/b&gt;&gt;&lt;br /&gt;
    &lt;&lt;b&gt;property name&lt;/b&gt;="url"&gt;&lt;br /&gt;
        &lt;&lt;b&gt;value&lt;/b&gt;&gt;jdbc:hsqldb:db/appfuse&lt;&lt;b&gt;/value&lt;/b&gt;&gt;&lt;br /&gt;
    &lt;&lt;b&gt;/property&lt;/b&gt;&gt;&lt;br /&gt;
    &lt;&lt;b&gt;property name=&lt;/b&gt;"username"&gt;&lt;br /&gt;
&lt;&lt;b&gt;value&lt;/b&gt;&gt;sa&lt;&lt;b&gt;/value&lt;/b&gt;&gt;&lt;br /&gt;
&lt;&lt;b&gt;/property&lt;/b&gt;&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
    &lt;&lt;b&gt;property name&lt;/b&gt;="password"&gt;&lt;br /&gt;
&lt;&lt;b&gt;value&lt;/b&gt;&gt;&lt;&lt;b&gt;/value&lt;/b&gt;&gt;&lt;br /&gt;&lt;&lt;b&gt;/property&lt;/b&gt;&gt;&lt;br /&gt;
&lt;&lt;b&gt;/bean&lt;/b&gt;&gt;&lt;br /&gt;

&lt;P&gt;
&lt;font color="#000080"&gt;&lt;b&gt;Q. How can you configure JNDI instead of datasource in spring applicationcontext.xml?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A. Using "org.springframework.jndi.JndiObjectFactoryBean". Example:

&lt;P&gt;
&lt;&lt;b&gt;bean id&lt;/b&gt;="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"&gt;&lt;br /&gt;
    &lt;&lt;b&gt;property name&lt;/b&gt;="jndiName"&gt;&lt;br /&gt;
        &lt;&lt;b&gt;value&lt;/b&gt;&gt;java:comp/env/jdbc/appfuse&lt;&lt;b&gt;/value&lt;/b&gt;&gt;&lt;br /&gt;
    &lt;&lt;b&gt;/property&lt;/b&gt;&gt;&lt;br /&gt;
&lt;&lt;b&gt;/bean&lt;/b&gt;&gt;&lt;br /&gt;
&lt;P&gt;

&lt;font color="#000080"&gt;&lt;b&gt;Q. What are the key benifits of Hibernate?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A:  These are the key benifits of Hibernate:
&lt;P&gt;
Transparent persistence based on POJOs without byte code processing
Powerful object-oriented hibernate query language
Descriptive O/R Mapping through mapping file.&lt;br /&gt;
Automatic primary key generation&lt;br /&gt;
&lt;font color="#800000"&gt;&lt;b&gt;Hibernate cache &lt;/b&gt;&lt;/font&gt;: Session Level, Query and Second level cache.&lt;br /&gt;
&lt;font color="#800000"&gt;&lt;b&gt;Performance&lt;/b&gt;&lt;/font&gt;: Lazy initialization, Outer join fetching, Batch fetching&lt;br /&gt;&lt;p&gt;
&lt;font color="#800000"&gt;&lt;b&gt;Q. What is hibernate session and session factory? How do you configure sessionfactory in spring configuration file?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A. Hibernate Session is the main runtime interface between a Java application and Hibernate. SessionFactory allows applications to create hibernate session by reading hibernate configurations file hibernate.cfg.xml.&lt;br /&gt;

&lt;P&gt;
// Initialize the Hibernate environment&lt;br /&gt;
Configuration cfg = new Configuration().configure();&lt;br /&gt;
// Create the session factory&lt;br /&gt;
SessionFactory factory = cfg.buildSessionFactory();&lt;br /&gt;
// Obtain the new session object&lt;br /&gt;
Session session = factory.openSession();&lt;br /&gt;

The call to Configuration().configure() loads the hibernate.cfg.xml configuration file and initializes the Hibernate environment. Once the configuration is initialized, you can make any additional modifications you desire programmatically. However, you must make these modifications prior to creating the SessionFactory instance. An instance of SessionFactory is typically created once and used to create all sessions related to a given context.&lt;br /&gt;
The main function of the Session is to offer create, read and delete operations for instances of mapped entity classes. Instances may exist in one of three states:

&lt;P&gt;
&lt;font color="#800000"&gt;&lt;b&gt;transient&lt;/b&gt;&lt;/font&gt;: never persistent, not associated with any Session&lt;br /&gt;
&lt;font color="#800000"&gt;&lt;b&gt;persistent&lt;/b&gt;&lt;/font&gt;: associated with a unique Session&lt;br /&gt;
&lt;font color="#800000"&gt;&lt;b&gt;detached&lt;/b&gt;&lt;/font&gt;: previously persistent, not associated with any Session&lt;br /&gt;

A Hibernate Session object represents a single unit-of-work for a given data store and is opened by a SessionFactory instance. You must close Sessions when all work for a transaction is completed. The following illustrates a typical Hibernate session:&lt;br /&gt;
Session session = null;&lt;br /&gt;
UserInfo user = null;&lt;br /&gt;
Transaction tx = null;&lt;br /&gt;
try {&lt;br /&gt;
   session = factory.openSession();&lt;br /&gt;
   tx = session.beginTransaction();&lt;br /&gt;
   user = (UserInfo)session.load(UserInfo.class, id);&lt;br /&gt;
   tx.commit();&lt;br /&gt;
} catch(Exception e) {&lt;br /&gt;
   if (tx != null) {&lt;br /&gt;
      try {&lt;br /&gt;
         tx.rollback();&lt;br /&gt;
      } catch (HibernateException e1) {&lt;br /&gt;
         throw new DAOException(e1.toString()); }&lt;br /&gt;
   } throw new DAOException(e.toString());&lt;br /&gt;
} finally {&lt;br /&gt;
   if (session != null) {&lt;br /&gt;
      try {&lt;br /&gt;
         session.close();&lt;br /&gt;
      } catch (HibernateException e) { }&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;P&gt;
&lt;b&gt;&lt;font color="#0000FF"&gt;Q. What is the difference between hibernate get and load methods?&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;
A. The load() method is older; get() was added to Hibernate’s API due to user request. The difference is trivial:&lt;br /&gt;
The following Hibernate code snippet retrieves a User object from the database: &lt;br /&gt; User user = (User) session.get(User.class, userID);&lt;br /&gt;
The get() method is special because the identifier uniquely identifies a single instance of a class. Hence it’s common for applications to use the identifier as a convenient handle to a persistent object. Retrieval by identifier can use the cache when retrieving an object, avoiding a database hit if the object is already cached.&lt;br /&gt;
Hibernate also provides a load() method: &lt;br /&gt; User user = (User) session.load(User.class, userID);&lt;br /&gt;
If load() can’t find the object in the cache or database, an exception is thrown. The load() method never returns null. The get() method returns
null if the object can’t be found. The load() method may return a proxy instead of a real persistent instance. A proxy is a placeholder instance of a runtime-generated subclass (through cglib or Javassist) of a mapped persistent class, it can initialize itself if any method is called that is not the mapped database identifier getter-method. On the other hand, get() never returns a proxy. Choosing between get() and load() is easy: If you’re certain the persistent object exists, and nonexistence would be considered exceptional, load() is a good option. If you aren’t certain there is a persistent instance with the given 
identifier, use get() and test the return value to see if it’s null. Using load() has a further implication: The application may retrieve a valid reference (a proxy) to a
persistent instance without hitting the database to retrieve its persistent state. So load() might not throw an exception when it doesn’t find the persistent object
in the cache or database; the exception would be thrown later, when the proxy is accessed. &lt;br /&gt;
&lt;P&gt;
&lt;font color="#0000FF"&gt;&lt;b&gt;Q. What type of transaction management is supported in hibernate?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A. Hibernate communicates with the database via a JDBC Connection; hence it must support both managed and non-managed transactions.
    non-managed in web containers:&lt;br /&gt;

&lt;P&gt;
&lt;&lt;b&gt;bean id&lt;/b&gt;="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager"&gt;&lt;br /&gt;
    &lt;&lt;b&gt;property name&lt;/b&gt;="sessionFactory"&gt;&lt;br /&gt;
        &lt;&lt;b&gt;ref local&lt;/b&gt;="sessionFactory"/&gt;&lt;br /&gt;
    &lt;&lt;b&gt;/property&lt;/b&gt;&gt;&lt;br /&gt;
&lt;&lt;b&gt;/bean&lt;/b&gt;&gt;&lt;br /&gt;

    managed in application server using JTA:&lt;br /&gt;

&lt;P&gt;
&lt;&lt;b&gt;bean id&lt;/b&gt;="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager."&gt;&lt;br /&gt;
    &lt;&lt;b&gt;property name&lt;/b&gt;="sessionFactory"&gt;&lt;br /&gt;
        &lt;&lt;b&gt;ref local&lt;/b&gt;="sessionFactory"/&gt;&lt;br /&gt;
    &lt;&lt;b&gt;/property&lt;/b&gt;&gt;&lt;br /&gt;
&lt;&lt;b&gt;/bean&lt;/b&gt;&gt;&lt;br /&gt;

&lt;P&gt;
&lt;b&gt;&lt;font color="#0000FF"&gt;Q. What is lazy loading and how do you achieve that in hibernate?&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;
A. Lazy setting decides whether to load child objects while loading the Parent Object. You need to specify parent class.Lazy = true in hibernate mapping file. By default the lazy loading of the child objects is true. This make sure that the child objects are not loaded unless they are explicitly invoked in the application by calling getChild() method on parent. In this case hibernate issues a fresh database call to load the child when getChild() is actully called on the Parent object. But in some cases you do need to load the child objects when parent is loaded. Just make the lazy=false and hibernate will load the child when parent is loaded from the database. Examples: Address child of User class can be made lazy if it is not required frequently. But you may need to load the Author object for Book parent whenever you deal with the book for online bookshop.
Hibernate does not support lazy initialization for detached objects. Access to a lazy association outside of the context of an open Hibernate session will result in an exception.
&lt;P&gt;
&lt;font color="#0000FF"&gt;&lt;b&gt;Q. What are the different fetching strategy in Hibernate?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A. Hibernate3 defines the following fetching strategies:

&lt;P&gt;
&lt;font color="#800000"&gt;&lt;b&gt;Join fetching &lt;/b&gt;&lt;/font&gt;- Hibernate retrieves the associated instance or collection in the same SELECT, using an OUTER JOIN.&lt;br /&gt;
&lt;font color="#800000"&gt;&lt;b&gt;Select fetching&lt;/b&gt;&lt;/font&gt; - a second SELECT is used to retrieve the associated entity or collection. Unless you explicitly disable lazy fetching by specifying lazy="false", this second select will only be executed when you actually access the association.&lt;br /&gt;
&lt;font color="#800000"&gt;&lt;b&gt;Subselect fetching &lt;/b&gt;&lt;/font&gt;- a second SELECT is used to retrieve the associated collections for all entities retrieved in a previous query or fetch. Unless you explicitly disable lazy fetching by specifying lazy="false", this second select will only be executed when you actually access the association.&lt;br /&gt;
&lt;font color="#800000"&gt;&lt;b&gt;Batch fetching &lt;/b&gt;&lt;/font&gt;- an optimization strategy for select fetching - Hibernate retrieves a batch of entity instances or collections in a single SELECT, by specifying a list of primary keys or foreign keys.&lt;br /&gt;
For more details read short primer on fetching strategy at &lt;A HREF="http://www.hibernate.org/315.html"&gt;http://www.hibernate.org/315.html&lt;/A&gt;
&lt;br /&gt;
&lt;font color="#0000A0"&gt;&lt;b&gt;Q. What are different types of cache hibernate supports ?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A. Caching is widely used for optimizing database applications. Hibernate uses two different caches for objects: first-level cache and second-level cache. First-level cache is associated with the Session object, while second-level cache is associated with the Session Factory object. By default, Hibernate uses first-level cache on a per-transaction basis. Hibernate uses this cache mainly to reduce the number of SQL queries it needs to generate within a given transaction. For example, if an object is modified several times within the same transaction, Hibernate will generate only one SQL UPDATE statement at the end of the transaction, containing all the modifications. To reduce database traffic, second-level cache keeps loaded objects at the Session Factory level between transactions. These objects are available to the whole application, not just to the user running the query. This way, each time a query returns an object that is already loaded in the cache, one or more database transactions potentially are avoided. In addition, you can use a query-level cache if you need to cache actual query results, rather than just persistent objects. The query cache should always be used in conjunction with the second-level cache. Hibernate supports the following open-source cache implementations out-of-the-box:&lt;br /&gt;

&lt;P&gt;
EHCache is a fast, lightweight, and easy-to-use in-process cache. It supports read-only and read/write caching, and memory- and disk-based caching. However, it does not support clustering.&lt;br /&gt;
OSCache is another open-source caching solution. It is part of a larger package, which also provides caching functionalities for JSP pages or arbitrary objects. It is a powerful and flexible package, which, like EHCache, supports read-only and read/write caching, and memory- and disk-based caching. It also provides basic support for clustering via either JavaGroups or JMS.
SwarmCache is a simple cluster-based caching solution based on JavaGroups. It supports read-only or nonstrict read/write caching (the next section explains this term). This type of cache is appropriate for applications that typically have many more read operations than write operations.
JBoss TreeCache is a powerful replicated (synchronous or asynchronous) and transactional cache. Use this solution if you really need a true transaction-capable caching architecture.&lt;br /&gt;
Commercial Tangosol Coherence cache.&lt;br /&gt;
&lt;font color="#0000A0"&gt;&lt;b&gt;Q. What are the different caching strategies?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A. The following four caching strategies are available:&lt;br /&gt;
&lt;P&gt;
&lt;font color="#800000"&gt;&lt;b&gt;Read-only&lt;/b&gt;&lt;/font&gt;: This strategy is useful for data that is read frequently but never updated. This is by far the simplest and best-performing cache strategy.&lt;br /&gt;
&lt;font color="#800000"&gt;&lt;b&gt;Read/write&lt;/b&gt;&lt;/font&gt;: Read/write caches may be appropriate if your data needs to be updated. They carry more overhead than read-only caches. In non-JTA environments, each transaction should be completed when Session.close() or Session.disconnect() is called.&lt;br /&gt;
&lt;font color="#800000"&gt;&lt;b&gt;Nonstrict read/write&lt;/b&gt;&lt;/font&gt;: This strategy does not guarantee that two transactions won't simultaneously modify the same data. Therefore, it may be most appropriate for data that is read often but only occasionally modified.&lt;br /&gt;
&lt;font color="#800000"&gt;&lt;b&gt;Transactional&lt;/b&gt;&lt;/font&gt;: This is a fully transactional cache that may be used only in a JTA environment.&lt;br /&gt;&lt;br /&gt;
&lt;font color="#000080"&gt;&lt;b&gt;Q. How do you configure 2nd level cach in hibernate?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A. To activate second-level caching, you need to define the hibernate.cache.provider_class property in the hibernate.cfg.xml file as follows:&lt;br /&gt; &lt;&lt;b&gt;hibernate-configuration&lt;/b&gt;&gt;&lt;br /&gt;
    &lt;&lt;b&gt;session-factory&lt;/b&gt;&gt;&lt;br /&gt;
        &lt;&lt;b&gt;property name&lt;/b&gt;="hibernate.cache.provider_class"&gt;org.hibernate.cache.EHCacheProvider&lt;&lt;b&gt;/property&lt;/b&gt;&gt;&lt;br /&gt;
    &lt;&lt;b&gt;/session-factory&lt;/b&gt;&gt;&lt;br /&gt;
&lt;&lt;b&gt;/hibernate-configuration&lt;/b&gt;&gt;&lt;br /&gt;
By default, the second-level cache is activated and uses the EHCache provider.
To use the query cache you must first enable it by setting the property hibernate.cache.use_query_cache to true in hibernate.properties.&lt;br /&gt;

&lt;P&gt;
&lt;b&gt;&lt;font color="#000080"&gt;Q. What is the difference between sorted and ordered collection in hibernate?&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;
A. A sorted collection is sorted in-memory using java comparator, while order collection is ordered at the database level using order by clause.
&lt;br /&gt;
&lt;P&gt;
&lt;b&gt;&lt;font color="#000080"&gt;Q. What are the types of inheritence models and describe how they work like vertical inheritence and horizontal?&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;
A. There are three types of inheritance mapping in hibernate :

&lt;P&gt;
&lt;font color="#800000"&gt;&lt;b&gt;Example: &lt;/b&gt;&lt;/font&gt;Let us take the simple example of 3 java classes. Class Manager and Worker are inherited from Employee Abstract class.&lt;br /&gt;
1. Table per concrete class with unions : In this case there will be 2 tables. Tables: Manager, Worker [all common attributes will be duplicated]&lt;br /&gt;
2. Table per class hierarchy: Single Table can be mapped to a class hierarchy. There will be only one table in database called 'Employee' that will represent all the attributes required for all 3 classes. But it needs some discriminating column to differentiate between Manager and worker;&lt;br /&gt;
3. Table per subclass: In this case there will be 3 tables represent Employee, Manager and Worker&lt;br /&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Ajax Topic 2</title><link>http://javaspecialization.blogspot.com/2009/09/ajax-topic-2.html</link><category>Ajax</category><author>noreply@blogger.com (Yash Vysya)</author><pubDate>Fri, 4 Sep 2009 13:05:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8981950642035125982.post-8816440713983555194</guid><description>&lt;span class="Apple-style-span" style="font-family: 'times new roman'; border-collapse: collapse; "&gt;&lt;p&gt;&lt;span class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Did Adaptive Path invent Ajax? Did Google? Did Adaptive Path help build Google’s Ajax applications?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="for_questions_blue" style="color: rgb(0, 0, 0); text-decoration: none; "&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;Neither Adaptive Path nor Google invented Ajax. Google’s recent products are simply the highest-profile examples of Ajax applications. Adaptive Path was not involved in the development of Google’s Ajax applications, but we have been doing Ajax work for some of our other clients.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"   style="font-family:'Bookman Old Style';font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 14px;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Is it possible to set session variables from javascript?&lt;/span&gt;&lt;span class="style54"&gt; &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="style54"&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:'times new roman';font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 16px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;It's not possible to set any session variables directly from javascript as it is purely a client side technology. You can use AJAX though to asyncronously... &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;

Cannot parse XML generated by JSP I am generating an XML using JSP, when i run the JSP in IE it shows the XML as per DOM, but when i try to parse it using Javascript , the command xmldoc.documentElement... &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;

This is working code I am using, it might help you. if (!isIE) xmldoc = req.responseXML; else { //IE does not take the responseXML as...&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"   style="font-family:'Bookman Old Style';font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 14px;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;b&gt;&lt;span class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;What do I need to know to create my own AJAX functionality?&lt;/span&gt;&lt;span class="style54"&gt; &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="style54"&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;If you plan not to reuse and existing AJAX component here are some of the things you will need to know. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
Plan to learn Dynamic HTML (DHTML), the technology that is the foundation for AJAX. DHTML enables browser-base real time interaction between a user and a web page. DHTML is the combination of JavaScript, the Document Object Model (DOM) and Cascading Style Sheets (CSS).&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* JavaScript - JavaScript is a loosely typed object based scripting language supported by all major browsers and essential for AJAX interactions. JavaScript in a page is called when an event in a page occurs such as a page load, a mouse click, or a key press in a form element.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* DOM - An API for accessing and manipulating structured documents. In most cases DOM represent the structure of XML and HTML documents.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* CSS - Allows you to define the presentation of a page such as fonts, colors, sizes, and positioning. CSS allow for a clear separation of the presentation from the content and may be changed programmatically by JavaScript.
Understanding the basic request/response nature of HTTP is also important. Many subtle bugs can result if you ignore the differences between the GET and OIst methods when configuring an XMLHttpRequest and HTTP response codes when processing callbacks.
JavaScript is the client-side glue, in a sense. JavaScript is used to create the XMLHttpRequest Object and trigger the asynchronous call. JavaScript is used to parse the returned content. JavaScript is used to analyze the returned data and process returned messages. JavaScript is used to inject the new content into the HTML using the DOM API and to modify the CSS.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"   style="font-family:'Bookman Old Style';font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 14px;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;b&gt;&lt;span class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Do I really need to learn JavaScript?&lt;/span&gt; &lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;Basically yes if you plan to develop new AJAX functionality for your web application.
On the other hand, JSF components and component libraries can abstract the details of JavaScript, DOM and CSS. These components can generate the necessary artifacts to make AJAX interactions possible. Visual tools such as Java Studio Creator may also use AJAX enabled JSF components to create applications, shielding the tool developer from many of the details of&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt; AJAX. If you plan to develop your own JSF components or wire the events of components together in a tool it is important that you have a basic understanding of JavaScript. There are client-side JavaScript libraries (discussed below) that you can call from your in page JavaScript that abstract browser differences. Object Hierarchy and Inheritance in JavaScript is a great resource for a Java developer to learn about JavaScript objects. &lt;/span&gt;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"   style="font-family:'Bookman Old Style';font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 14px;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;b&gt;&lt;span class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Do Ajax applications always deliver a better experience than traditional web applications?&lt;/span&gt; &lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;Not necessarily. Ajax gives interaction designers more flexibility. However, the more power we have, the more caution we must use in exercising it. We must be careful to use Ajax to enhance the user experience of our applications, not degrade it.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"   style="font-family:'Bookman Old Style';font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 14px;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;What JavaScript libraries and frameworks are available?&lt;/span&gt;&lt;span class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="for_questions_blue" style="color: rgb(0, 0, 0); text-decoration: none; "&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;There are many libraries/frameworks out there (and many more emerging) that will help abstract such things as all the nasty browser differences. Three good libraries are The Dojo Toolkit, Prototype, and DWR.

&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* The Dojo Toolkit contains APIs and widgets to support the development of rich web applications. Dojo contains an intelligent packaging system, UI effects, drag and drop APIs, widget APIs, event abstraction, client storage APIs, and AJAX interaction APIs. Dojo solves common usability issues such as support for dealing with the navigation such as the ability to detect the browser back button, the ability to support changes to the URL in the URL bar for bookmarking, and the ability to gracefully degrade when AJAX/JavaScript is not fully support on the client. Dojo is the Swiss Army Knife of JavaScript libraries. It provides the widest range of options in a single library and it does a very good job supporting new and older browsers.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* Prototype focuses on AJAX interactions including a JavaScript AJAX object that contains a few objects to do basic tasks such as make a request, update a portion of a document, insert content into a document, and update a portion of a document periodically. Prototype JavaScript library contains a set of JavaScript objects for representing AJAX requests and contains utility functions for accessing in page components and DOM manipulations. Script.aculo.us and Rico are built on top of Prototype and provide UI effects, support for drag and drop, and include common JavaScript centric widgets. If you are just looking to support AJAX interactions and a few basic tasks Prototype is great. If you are looking for UI effects Rico and Script.aculo.us are good options.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* Yahoo UI Library is a utility library and set of widgets using the APIs to support rich clients. The utility library includes support for cross-browser AJAX interactions, animation, DOM scriptging support, drag and drop, and cross browser event support. The Yahoo UI Library is well documnented and contains many examples.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* DWR (Dynamic Web Remoting) is a client-side and server-side framework that focuses on allowing a developer to do RPC calls from client-side JavaScript to plain old Java objects in a Java Enterprise Edition web container. On the server side DWR uses a Servlet to interact with the Java objects and returns object representations of the Java objects or XML documents. DWR will be easy to get up and running and plays well with other Java technologies. If you are looking for a client-side and server-side framework that integrates well use DWR.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* Google Web Toolkit (GWT) is client/server framework provided by Google that allows a developer to write an AJAX application in pure Java. The GWT takes care of the details of generating all the client-side code using a Java-to-JavaScript compiler. One of the key benefits of the GWT Software Developer Kit (SDK) is that it allows you to debug your applications in what is known as GWT hosted mode using an embedded browser (IE on Windows and Mozilla/Gecko on Linux) that is tied to the toolkit. In GWT hosted mode you setup through the code and debug it as it is running on both the client and server. The GWT contains a default set of widgets and widget containers. An application is built by coding a set of widgets and containers together much like would be done in a Swing application. The GWT Software Developer Kit (SDK) is limited to Linux and Windows XP/2000 though the web applications it generates are compatible with the latest generation of the mainstream browsers.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
There are many new and emerging libraries for JavaScript and this list only reviews some of the more common libraries. When making a choice choose the library which suites your needs the best. While it might be better to choose one, there is nothing stopping you from using more than one framework. For a more extensive list of client-side frameworks see: Survey of AJAX/JavaScript Libraries.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"   style="font-family:'Bookman Old Style';font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 14px;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;&lt;b&gt;What is the difference between proxied and proxyless calls? &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="for_questions_blue" style="color: rgb(0, 0, 0); text-decoration: none; "&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; font-weight: 800;"&gt;
&lt;/span&gt;&lt;/span&gt;Proxied calls are made through stub objects that mimic your PHP classes on the JavaScript side. E.g., the helloworld class from the Hello World example.
Proxyless calls are made using utility javascript functions like HTML_AJAX.replace() and HTML_AJAX.append().&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"   style="font-family:'Bookman Old Style';font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 14px;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;b&gt;&lt;span class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Should I use XML or text, JavaScript, or HTML as a return type?&lt;/span&gt;&lt;span class="style54"&gt; &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="style54"&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;It depends. Clearly the 'X' in AJAX stands for XML, but several AJAX proponents are quick to point out that nothing in AJAX, per se, precludes using other types of payload, such as, JavaScript, HTML, or plain text.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;

* XML - Web Services and AJAX seem made for one another. You can use client-side API's for downloading and parsing the XML content from RESTful Web Services. (However be mindful with some SOAP based Web Services architectures the payloads can get quite large and complex, and therefore may be inappropriate with AJAX techniqes.)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* Plain Text - In this case server-generated text may be injected into a document or evaluated by client-side logic.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* JavaScript - This is an extension to the plain text case with the exception that a server-side component passes a fragment of JavaScript including JavaScript object declarations. Using the JavaScript eval() function you can then create the objects on the client. JavaScript Object Notation (JSON), which is a JavaScript object based data exchange specification, relies on this technique. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* HTML - Injecting server-generated HTML fragments directly into a document is generally a very effective AJAX technique. However, it can be complicated keeping the server-side component in sync with what is displayed on the client.

&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
Mashup is a popular term for creating a completely new web application by combining the content from disparate Web Services and other online API's. A good example of a mashup is housingmaps.com which graphically combines housing want-ads from craiglist.org and maps from maps.google.com.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"   style="font-family:'Bookman Old Style';font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 14px;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Ajax Topic 3</title><link>http://javaspecialization.blogspot.com/2009/09/ajax-topic-3.html</link><category>Ajax</category><author>noreply@blogger.com (Yash Vysya)</author><pubDate>Fri, 4 Sep 2009 13:03:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8981950642035125982.post-8335844175494462299</guid><description>&lt;span class="Apple-style-span"  style=" border-collapse: collapse; font-family:'times new roman';"&gt;&lt;p&gt;&lt;span class="Apple-style-span"   style="font-family:'Bookman Old Style';font-size:7;"&gt;&lt;span class="Apple-style-span" style="font-size: 48px;"&gt;&lt;span class="Apple-style-span"  style="font-family:Arial;"&gt;&lt;span class="Apple-style-span" style="font-weight: 900;"&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; font-family: 'Times New Roman'; font-size: 16px; font-weight: normal; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span class="Apple-style-span"   style="font-family:'Bookman Old Style';font-size:7;"&gt;&lt;span class="Apple-style-span"  style="font-family:Arial;"&gt;&lt;div style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; width: auto; font: normal normal normal 100%/normal Georgia, serif; text-align: left; "&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; border-collapse: collapse; "&gt;&lt;p&gt;&lt;span style="color:#0000FF;"&gt;&lt;b&gt;&lt;span class="style54" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt;Are there Usability Issues with AJAX?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#0000FF;"&gt;&lt;b&gt;&lt;span class="style54"&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"    style="font-family:Arial;font-size:130%;color:#000000;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900; "&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;The nature of updating a page dynamically using data retrieved via AJAX interactions and DHTML may result in drastically changing the appearance and state of a page. A user might choose to use the browser's back or forward buttons, bookmark a page, copy the URL from the URL bar and share it with a friend via an email or chat client, or print a page at any given time. When designing an AJAX based application you need to consider what the expected behavior would be in the case of navigation, bookmarking, printing, and browser support as described below.

&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* Navigation - What would be the expected behavior of the back, forward, refresh, and bookmark browser buttons in your application design. While you could implement history manipulation manually it may be easer to use a JavaScript frameworks such as Dojo that provides API's history manipulation and navigation control. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* Bookmarking and URL sharing - Many users want to bookmark or cut and paste the URL from the browser bar. Dojo provides client-side for bookmarking and URL manipulation. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* Printing - In some cases printing dynamically rendered pages can be problematic.
Other considerations as a developer when using AJAX are:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* Browser Support - Not all AJAX/DHTML features are supported on all browsers or all versions of a browser. See quirksmode.org for a list of browser support and possible workarounds.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* JavaScript disabled - You should also consider what happens if the user disables JavaScript. Additionally, there are several legitimate reasons why JavaScript and CSS support may be unavailable on a user's web browser.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* Latency - Keep in mind latency in your design. A running application will be much more responsive than when it is deployed.
Latency problems: myth or reality?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* Accessibility - Guaranteeing your site is accessible to people with disabilities is not only a noble goal, it is also requited by law in many markets. Some marvelous enabling technology is available to help people use the Web in spite of disabilities including visual, auditory, physical, speech, cognitive, and neurological disabilities. With a little forethought, and comprehension of some well documented best practices, you can assure that your application is compatible with that enabling technology. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
Degradability is the term used to describe techniques used by web applications to adapt to the wide range of web browser capabilities. Many AJAX libraries have automatic degradability built in. But if you are coding your own custom AJAX functionality, simply taking some care to follow the best practices promoted by standards bodies like the World Wide Web Consortium (W3C), and grass root movements like the Web Standards community and many others, your application can run usefully on browsers that are incapable of AJAX behaviors. Granted, your application may loose some of the "wow factor" on these less capable browsers, but your application will still be usable. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
Remember to not design with AJAX just for the sake of coolness. The reason you built your application is so people will use it. And people will not use your application if your application is not compatible with their web browser.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"   style="font-family:'Bookman Old Style';font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 14px; "&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Are there any frameworks available to help speedup development with AJAX? &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; "&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;There are several browser-side frameworks available, each with their own uniqueness...&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Is Adaptive Path selling Ajax components or trademarking the name? Where can I download it? &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; "&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;Ajax isn’t something you can download. It’s an approach — a way of thinking about the architecture of web applications using certain technologies. Neither the Ajax name nor the approach are proprietary to Adaptive Path.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"   style="font-family:'Bookman Old Style';font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 14px; "&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Should I use an HTTP GET or POST for my AJAX calls?&lt;/b&gt;&lt;b class="style54" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt; &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900; "&gt;
&lt;/span&gt;&lt;/span&gt;AJAX requests should use an HTTP GET request when retrieving data where the data will not change for a given request URL. An HTTP POST should be used when state is updated on the server. This is in line with HTTP idempotency recommendations and is highly recommended for a consistent web application architecture.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"   style="font-family:'Bookman Old Style';font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 14px; "&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;How do I debug JavaScript? &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; "&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;There are not that many tools out there that will support both client-side and server-side debugging. I am certain this will change as AJAX applications proliferate. I currently do my client-side and server-side debugging separately. Below is some information on the client-side debuggers on some of the commonly used browsers.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;

* Firefox/Mozilla/Netscape - Have a built in debugger Venkman which can be helpful but there is a Firefox add on known as FireBug which provides all the information and AJAX developer would ever need including the ability to inspect the browser DOM, console access to the JavaScript runtime in the browser, and the ability to see the HTTP requests and responses (including those made by an XMLHttpRequest). I tend to develop my applications initially on Firefox using Firebug then venture out to the other browsers.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* Safari - Has a debugger which needs to be enabled. See the Safari FAQ for details.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* Internet Explorer - There is MSDN Documentation on debugging JavaScript. A developer toolbar for Internet Explorer may also be helpful. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;

While debuggers help a common technique knowing as "Alert Debugging" may be used. In this case you place "alert()" function calls inline much like you would a System.out.println. While a little primitive it works for most basic cases. Some frameworks such as Dojo provide APIs for tracking debug statements.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"   style="font-family:'Bookman Old Style';font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 14px; "&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;How do I provide internationalized AJAX interactions?&lt;/b&gt;&lt;b class="style54" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt;&lt;/b&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;&lt;b class="style54" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt; &lt;/b&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900; "&gt;
&lt;/span&gt;&lt;/span&gt;Just because you are using XML does not mean you can properly send and receive localized content using AJAX requests. To provide internationalized AJAX components you need to do the following:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* Set the charset of the page to an encoding that is supported by your target languages. I tend to use UTF-8 because it covers the most languages. The following meta declaration in a HTML/JSP page will set the content type:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;

&lt;meta equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
* In the page JavaScript make sure to encode any parameters sent to the server. JavaScript provides the escape() function which returns Unicode escape strings in which localized text will appear in hexadecimal format. For more details on JavaScript encoding see Comparing escape(), encodeURI(), and encodeURIComponent().&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
* On the server-side component set the character encoding using the HttpServletRequest.setCharacterEncoding() method. Before you access the localized parameter using the HttpServletRequest.getParameter() call. In the case of UTF this would be request.setCharactherEncoding("UTF-8");.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
A server-side component returning AJAX responses needs to set the encoding of the response to the same encoding used in the page.
response.setContentType("text/xml;charset=;UTF-8");
response.getWriter().write(" &lt;response&gt;invalid &lt;/response&gt;");

&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
For more information on using AJAX with Java Enterprise Edition technologies see AJAX and Internationalization and for developing multi-lingual applications see Developing Multilingual Web Applications Using JavaServer Pages Technology.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"   style="font-family:'Bookman Old Style';font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 14px; "&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Some of the Google examples you cite don’t use XML at all. Do I have to use XML and/or XSLT in an Ajax application?&lt;/b&gt;&lt;b class="style54" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt; &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900; "&gt;
&lt;/span&gt;&lt;/span&gt;No. XML is the most fully-developed means of getting data in and out of an Ajax client, but there’s no reason you couldn’t accomplish the same effects using a technology like JavaScript Object Notation or any similar means of structuring data for interchange.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"   style="font-family:'Bookman Old Style';font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 14px; "&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style="color:#0000FF;"&gt;&lt;span class="style54" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt;Are Ajax applications easier to develop than traditional web applications?&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style="color:#0000FF;"&gt;&lt;span class="style54"&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"    style="font-family:Arial;font-size:130%;color:#000000;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900; "&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;Not necessarily. Ajax applications inevitably involve running complex JavaScript code on the client. Making that complex code efficient and bug-free is not a task to be taken lightly, and better development tools and frameworks will be needed to help us meet that challenge.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"   style="font-family:'Bookman Old Style';font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 14px; "&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;When do I use a synchronous versus a asynchronous request? &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; "&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;Good question. They don't call it AJAX for nothing! A synchronous request would block in page event processing and I don't see many use cases where a synchronous request is preferable.&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:'Bookman Old Style';font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 14px;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Ajax Topic 4</title><link>http://javaspecialization.blogspot.com/2009/09/ajax-topic-4.html</link><category>Ajax</category><author>noreply@blogger.com (Yash Vysya)</author><pubDate>Fri, 4 Sep 2009 13:00:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8981950642035125982.post-5740337333875662536</guid><description>&lt;span class="Apple-style-span"  style=" border-collapse: collapse; font-family:'times new roman';"&gt;&lt;p&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:7;"&gt;&lt;span class="Apple-style-span" style="font-size: 48px; font-weight: 900;"&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; font-family: 'Times New Roman'; font-size: 16px; font-weight: normal; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:7;"&gt;&lt;div style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; width: auto; font: normal normal normal 100%/normal Georgia, serif; text-align: left; "&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; border-collapse: collapse; "&gt;&lt;p&gt;&lt;span style="color:#FF0000;"&gt;&lt;b&gt;&lt;span class="style54" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt;How do I handle concurrent AJAX requests?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#FF0000;"&gt;&lt;b&gt;&lt;span class="style54"&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"    style="font-family:Arial;font-size:130%;color:#000000;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900; "&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;With JavaScript you can have more than one AJAX request processing at a single time. In order to insure the proper post processing of code it is recommended that you use JavaScript Closures. The example below shows an XMLHttpRequest object abstracted by a JavaScript object called AJAXInteraction. As arguments you pass in the URL to call and the function to call when the processing is done.
function AJAXInteraction(url, callback) {

var req = init();
req.onreadystatechange = processRequest;

function init() {
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
} else if (window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
&lt;/span&gt;}&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
&lt;/span&gt;}&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;

function processRequest () {
if (req.readyState == 4) {
if (req.status == 200) {
if (callback) callback(req.responseXML);
&lt;/span&gt;}&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
&lt;/span&gt;}&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
&lt;/span&gt;}&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;

this.doGet = function() {
req.open("GET", url, true);
req.send(null);
&lt;/span&gt;}&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;

this.doPost = function(body) {
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "
application/x-www-form-urlencoded");
req.send(body);
&lt;/span&gt;}&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
&lt;/span&gt;}&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;

function makeRequest() {
var ai = new AJAXInteraction("processme",
function() { alert("Doing Post Process");});
ai.doGet();
&lt;/span&gt;}&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;

The function makeRequest() in the example above creates an AJAXInteraction with a URL to of "processme" and an inline function that will show an alert dialog with the message "Doing Post Process". When ai.doGet() is called the AJAX interaction is initiated and when server-side component mapped to the URL "processme" returns a document which is passed to the callback function that was specified when the AJAXInteraction was created.
Using this closures insures that the proper callback function associated with a specific AJAX interaction is called. Caution should still be taken when creating multiple closure objects in that make XmlHttpRequests as to there is a limited number of sockets that are used to make requests at any given time. Because there are limited number of requests that can be made concurrently. Internet Explorer for example only allows for two concurrent AJAX requests at any given time. Other browsers may allow more but it is generally between three and five requests. You may choose to use pool of AJAXInteraction objects.
One thing to note when making multiple AJAX calls from the client is that the calls are not guaranteed to return in any given order. Having closures within the callback of a closure object can be used to ensure dependencies are processed correctly.
There is a discussion titled Ajaxian Fire and Forget Pattern that is helpful. &lt;/span&gt;
&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;What do I do on the server to interact with an AJAX client? &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; "&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;The "Content-Type" header needs to be set to"text/xml". In servlets this may be done using the HttpServletResponse.setContentType()should be set to "text/xml" when the return type is XML. Many XMLHttpRequest implementations will result in an error if the "Content-Type" header is set The code below shows how to set the "Content-Type".

response.setContentType("text/xml");
response.getWriter().write("&lt;response&gt;invalid&lt;/response&gt;");

You may also want to set whether or not to set the caches header for cases such as autocomplete where you may want to notify proxy servers/and browsers not to cache the results.

response.setContentType("text/xml");
response.setHeader("Cache-Control", "no-cache");
response.getWriter().write("&lt;response&gt;invalid&lt;/response&gt;");

Note to the developer: Internet Explorer will automatically use a cached result of any AJAX response from a HTTP GET if this header is not set which can make things difficult for a developer. During development mode you may want set this header. Where do I store state with an AJAX client

As with other browser based web applications you have a few options which include:
* On the client in cookies - The size is limited (generally around 4KB X 20 cookies per domain so a total of 80KB) and the content may not be secure unless encrypted which is difficult but not impossible using JavaScript.
* On the client in the page - This can be done securely but can be problematic and difficult to work with. See my blog entry on Storing State on the Client for more details on this topic.
* On the client file system - This can be done if the client grants access to the browser to write to the local file system. Depending on your uses cases this may be necessary but caution is advised.
* On the Server - This is closer to the traditional model where the client view is of the state on the server. Keeping the data in sync can be a bit problematic and thus we have a solution Refreshing Data on this. As more information processing and control moves to the client where state is stored will need to be re-evaluated. &lt;/span&gt;
&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Whats with the -alpha in the install instructions?&lt;/b&gt;&lt;b class="style54" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt; &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900; "&gt;
&lt;/span&gt;&lt;/span&gt;HTML_AJAX hasn't had a stable release yet and the pear installer doesn't install non stable packages by default unless you specify a version.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;How do I submit a form or a part of a form without a page refresh? &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; "&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;When creating a form make sure that the "form" element "onSubmit" attribute is set to a JavaScript function that returns false.
&lt;form onsubmit="doAJAXSubmit();return false;"&gt;
&lt;input type="text" id="tf1"&gt;
&lt;input type="submit" id="submit1" value="Update"&gt;
&lt;/&gt;

You can also submit data by associating a function with a form button in a similar way.

&lt;form onsubmit="doAJAXSubmit();return false;"&gt;
&lt;input type="text" id="tf1"&gt;
&lt;input type="button" id="button1" onclick="doAJAXSubmit()" value="Update"&gt;
&lt;/&gt;

Note that the form "onSubmit" attribute is still set. If the user hits the enter key in the text field the form will be submitted so you still need to handle that case.
When updating the page it is recommend you wait to make sure that the AJAX update of the form data was successful before updating the data in the page. Otherwise, the data may not properly update and the user may not know. I like to provide an informative message when doing a partial update and upon a successful AJAX interaction I will then update the page.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;How do I test my AJAX code? &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; "&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;There is a port of JUnit for client-side JavaScript called JsUnit&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;What exactly is the W3C DOM? &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; "&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;The W3C Document Object Model (DOM) is defined by the W3C as the following: The Document Object Model is a platform- and language-neutral interface...&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;When will HTML_AJAX have a stable release?&lt;/b&gt;&lt;b class="style54" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt; &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900; "&gt;
&lt;/span&gt;&lt;/span&gt;Once all the major features are complete and the API has been tested, the roadmap gives an idea of whats left to be done.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;What parts of the HTML_AJAX API are stable?&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; "&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;We don't have a list right now, but most of the API is stable as of 0.3.0. There should be no major changes at this point, though there will be lots of new additions.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;What Browsers does HTML_AJAX work with?&lt;/span&gt;&lt;span class="style54" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt; &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="style54" style="color: rgb(0, 0, 0); "&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900; "&gt;
&lt;/span&gt;&lt;/span&gt;As of 0.3.0, all the examples that ship with HTML_AJAX have been verified to work with
* Firefox 1.0+
* Internet Explorer 5.5+ (5.0 should work but it hasn't been tested)
Most things work with
* Safari 2+
* Opera 8.5+&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Ajax Topic 5</title><link>http://javaspecialization.blogspot.com/2009/09/ajax-topic-5.html</link><category>Ajax</category><author>noreply@blogger.com (Yash Vysya)</author><pubDate>Fri, 4 Sep 2009 12:59:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8981950642035125982.post-1621968834846495693</guid><description>&lt;span class="Apple-style-span" style="font-family: 'times new roman'; border-collapse: collapse; "&gt;&lt;p&gt;&lt;span style="color:#0000FF;"&gt;&lt;b&gt;&lt;span class="style53" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt;Is the server or the client in control?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#0000FF;"&gt;&lt;b&gt;&lt;span class="style53"&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"    style="font-family:Arial;font-size:130%;color:#000000;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;It depends. With AJAX the answer is more in between. Control can be more centralized in a server-side component or as a mix of client-side and server-side controllers.

* Centralized server-side controller - When having a more centralized controller the key is to make sure the data in client-side page is in sync with that of the server. Some applications may keep all the state on the server and push all updates to client DOM via a simple JavaScript controller.
* Client and server-side controllers - This architecture would use JavaScript to do all presentation related control, event processing, page manipulation, and rendering of model data on the client. The server-side would be responsible for things such as business logic and pushing updated model data to the client. In this case the server would not have intimate knowledge of the presentation short of the initial page that would be sent to the client page request.

There are some use cases where an entire AJAX application can be written in a single page. Keep in mind if you choose this type of architecture that navigation and bookmarking should be considered.
Both methods are viable depending on what you are trying to accomplish. I tend to prefer spreading the control across the client and server.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Is Ajax just another name for XMLHttpRequest? &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;No. XMLHttpRequest is only part of the Ajax equation. XMLHttpRequest is the technical component that makes the asynchronous server communication possible; Ajax is our name for the overall approach described in the article, which relies not only on XMLHttpRequest, but on CSS, DOM, and other technologies.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;How do I abort the current XMLHttpRequest?&lt;/b&gt;&lt;b class="style53" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt;&lt;/b&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;&lt;b class="style53" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt; &lt;/b&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900;"&gt;
&lt;/span&gt;&lt;/span&gt;Just call the abort() method on the request.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;What is the minimum version of PHP that needs to be running in order to use HTML_AJAX?&lt;/b&gt;&lt;b class="style53" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt;&lt;/b&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;&lt;b class="style53" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt; &lt;/b&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900;"&gt;
&lt;/span&gt;&lt;/span&gt;The oldest PHP version i've fully tested HTML_AJAX is 4.3.11, but it should run on 4.2.0 without any problems. (Testing reports from PHP versions older then 4.3.11 would be appreciated.)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Why does HTML_AJAX hang on some server installs &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;If you run into an HTML_AJAX problem only on some servers, chances are your running into a problem with output compression. If the output compression is handled in the PHP config we detect that and do the right thing, but if its done from an apache extension we have no way of knowing its going to compress the body. Some times setting HTML_AJAX::sendContentLength to false fixes the problem, but in other cases you'll need to disabled the extension for the AJAX pages.
I've also seen problems caused by debugging extensions like XDebug, disabling the extension on the server page usually fixes that. Questions dealing with Using HTML_AJAX, and general JavaScript development&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;How do I get the XMLHttpRequest object?&lt;/b&gt;&lt;b class="style53" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt;&lt;/b&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;&lt;b class="style53" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt; &lt;/b&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900;"&gt;
&lt;/span&gt;&lt;/span&gt;Depending upon the browser... if (window.ActiveXObject) { // Internet Explorer http_request = new ActiveXObject("Microsoft.XMLHTTP"); } else if...&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Are there any security issues with AJAX? &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;JavaScript is in plain view to the user with by selecting view source of the page. JavaScript can not access the local filesystem without the user's permission. An AJAX interaction can only be made with the servers-side component from which the page was loaded. A proxy pattern could be used for AJAX interactions with external services.
You need to be careful not to expose your application model in such as way that your server-side components are at risk if a nefarious user to reverse engineer your application. As with any other web application, consider using HTTPS to secure the connection when confidential information is being exchanged.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;What about applets and plugins ? &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;Don't be too quick to dump your plugin or applet based portions of your application. While AJAX and DHTML can do drag and drop and other advanced user interfaces there still limitations especially when it comes to browser support. Plugins and applets have been around for a while and have been able to make AJAX like requests for years. Applets provide a great set of UI components and APIs that provide developers literally anything.
Many people disregard applets or plugins because there is a startup time to initialize the plugin and there is no guarantee that the needed version of a plugin of JVM is installed. Plugins and applets may not be as capable of manipulating the page DOM. If you are in a uniform environment or can depend on a specific JVM or plugin version being available (such as in a corporate environment) a plugin or applet solution is great.
One thing to consider is a mix of AJAX and applets or plugins. Flickr uses a combination of AJAX interactions/DHTML for labeling pictures and user interaction and a plugin for manipulating photos and photo sets to provide a great user experience. If you design your server-side components well they can talk to both types of clients.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Why did you feel the need to give this a name? &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;I needed something shorter than “Asynchronous JavaScript+CSS+DOM+XMLHttpRequest” to use when discussing this approach with clients.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Is AJAX code cross browser compatible?&lt;/b&gt;&lt;b class="style53" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt;&lt;/b&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;&lt;b class="style53" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt; &lt;/b&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900;"&gt;
&lt;/span&gt;&lt;/span&gt;Not totally. Most browsers offer a native XMLHttpRequest JavaScript object, while another one (Internet Explorer) require you to get it as an ActiveX object....&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style="color:#0000FF;"&gt;&lt;span class="style53" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt;Techniques for asynchronous server communication have been around for years. What makes Ajax a “new” approach?&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style="color:#0000FF;"&gt;&lt;span class="style53"&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"    style="font-family:Arial;font-size:130%;color:#000000;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;What’s new is the prominent use of these techniques in real-world applications to change the fundamental interaction model of the Web. Ajax is taking hold now because these technologies and the industry’s understanding of how to deploy them most effectively have taken time to develop.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Is Ajax a technology platform or is it an architectural style? &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;It’s both. Ajax is a set of technologies being used together in a particular way.&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Ajax Topic 6</title><link>http://javaspecialization.blogspot.com/2009/09/ajax-topic-6.html</link><category>Ajax</category><author>noreply@blogger.com (Yash Vysya)</author><pubDate>Fri, 4 Sep 2009 12:55:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8981950642035125982.post-7186625669525486231</guid><description>&lt;span class="Apple-style-span"  style=" border-collapse: collapse; font-family:'times new roman';"&gt;&lt;p&gt;&lt;span class="Apple-style-span"   style="font-family:'Bookman Old Style';font-size:7;"&gt;&lt;span class="Apple-style-span" style="font-size: 48px;"&gt;&lt;span class="Apple-style-span"  style="font-family:Arial;"&gt;&lt;span class="Apple-style-span" style="font-weight: 900;"&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman'; font-size: 16px; font-weight: normal; "&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span class="Apple-style-span"   style="font-family:'Bookman Old Style';font-size:7;"&gt;&lt;span class="Apple-style-span"  style="font-family:Arial;"&gt;&lt;p&gt;&lt;span style="color:#FF0000;"&gt;&lt;b&gt;&lt;span class="style53" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt;How do I handle the back and forward buttons?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#FF0000;"&gt;&lt;b&gt;&lt;span class="style53"&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"    style="font-family:Arial;font-size:130%;color:#000000;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;While you could go out and create a custom solution that tracks the current state on your application I recommend you leave this to the experts. Dojo addresses the navigation in a browser neutral way as can be seen in the JavaScript example below.
function updateOnServer(oldId, oldValue,
itemId, itemValue) {
var bindArgs = {
url: "faces/ajax-dlabel-update",
method: "post",
content: {"component-id": itemId, "component-value":
itemValue},
mimetype: "text/xml",
load: function(type, data) {
processUpdateResponse(data);
},
backButton: function() {
alert("old itemid was " + oldId);
},
forwardButton: function(){
alert("forward we must go!");
&lt;/span&gt;}&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
};
dojo.io.bind(bindArgs);
&lt;/span&gt;}&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;

The example above will update a value on the server using dojo.io.bind() with a function as a property that is responsible for dealing with the browser back button event. As a developer you are capable of restoring the value to the oldValue or taking any other action that you see fit. The underlying details of how the how the browser button event are detected are hidden from the developer by Dojo.
AJAX: How to Handle Bookmarks and Back Buttons details this problem and provides a JavaScript library Really Simple History framework (RSH) that focuses just on the back and forward issue.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;How does HTML_AJAX compare with the XAJAX project at Sourceforge? &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;XAJAX uses XML as a transport for data between the webpage and server, and you don't write your own javascript data handlers to manipulate the data received from the server. Instead you use a php class and built in javascript methods, a combination that works very similiar to the HTML_AJAX_Action class and haSerializer combo. XAJAX is designed for simplicity and ease of use.
HTML_AJAX allows for multiple transmission types for your ajax data - such as urlencoding, json, phpserialized, plain text, with others planned, and has a system you can use to write your own serializers to meet your specific needs. HTML_AJAX has a class to help generate javascript (HTML_AJAX_Helper) similiar to ruby on rail's javascript helper (although it isn't complete), and an action system similiar to XAJAX's "action pump" that allows you to avoid writing javascript data handlers if you desire.
But it also has the ability to write your own data handling routines, automatically register classes and methods using a server "proxy" script, do different types of callbacks including grabbing remote urls, choose between sync and async requests, has iframe xmlhttprequest emulation fallback capabilities for users with old browsers or disabled activeX, and is in active development with more features planned (see the Road Map for details)
HTML_AJAX has additional features such as client pooling and priority queues for more advanced users, and even a javascript utility class. Although you can use HTML_AJAX the same way you use XAJAX, the additional features make it more robust, extensible and flexible. And it is a pear package, you can use the pear installer to both install and keep it up to date.
If you're asking which is "better" - as with most php scripts it's a matter of taste and need. Do you need a quick, simple ajax solution? Or do you want something that's flexible, extensible, and looking to incorporate even more great features? It depends on the project, you as a writer, and your future plans.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;What browsers support AJAX?&lt;/b&gt;&lt;b class="style53" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt; &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900;"&gt;
&lt;/span&gt;&lt;/span&gt;Internet Explorer 5.0 and up, Opera 7.6 and up, Netscape 7.1 and up, Firefox 1.0 and up, Safari 1.2 and up, among others.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;How do I send an image using AJAX?&lt;/b&gt;&lt;b class="style53" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt; &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900;"&gt;
&lt;/span&gt;&lt;/span&gt;While it may appear that images are being sent when using AJAX with an application like Google Maps what is really happening is that the URLs of images are being send as the response of an AJAX request and those URLs are being set using DHTML.
In this example an XML document is returned from an AJAX interaction and the category bar is populated.

&lt;categories&gt;
&lt;category&gt;
&lt;cat-id&gt;1&lt;/cat-id&gt;
&lt;name&gt;Books&lt;/name&gt;
&lt;description&gt;Fun to read&lt;/description&gt;
&lt;image-url&gt;books_icon.gif&lt;/image-url&gt;
&lt;/category&gt;
&lt;category&gt;
&lt;cat-id&gt;2&lt;/cat-id&gt;
&lt;name&gt;Electronics&lt;/name&gt;
&lt;description&gt;Must have gadgets&lt;/description&gt;
&lt;image-url&gt;electronics.gif&lt;/image-url&gt;
&lt;/category&gt;
&lt;/categories&gt;


Notice that the image-url element contains the location of the URL for the image representing a category. The callback method of an AJAX interaction will parse the response XML document and call the addCategory function for each category included in the response XML document. The addCategory function looks up a table row element "categoryTable" in body of the page and adds a row to the element which contains the image.

&lt;scrip type="text/javascript"&gt;

...

function addCategory(id, name, imageSrc) {

var categoryTable = document.getElementById("categoryTable");
var row = document.createElement("tr");
var catCell = document.createElement("td");
var img = document.createElement("img");
img.src = ("images\\" + imageSrc);
var link = document.createElement("a");
link.className ="category";
link.appendChild(document.createTextNode(name));
link.setAttribute("onclick", "catalog?command=category&amp;amp;catid=" + id);
catCell.appendChild(img);
catCell.appendChild(link);
row.appendChild(catCell);
categoryTable.appendChild(row);
&lt;/span&gt;}&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;
&lt;/script&gt;

...

&lt;table&gt;
&lt;tr&gt;
&lt;td width="300" bgoclor="lightGray"&gt;
&lt;table id="categoryTable" border="0" cellpadding="0"&gt;&lt;/table&gt;
&lt;/td&gt;
&lt;td id="body" width="100%"&gt;Body Here&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;


Note that the source of the image is set to the image source. The image is loaded by a subsequent HTTP request for the image at the URL "images/books_icon.gif" or "images/electronic_icon.gif" that occurs when the img element is added to the categoryTable.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Will HTML_AJAX integrate with other Javascript AJAX libraries such as scriptaculous ? How would this integration look like?&lt;/b&gt;&lt;b class="style53" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt; &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900;"&gt;
&lt;/span&gt;&lt;/span&gt;HTML_AJAX doesn't have specific plans to integrate with other JavaScript libraries. Part of this is because external dependencies make for a more complicated installation process. It might make sense to offer some optional dependencies on a library like scriptaculous automatically using its visual effects for the loading box or something, but there isn't a lot to gain from making default visuals like that flashier since they are designed to be easily replaceable.

Most integration would take place in higher level components. Its unclear whether higher level components like that should be part of HTML_AJAX delivered through PEAR or if they should just be supported by HTML_AJAX and made available from http://htmlajax.org or some other site. If your interested in building widgets or components based on HTML_AJAX please let me know.

HTML_AJAX does however offer the ability to use its library loading mechanism with any JavaScript library. I use scriptaculous in conjunction with HTML_AJAX and I load both libraries through the server.

To do this you just need to register the library with your server and load add its flag to your include line.

&lt;?php
$this-&gt;server-&gt;registerJSLibrary('scriptaculous',
array('prototype.js','scriptaculous.js','builder.js','effects.js','dragdrop.js','controls.js','slider.js'), '/pathto/scriptaculous/');?&gt;
&lt;script type="text/javascrpt" src="server.php?client=scriptaculous"&gt;&lt;/script&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Ajax Topic 7</title><link>http://javaspecialization.blogspot.com/2009/09/ajax-topic-7.html</link><category>Ajax</category><author>noreply@blogger.com (Yash Vysya)</author><pubDate>Fri, 4 Sep 2009 12:51:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8981950642035125982.post-4252880209960806411</guid><description>&lt;span class="Apple-style-span" style="font-family: 'times new roman'; border-collapse: collapse; "&gt;&lt;p&gt;&lt;span style="color:#0000FF;"&gt;&lt;b&gt;&lt;span class="style53" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt;When should I use an Java applet instead of AJAX?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#0000FF;"&gt;&lt;b&gt;&lt;span class="style53"&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"    style="font-family:Arial;font-size:130%;color:#000000;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;Applets provide a rich experience on the client side and there are many things they can do that an AJAX application cannot do, such as custom data streaming, graphic manipulation, threading, and advanced GUIs. While DHTML with the use of AJAX has been able to push the boundaries on what you can do on the client, there are some things that it just cannot do. The reason AJAX is so popular is that it only requires functionality built into the browser (namely DHTML and AJAX capabilities). The user does not need to download and/or configure plugins. It is easy to incrementally update functionality and know that that functionality will readily available, and there are not any complicated deployment issues. That said, AJAX-based functionality does need to take browser differences into consideration. This is why we recommend using a JavaScript library such as Dojo which abstracts browser differences. So the "bottom line" is: If you are creating advanced UIs where you need more advanced features on the client where you want UI accuracy down to the pixel, to do complex computations on the client, use specialized networking techniques, and where you know that the applet plugin is available for your target audience, applets are the way to go. AJAX/DHTML works well for applications where you know the users are using the latest generation of browsers, where DHTML/AJAX "good enough" for you, and where your developers have JavaScript/DHTML/AJAX skills. Many amazing things can be done with AJAX/DHTML but there are limitations. AJAX and applets can be used together in the same UIs with AJAX providing the basic structure and applets providing more advanced functionality. The Java can communicate to JavaScript using the Live-Connect APIs. The question should not be should framed as do I use AJAX or applets, but rather which technology makes the best sense for what you are doing. AJAX and applets do not have to be mutually exclusive.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;What kinds of applications is Ajax best suited for? &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;We don’t know yet. Because this is a relatively new approach, our understanding of where Ajax can best be applied is still in its infancy. Sometimes the traditional web application model is the most appropriate solution to a problem.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Does this mean Adaptive Path is anti-Flash?&lt;/b&gt;&lt;b class="style53" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt;&lt;/b&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;&lt;b class="style53" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt; &lt;/b&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900;"&gt;
&lt;/span&gt;&lt;/span&gt;Not at all. Macromedia is an Adaptive Path client, and we’ve long been supporters of Flash technology. As Ajax matures, we expect that sometimes Ajax will be the better solution to a particular problem, and sometimes Flash will be the better solution. We’re also interested in exploring ways the technologies can be mixed (as in the case of Flickr, which uses both).&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Where can I find examples of AJAX? &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="for_questions_blue" style="color: rgb(0, 0, 0); text-decoration: none; "&gt;&lt;/span&gt;&lt;span class="style53" style="color: rgb(0, 0, 0); "&gt;&lt;/span&gt;&lt;span class="style53" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;While components of AJAX have been around for some time (for instance, 1999 for XMLHttpRequest), it really didn't become that popular until Google took...&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;What is the XMLHttpRequest object? &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;It offers a non-blocking way for JavaScript to communicate back to the web server to update only part of the web page.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Does Ajax have significant accessibility or browser compatibility limitations? Do Ajax applications break the back button? Is Ajax compatible with REST? Are there security considerations with Ajax development? Can Ajax applications be made to work for users who have JavaScript turned off? &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;The answer to all of these questions is “maybe”. Many developers are already working on ways to address these concerns. We think there’s more work to be done to determine all the limitations of Ajax, and we expect the Ajax development community to uncover more issues like these along the way.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;How do I access data from other domains to create a mashup with Java?&lt;/span&gt;&lt;span class="style53" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt;&lt;/span&gt;&lt;span class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;&lt;span class="style53" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; color: rgb(0, 0, 0); font-weight: 900; "&gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="for_questions_blue" style="color: rgb(0, 0, 0); text-decoration: none; "&gt;&lt;span class="style53" style="color: rgb(0, 0, 0); "&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:Arial;font-size:130%;"&gt;&lt;span class="Apple-style-span" style="font-size: 15px; font-weight: 900;"&gt;
&lt;/span&gt;&lt;/span&gt;From your JavaScript clients you can access data in other domains if the return data is provide in JSON format. In essence you can create a JavaScript client that runs operates using data from a different server. This technique is know as JSON with Padding or JSONP. There are questions as to whether this method is secure as you are retrieving data from outside your domain and allowing it to be excuted in the context of your domain. Not all data from third parties is accessible as JSON and in some cases you may want an extra level of protection. With Java you can provide a proxy to third party services using a web component such as a servlet. This proxy can manage the communication with a third party service and provide the data to your clients in a format of your choosing. You can also cache data at your proxy and reduce trips to service. For more on using a Java proxy to create mashups see The XmlHttpProxy Client for Java.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Does Java have support for Comet style server-side push? &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="for_questions_blue" style="color: rgb(0, 0, 0); text-decoration: none; "&gt;&lt;/span&gt;&lt;span class="style53" style="color: rgb(0, 0, 0); "&gt;&lt;/span&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;Current AJAX applications use polling to communicate changes data between the server and client. Some applications, such as chat applications, stock tickers, or score boards require more immediate notifications of updates to the client. Comet is an event based low latency server side push for AJAX applications. Comet communication keeps one of the two connections available to the browser open to continously communicate events from the server to the client. A Java based solution for Comet is being developed for Glassfish on top of the Grizzly HTTP connector. See Enabling Grizzly by Jean-Francois Arcand for more details.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;How do I create a thread to do AJAX polling? &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;JavaScript does not have threads. JavaScript functions are called when an event happens in a page such as the page is loaded, a mouse click, or a form element gains focus. You can create a timer using the setTimeout which takes a function name and time in milliseconds as arguments. You can then loop by calling the same function as can be seen in the JavaScript example below.

function checkForMessage() {
// start AJAX interaction with processCallback as the callback function
&lt;/span&gt;}&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;

// callback for the request
function processCallback() {

// do post processing
setTimeout("checkForMessage()", 10000);
&lt;/span&gt;}&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;

Notice that the checkForMessage will continue to loop indefinitely. You may want to vary the increment the interval based on activity in the page or your use cases. You may also choose to have logic that would break out of the loop based on some AJAX response processing condition.&lt;/span&gt;
&lt;/p&gt;&lt;p&gt;&lt;b class="for_questions_blue" style="font-family: VErdana; font-size: 13px; color: rgb(0, 0, 0); font-weight: bold; text-decoration: none; "&gt;Is the XMLHttpRequest object part of a W3C standard? &lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="answers" style="font-family: 'Bookman Old Style', Arial, 'Times New Roman'; font-size: 14px; "&gt;&lt;span class="Apple-style-span"   style="font-family:VErdana;font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;No. Or not yet. It is part of the DOM Level 3 Load and Save Specification proposal.&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Servlet Interview Questions Part 1</title><link>http://javaspecialization.blogspot.com/2009/09/servlet-interview-questions-part-1.html</link><category>Servlet Interview Questions</category><author>noreply@blogger.com (Yash Vysya)</author><pubDate>Thu, 3 Sep 2009 17:06:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8981950642035125982.post-6825379106403041284</guid><description>&lt;span class="Apple-style-span" style="font-family: 'times new roman'; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "&gt;&lt;table align="center" width="80%" cellspacing="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="heading" style="color: rgb(11, 12, 13); font-family: Verdana; font-size: 10pt; font-weight: bolder; "&gt;What is the servlet?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span class="answer" style="font-family: Verdana; font-size: 10pt; "&gt;Servlet is a script, which resides and executes on server side, to create dynamic HTML. In servlet programming we will use java language. A servlet can handle multiple requests concurrently&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="heading" style="color: rgb(11, 12, 13); font-family: Verdana; font-size: 10pt; font-weight: bolder; "&gt;
What is the architechture of servlet package?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span class="answer" style="font-family: Verdana; font-size: 10pt; "&gt;&lt;pre&gt;Servlet Interface is the central abstraction. All servlets implements this Servlet  Interface either direclty or indirectly  ( may implement or extend Servlet Interfaces sub classes or sub interfaces)     Servlet     | Generic Servlet     | HttpServlet   ( Class )  -- we will extend this class to handle GET / PUT HTTP requests     |  MyServlet&lt;/pre&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="heading" style="color: rgb(11, 12, 13); font-family: Verdana; font-size: 10pt; font-weight: bolder; "&gt;
What is the difference between HttpServlet and GenericServlet?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span class="answer" style="font-family: Verdana; font-size: 10pt; "&gt;A GenericServlet has a service() method to handle requests.
HttpServlet extends GenericServlet added new methods
doGet()
doPost()
doHead()
doPut()
doOptions()
doDelete()
doTrace() methods
Both these classes are abstract.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="heading" style="color: rgb(11, 12, 13); font-family: Verdana; font-size: 10pt; font-weight: bolder; "&gt;
What's the difference between servlets and applets?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span class="answer" style="font-family: Verdana; font-size: 10pt; "&gt;Servlets executes on Servers. Applets executes on browser. Unlike applets, however, servlets have no graphical user interface.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="heading" style="color: rgb(11, 12, 13); font-family: Verdana; font-size: 10pt; font-weight: bolder; "&gt;
What are the uses of Servlets?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span class="answer" style="font-family: Verdana; font-size: 10pt; "&gt;A servlet can handle multiple requests concurrently, and can synchronize requests. Servlets can forward requests to other servers and servlets. Thus servlets can be used to balance load among several servers.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="heading" style="color: rgb(11, 12, 13); font-family: Verdana; font-size: 10pt; font-weight: bolder; "&gt;
When doGET() method will going to execute?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span class="answer" style="font-family: Verdana; font-size: 10pt; "&gt;When we specified method='GET' in HTML
Example : &lt; name="'SSS'" method="'GET'"&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="heading" style="color: rgb(11, 12, 13); font-family: Verdana; font-size: 10pt; font-weight: bolder; "&gt;
When doPOST() method will going to execute?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span class="answer" style="font-family: Verdana; font-size: 10pt; "&gt;When we specified method='POST' in HTML
&lt; name="'SSS'" method="'POST'"&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="heading" style="color: rgb(11, 12, 13); font-family: Verdana; font-size: 10pt; font-weight: bolder; "&gt;
What is the difference between Difference between doGet() and doPost()?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span class="answer" style="font-family: Verdana; font-size: 10pt; "&gt;GET Method : Using get method we can able to pass 2K data from HTML
All data we are passing to Server will be displayed in URL (request string).

POST Method : In this method we does not have any size limitation.
All data passed to server will be hidden, User cannot able to see this info
on the browser.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="heading" style="color: rgb(11, 12, 13); font-family: Verdana; font-size: 10pt; font-weight: bolder; "&gt;
What is the servlet life cycle?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span class="answer" style="font-family: Verdana; font-size: 10pt; "&gt;When first request came in for the servlet , Server will invoke init() method of the servlet. There after if any user request the servlet program, Server will directly executes the service() method. When Server want to remove the servlet from pool, then it will execute the destroy() method&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="heading" style="color: rgb(11, 12, 13); font-family: Verdana; font-size: 10pt; font-weight: bolder; "&gt;
Which code line must be set before any of the lines that use the PrintWriter?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span class="answer" style="font-family: Verdana; font-size: 10pt; "&gt;setContentType() method must be set.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="heading" style="color: rgb(11, 12, 13); font-family: Verdana; font-size: 10pt; font-weight: bolder; "&gt;
Which protocol will be used by browser and servlet to communicate ?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span class="answer" style="font-family: Verdana; font-size: 10pt; "&gt;HTTP&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="heading" style="color: rgb(11, 12, 13); font-family: Verdana; font-size: 10pt; font-weight: bolder; "&gt;
In how many ways we can track the sessions?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span class="answer" style="font-family: Verdana; font-size: 10pt; "&gt;Method 1) By URL rewriting

Method 2) Using Session object

Getting Session form HttpServletRequest object
&lt;span style="color:#A3AAAF;"&gt;HttpSession session = request.getSession(true);&lt;/span&gt;

Get a Value from the session
&lt;span style="color:#A3AAAF;"&gt;session.getValue(session.getId()); &lt;/span&gt;

Adding values to session
&lt;span style="color:#A3AAAF;"&gt;cart = new Cart();
session.putValue(session.getId(), cart); &lt;/span&gt;

At the end of the session, we can inactivate the session by using the following command
&lt;span style="color:#A3AAAF;"&gt;session.invalidate();&lt;/span&gt;

Method 3) Using cookies

Method 4) Using hidden fields

&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="heading" style="color: rgb(11, 12, 13); font-family: Verdana; font-size: 10pt; font-weight: bolder; "&gt;
How Can You invoke other web resources (or other servelt / jsp ) ?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span class="answer" style="font-family: Verdana; font-size: 10pt; "&gt;Servelt can invoke other Web resources in two ways: indirect and direct.

Indirect Way : Servlet will return the resultant HTML to the browser which will point to another Servlet (Web resource)

Direct Way : We can call another Web resource (Servelt / Jsp) from Servelt program itself, by using RequestDispatcher object.

You can get this object using getRequestDispatcher("URL") method. You can get this object from either a request or a Context.

Example :
&lt;span style="color:#6E6E6E;"&gt;RequestDispatcher dispatcher = request.getRequestDispatcher("/jspsample.jsp");
if (dispatcher != null)
dispatcher.forward(request, response);
}&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="heading" style="color: rgb(11, 12, 13); font-family: Verdana; font-size: 10pt; font-weight: bolder; "&gt;
How Can you include other Resources in the Response?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span class="answer" style="font-family: Verdana; font-size: 10pt; "&gt;Using include method of a RequestDispatcher object.

Included WebComponent (Servlet / Jsp) cannot set headers or call any method (for example, setCookie) that affects the headers of the response.

Example : &lt;span style="color:#A3AAAF;"&gt;RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/banner");
           &amp;amp;nbspif (dispatcher != null)
           &amp;amp;nbspdispatcher.include(request, response);
}&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="heading" style="color: rgb(11, 12, 13); font-family: Verdana; font-size: 10pt; font-weight: bolder; "&gt;
What is the difference between the getRequestDispatcher(String path) ServletRequest interface and ServletContext interface?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span class="answer" style="font-family: Verdana; font-size: 10pt; "&gt;The getRequestDispatcher(String path) method of ServletRequest interface accepts parameter the path to the resource to be included or forwarded to, which can be relative to the request of the calling servlet. If the path begins with a "/" it is interpreted as relative to the current context root.

The getRequestDispatcher(String path) method of ServletContext interface cannot accepts relative paths. All path must sart with a "/" and are interpreted as relative to curent context root. If the resource is not available, or if the server has not implemented a RequestDispatcher object for that type of resource, getRequestDispatcher will return null. Your servlet should be prepared to deal with this condition.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="heading" style="color: rgb(11, 12, 13); font-family: Verdana; font-size: 10pt; font-weight: bolder; "&gt;
What is the use of ServletContext ?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span class="answer" style="font-family: Verdana; font-size: 10pt; "&gt;Using ServletContext, We can access data from its environment. Servlet context is common to all Servlets so all Servlets share the information through ServeltContext.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="heading" style="color: rgb(11, 12, 13); font-family: Verdana; font-size: 10pt; font-weight: bolder; "&gt;
Is there any way to generate PDF'S dynamically in servlets?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span class="answer" style="font-family: Verdana; font-size: 10pt; "&gt;We need to use iText. A open source library for java. Please refer sourceforge site for sample servlet examples.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="heading" style="color: rgb(11, 12, 13); font-family: Verdana; font-size: 10pt; font-weight: bolder; "&gt;
What is the difference between using getSession(true) and getSession(false) methods?&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;span class="answer" style="font-family: Verdana; font-size: 10pt; "&gt;getSession(true) - This method will check whether already a session is existing for the user. If a session is existing, it will return that session object, Otherwise it will create new session object and return taht object.

getSession(false) - This method will check existence of session. If session exists, then it returns the reference of that session object, if not, this methods will return null.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Java Interview Questions Part 2</title><link>http://javaspecialization.blogspot.com/2009/08/java-interview-questions-part-2_18.html</link><category>Java Interview Questions</category><author>noreply@blogger.com (Yash Vysya)</author><pubDate>Tue, 18 Aug 2009 23:48:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8981950642035125982.post-7349959924249953746</guid><description>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 11"&gt;&lt;meta name="Originator" content="Microsoft Word 11"&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" latentstylecount="156"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman";} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:1426535038; 	mso-list-template-ids:2131285732;} ol 	{margin-bottom:0in;} ul 	{margin-bottom:0in;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;ol start="1" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is garbage      collection? What is the process that is responsible for doing that in      java?&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style=""&gt; &lt;/span&gt;- Reclaiming the unused memory by the invalid objects. Garbage collector is responsible for this process&lt;/p&gt;  &lt;ol start="2" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What kind of thread is the      Garbage collector thread?&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style=""&gt; &lt;/span&gt;- It is a daemon thread.&lt;/p&gt;  &lt;ol start="3" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is a daemon thread?&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;&lt;span style=""&gt; &lt;/span&gt;- These are the threads which can run without user intervention. The JVM can exit when there are daemon thread by killing them abruptly.&lt;/p&gt;  &lt;ol start="4" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;How will you invoke any      external process in Java?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- Runtime.getRuntime().exec(….)&lt;/p&gt;  &lt;ol start="5" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is the finalize      method do?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- Before the invalid objects get garbage collected, the JVM give the user a chance to clean up some resources before it got garbage collected.&lt;/p&gt;  &lt;ol start="6" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is mutable object and      immutable object?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- If a object value is changeable then we can call it as Mutable object. (Ex., StringBuffer, …) If you are not allowed to change the value of an object, it is immutable object. (Ex., String, Integer, Float, …)&lt;/p&gt;  &lt;ol start="7" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is the basic      difference between string and stringbuffer object?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- String is an immutable object. StringBuffer is a mutable object.&lt;/p&gt;  &lt;ol start="8" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is the purpose of      Void class?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- The Void class is an uninstantiable placeholder class to hold a reference to the Class object representing the primitive Java type void. &lt;/p&gt;  &lt;ol start="9" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is reflection?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- Reflection allows programmatic access to information about the fields, methods and constructors of loaded classes, and the use reflected fields, methods, and constructors to operate on their underlying counterparts on objects, within security restrictions. &lt;/p&gt;  &lt;ol start="10" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is the base class for      Error and Exception?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- Throwable&lt;/p&gt;  &lt;ol start="11" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is the byte range?&lt;/b&gt;      &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;-128 to 127&lt;/p&gt;  &lt;ol start="12" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is the implementation      of destroy method in java.. is it native or java code?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- This method is not implemented.&lt;/p&gt;  &lt;ol start="13" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is a package?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- To group set of classes into a single unit is known as packaging. Packages provides wide namespace ability.&lt;/p&gt;  &lt;ol start="14" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What are the approaches      that you will follow for making a program very efficient?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- By avoiding too much of static methods avoiding the excessive and unnecessary use of synchronized methods Selection of related classes based on the application (meaning synchronized classes for multiuser and non-synchronized classes for single user) Usage of appropriate design patterns Using cache methodologies for remote invocations Avoiding creation of variables within a loop and lot more.&lt;/p&gt;  &lt;ol start="15" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is a      DatabaseMetaData?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- Comprehensive information about the database as a whole. &lt;/p&gt;  &lt;ol start="16" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is Locale?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- A Locale object represents a specific geographical, political, or cultural region&lt;/p&gt;  &lt;ol start="17" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;How will you load a      specific locale?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- Using ResourceBundle.getBundle(…);&lt;/p&gt;  &lt;ol start="18" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is JIT and its use?&lt;/b&gt;      &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- Really, just a very fast compiler… In this incarnation, pretty much a one-pass compiler — no offline computations. So you can’t look at the whole method, rank the expressions according to which ones are re-used the most, and then generate code. In theory terms, it’s an on-line problem.&lt;/p&gt;  &lt;ol start="19" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;Is JVM a compiler or an      interpreter?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- Interpreter&lt;/p&gt;  &lt;ol start="20" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;When you think about      optimization, what is the best way to findout the time/memory consuming      process?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- Using profiler&lt;/p&gt;  &lt;ol start="21" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is the purpose of      assert keyword used in JDK1.4.x?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- In order to validate certain expressions. It effectively replaces the if block and automatically throws the AssertionError on failure. This keyword should be used for the critical arguments. Meaning, without that the method does nothing.&lt;/p&gt;  &lt;ol start="22" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;How will you get the      platform dependent values like line separator, path separator, etc., ?&lt;/b&gt;      &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- Using Sytem.getProperty(…) (line.separator, path.separator, …)&lt;/p&gt;  &lt;ol start="23" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is skeleton and stub?      what is the purpose of those?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- Stub is a client side representation of the server, which takes care of communicating with the remote server. Skeleton is the server side representation. But that is no more in use… it is deprecated long before in JDK.&lt;/p&gt;  &lt;ol start="24" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is the final keyword      denotes?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- final keyword denotes that it is the final implementation for that method or variable or class. You can’t override that method/variable/class any more.&lt;/p&gt;  &lt;ol start="25" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is the significance      of ListIterator?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- You can iterate back and forth.&lt;/p&gt;  &lt;ol start="26" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is the major      difference between LinkedList and ArrayList?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- LinkedList are meant for sequential accessing. ArrayList are meant for random accessing.&lt;/p&gt;  &lt;ol start="27" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is nested class?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- If all the methods of a inner class is static then it is a nested class.&lt;/p&gt;  &lt;ol start="28" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is inner class?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- If the methods of the inner class can only be accessed via the instance of the inner class, then it is called inner class.&lt;/p&gt;  &lt;ol start="29" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is composition?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- Holding the reference of the other class within some other class is known as composition.&lt;/p&gt;  &lt;ol start="30" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is aggregation?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- It is a special type of composition. If you expose all the methods of a composite class and route the method call to the composite method through its reference, then it is called aggregation.&lt;/p&gt;  &lt;ol start="31" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What are the methods in      Object?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- clone, equals, wait, finalize, getClass, hashCode, notify, notifyAll, toString&lt;/p&gt;  &lt;ol start="32" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;Can you instantiate the      Math class?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- You can’t instantiate the math class. All the methods in this class are static. And the constructor is not public.&lt;/p&gt;  &lt;ol start="33" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is singleton?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- It is one of the design pattern. This falls in the creational pattern of the design pattern. There will be only one instance for that entire JVM. You can achieve this by having the private constructor in the class. For eg., public class Singleton { private static final Singleton s = new Singleton(); private Singleton() { } public static Singleton getInstance() { return s; } // all non static methods … } &lt;/p&gt;  &lt;ol start="34" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is DriverManager?&lt;/b&gt;      &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- The basic service to manage set of JDBC drivers.&lt;/p&gt;  &lt;ol start="35" type="1"&gt;&lt;li class="MsoNormal" style=""&gt;&lt;b&gt;What is Class.forName()      does and how it is useful?&lt;/b&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in;"&gt;- It loads the class into the ClassLoader. It returns the Class. Using that you can get the instance ( “class-instance”.newInstance() ).&lt;/p&gt;  </description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>JSP Interview Questions Part 2</title><link>http://javaspecialization.blogspot.com/2009/08/jsp-interview-questions-part-2.html</link><category>JSP Interview Questions</category><author>noreply@blogger.com (Yash Vysya)</author><pubDate>Tue, 18 Aug 2009 23:19:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8981950642035125982.post-7847675200229974615</guid><description>&lt;TD&gt;&amp;nbsp;&lt;BR&gt;
&lt;P&gt;&lt;font color="#000080"&gt;&lt;b&gt;1. What are the implicit objects?&lt;/b&gt;&lt;/font&gt;&lt;BR&gt;
Ans - Implicit objects are objects that are created by the web container and contain information related to a particular request, page, or application. They are: request, response, pageContext, session, application, out, config, page, exception.&lt;BR&gt;&lt;br /&gt;
&lt;font color="#000080"&gt;&lt;b&gt;2. Is JSP technology extensible?&lt;/b&gt;&lt;/font&gt;&lt;BR&gt;
Ans - Yes. JSP technology is extensible through the development of custom actions, or tags, which are encapsulated in tag libraries.&lt;BR&gt;&lt;br /&gt;
&lt;font color="#000080"&gt;&lt;b&gt;3. How can I implement a thread-safe JSP page? What are the advantages and Disadvantages of using it?&lt;/b&gt;&lt;/font&gt;&lt;BR&gt;
Ans - You can make your JSPs thread-safe by having them implement the SingleThreadModel interface. This is done by adding the directive within your JSP page. With this, instead of a single instance of the servlet generated for your JSP page loaded in memory, you will have N instances of the servlet loaded and initialized, with the service method of each instance effectively synchronized. You can typically control the number of instances (N) that are instantiated for all servlets implementing SingleThreadModel through the admin screen for your JSP engine. More importantly, avoid using the tag for variables. If you do use this tag, then you should set isThreadSafe to true, as mentioned above. Otherwise, all requests to that page will access those variables, causing a nasty race condition. SingleThreadModel is not recommended for normal use. There are many pitfalls, including the example above of not being able to use . You should try really hard to make them thread-safe the old fashioned way: by making them thread-safe.&lt;BR&gt;&lt;br /&gt;
&lt;font color="#000080"&gt;&lt;b&gt;4. How does JSP handle run-time exceptions?&lt;/b&gt;&lt;/font&gt;&lt;BR&gt;
Ans - You can use the errorPage attribute of the page directive to have uncaught run-time exceptions automatically forwarded to an error processing page.&lt;BR&gt; For example:
redirects the browser to the JSP page error.jsp if an uncaught exception is encountered during request processing. Within error.jsp, if you indicate that it is an error-processing page, via the directive: Throwable object describing the exception may be accessed within the error page via the exception implicit object. Note: You must always use a relative URL as the value for the errorPage attribute.&lt;BR&gt;&lt;br /&gt;
&lt;font color="#000080"&gt;&lt;b&gt;5. How do I prevent the output of my JSP or Servlet pages from being cached by the browser?&lt;/b&gt;&lt;/font&gt;&lt;BR&gt;
Ans - You will need to set the appropriate HTTP header attributes to prevent the dynamic content output by the JSP page from being cached by the browser. Just execute the following scriptlet at the beginning of your JSP pages to prevent them from being cached at the browser. You need both the statements to take care of some of the older browser versions.&lt;BR&gt;&lt;br /&gt;
&lt;font color="#000080"&gt;&lt;b&gt;6. How do I use comments within a JSP page?&lt;/b&gt;&lt;/font&gt;&lt;BR&gt;
Ans - You can use “JSP-style” comments to selectively block out code while debugging or simply to comment your scriptlets. JSP comments are not visible at the client.&lt;BR&gt; For example:
You can also use HTML-style comments anywhere within your JSP page. These comments are visible at the client. For example:&lt;BR&gt;
Of course, you can also use comments supported by your JSP scripting language within your scriptlets. For example, assuming Java is the scripting language, you can have:&lt;BR&gt;&lt;br /&gt;
&lt;font color="#000080"&gt;&lt;b&gt;7. Response has already been commited error. What does it mean?&lt;/b&gt;&lt;/font&gt;&lt;BR&gt;
Ans - This error show only when you try to redirect a page after you already have written something in your page. This happens because HTTP specification force the header to be set up before the lay out of the page can be shown (to make sure of how it should be displayed, content-type=”text/html” or “text/xml” or “plain-text” or “image/jpg”, etc.) When you try to send a redirect status (Number is line_status_402), your HTTP server cannot send it right now if it hasn’t finished to set up the header. If not starter to set up the header, there are no problems, but if it ’s already begin to set up the header, then your HTTP server expects these headers to be finished setting up and it cannot be the case if the stream of the page is not over… In this last case it’s like you have a file started with some output (like testing your variables.) Before you indicate that the file is over (and before the size of the page can be setted up in the header), you try to send a redirect status. It s simply impossible due to the specification of HTTP 1.0 and 1.1&lt;BR&gt;&lt;br /&gt;
&lt;font color="#000080"&gt;&lt;b&gt;8. How do I use a scriptlet to initialize a newly instantiated bean?&lt;/b&gt;&lt;/font&gt;&lt;BR&gt;
Ans - A jsp:useBean action may optionally have a body. If the body is specified, its contents will be automatically invoked when the specified bean is instantiated. Typically, the body will contain scriptlets or jsp:setProperty tags to initialize the newly instantiated bean, although you are not restricted to using those alone.&lt;BR&gt;
The following example shows the “today” property of the Foo bean initialized to the current date when it is instantiated. Note that here, we make use of a JSP expression within the jsp:setProperty action.&lt;BR&gt;
&amp;quot;&amp;gt;&lt;BR&gt;&lt;br /&gt;
&lt;font color="#000080"&gt;&lt;b&gt;9. How can I enable session tracking for JSP pages if the browser has disabled cookies?&lt;/b&gt;&lt;/font&gt;&lt;BR&gt;
Ans - We know that session tracking uses cookies by default to associate a session identifier with a unique user. If the browser does not support cookies, or if cookies are disabled, you can still enable session tracking using URL rewriting. URL rewriting essentially includes the session ID within the link itself as a name/value pair. However, for this to be effective, you need to append the session ID for each and every link that is part of your servlet response. Adding the session ID to a link is greatly simplified by means of of a couple of methods: response.encodeURL() associates a session ID with a given URL, and if you are using redirection, response.encodeRedirectURL() can be used by giving the redirected URL as input. Both encodeURL() and encodeRedirectedURL() first determine whether cookies are supported by the browser; if so, the input URL is returned unchanged since the session ID will be persisted as a cookie. Consider the following example, in which two JSP files, say hello1.jsp and hello2.jsp, interact with each other. Basically, we create a new session within hello1.jsp and place an object within this session. The user can then traverse to hello2.jsp by clicking on the link present within the page.Within hello2.jsp, we simply extract the object that was earlier placed in the session and display its contents. Notice that we invoke the encodeURL() within hello1.jsp on the link used to invoke hello2.jsp; if cookies are disabled, the session ID is automatically appended to the URL, allowing hello2.jsp to still retrieve the session object. Try this example first with cookies enabled. Then disable cookie support, restart the brower, and try again. Each time you should see the maintenance of the session across pages. Do note that to get this example to work with cookies disabled at the browser, your JSP engine has to support URL rewriting.&lt;BR&gt;
hello1.jsp&lt;BR&gt;
'&amp;gt;hello2.jsp&lt;BR&gt;
hello2.jsp&lt;BR&gt;
Another Example&lt;BR&gt;
file1.jsp:&lt;BR&gt;
file2.jsp&lt;BR&gt;
would reset the inactivity period for this session to 5 minutes. The inactivity interval is set in seconds.&lt;BR&gt;
&lt;font color="#000080"&gt;&lt;b&gt;12. How can I set a cookie and delete a cookie from within a JSP page?&lt;/b&gt;&lt;/font&gt;&lt;BR&gt;
Ans - A cookie, mycookie, can be deleted using the following scriptlet:&lt;BR&gt;&lt;br /&gt;
&lt;font color="#000080"&gt;&lt;b&gt;13. How does a servlet communicate with a JSP page?&lt;/b&gt;&lt;/font&gt;&lt;BR&gt;
Ans - The following code snippet shows how a servlet instantiates a bean and initializes it with FORM data posted by a browser. The bean is then placed into the request, and the call is then forwarded to the JSP page, Bean1.jsp, by means of a request dispatcher for downstream processing.&lt;BR&gt;
public void doPost (HttpServletRequest request, HttpServletResponse response) {&lt;BR&gt;
try {&lt;BR&gt;
govi.FormBean f = new govi.FormBean();&lt;BR&gt;
String id = request.getParameter(&amp;quot;id&amp;quot;);&lt;BR&gt;
f.setName(request.getParameter(&amp;quot;name&amp;quot;));&lt;BR&gt;
f.setAddr(request.getParameter(&amp;quot;addr&amp;quot;));&lt;BR&gt;
f.setAge(request.getParameter(&amp;quot;age&amp;quot;));&lt;BR&gt;
//use the id to compute&lt;BR&gt;
//additional bean properties like info&lt;BR&gt;
//maybe perform a db query, etc.&lt;BR&gt;
// . . .&lt;BR&gt;
f.setPersonalizationInfo(info);&lt;BR&gt;
request.setAttribute(&amp;quot;fBean&amp;quot;,f);&lt;BR&gt;
getServletConfig().getServletContext().getRequestDispatcher&lt;BR&gt;
(&amp;quot;/jsp/Bean1.jsp&amp;quot;).forward(request, response);&lt;BR&gt;
} catch (Exception ex) {&lt;BR&gt;
. . .&lt;BR&gt;
}&lt;BR&gt;
}&lt;BR&gt;
The JSP page Bean1.jsp can then process fBean, after first extracting it from the default request scope via the useBean action.&lt;BR&gt;
jsp:useBean id=&amp;quot;fBean&amp;quot; class=&amp;quot;govi.FormBean&amp;quot; scope=&amp;quot;request&amp;quot;&lt;BR&gt;
/ jsp:getProperty name=&amp;quot;fBean&amp;quot; property=&amp;quot;name&amp;quot;&lt;BR&gt;
/ jsp:getProperty name=&amp;quot;fBean&amp;quot; property=&amp;quot;addr&amp;quot;&lt;BR&gt;
/ jsp:getProperty name=&amp;quot;fBean&amp;quot; property=&amp;quot;age&amp;quot;&lt;BR&gt;
/ jsp:getProperty name=&amp;quot;fBean&amp;quot; property=&amp;quot;personalizationInfo&amp;quot; /&lt;BR&gt;&lt;br /&gt;
&lt;font color="#000080"&gt;&lt;b&gt;14. How do I have the JSP-generated servlet subclass my own custom servlet class, instead of the default?&lt;/b&gt;&lt;/font&gt;&lt;BR&gt;
Ans - One should be very careful when having JSP pages extend custom servlet classes as opposed to the default one generated by the JSP engine. In doing so, you may lose out on any advanced optimization that may be provided by the JSP engine. In any case, your new superclass has to fulfill the contract with the JSP engine by:&lt;BR&gt;
Implementing the HttpJspPage interface, if the protocol used is HTTP, or implementing JspPage otherwise Ensuring that all the methods in the Servlet interface are declared final Additionally, your servlet superclass also needs to do the following:&lt;BR&gt;
* The service() method has to invoke the _jspService() method&lt;BR&gt;
* The init() method has to invoke the jspInit() method&lt;BR&gt;
* The destroy() method has to invoke jspDestroy()&lt;BR&gt;
If any of the above conditions are not satisfied, the JSP engine may throw a translation error.&lt;BR&gt;
Once the superclass has been developed, you can have your JSP extend it as follows:&lt;BR&gt;&lt;br /&gt;
&lt;font color="#000080"&gt;&lt;b&gt;15. How can I prevent the word &amp;quot;null&amp;quot; from appearing in my HTML input text fields when I populate them with a resultset that has null values?&lt;/b&gt;&lt;/font&gt;&lt;BR&gt;
Ans - You could make a simple wrapper function, like&lt;BR&gt;
then use it inside your JSP form, like&lt;BR&gt;
&amp;quot; &amp;gt;&lt;BR&gt;&lt;br /&gt;
&lt;font color="#000080"&gt;&lt;b&gt;16. How can I get to print the stacktrace for an exception occuring within my JSP page?&lt;/b&gt;&lt;/font&gt;&lt;BR&gt;
Ans - By printing out the exception’s stack trace, you can usually diagonse a problem better when debugging JSP pages. By looking at a stack trace, a programmer should be able to discern which method threw the exception and which method called that method. However, you cannot print the stacktrace using the JSP out implicit variable, which is of type JspWriter. You will have to use a PrintWriter object instead. The following snippet demonstrates how you can print a stacktrace from within a JSP error page:&lt;BR&gt;&lt;br /&gt;
&lt;font color="#000080"&gt;&lt;b&gt;17. How do you pass an InitParameter to a JSP?&lt;/b&gt;&lt;/font&gt;&lt;BR&gt;
Ans - The JspPage interface defines the jspInit() and jspDestroy() method which the page writer can use in their pages and are invoked in much the same manner as the init() and destory() methods of a servlet. The example page below enumerates through all the parameters and prints them to the console.&lt;BR&gt;&lt;br /&gt;
&lt;font color="#000080"&gt;&lt;b&gt;18. How can my JSP page communicate with an EJB Session Bean?&lt;/b&gt;&lt;/font&gt;&lt;BR&gt;
Ans - The following is a code snippet that demonstrates how a JSP page can interact with an EJB session bean:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>JSP Interview Questions Part 1</title><link>http://javaspecialization.blogspot.com/2009/08/jsp-interview-questions.html</link><category>JSP Interview Questions</category><author>noreply@blogger.com (Yash Vysya)</author><pubDate>Tue, 18 Aug 2009 22:58:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8981950642035125982.post-7048074500842462216</guid><description>&lt;TD&gt;&amp;nbsp;&lt;BR&gt;
&lt;P&gt;&lt;font color="#000080"&gt;&lt;b&gt;1. What is a JSP and what is it used for?&lt;/b&gt;&lt;/font&gt; &lt;br /&gt;Java Server Pages (JSP) is a platform independent presentation layer technology that comes with SUN s J2EE platform. JSPs are normal HTML pages with Java code pieces embedded in them. JSP pages are saved to *.jsp files. A JSP compiler is used in the background to generate a Servlet from the JSP page.&lt;/P&gt;
&lt;P&gt;&lt;font color="#000080"&gt;&lt;b&gt;2. What is difference between custom JSP tags and beans? &lt;/b&gt;&lt;/font&gt;&lt;br /&gt;Custom JSP tag is a tag you defined. You define how a tag, its attributes and its body are interpreted, and then group your tags into collections called tag libraries that can be used in any number of JSP files. To use custom JSP tags, you need to define three separate components:&lt;/P&gt;
&lt;P&gt;The tag handler class that defines the tag\'s behavior&lt;BR&gt;
The tag library descriptor file that maps the XML element names to the tag implementations 
the JSP file that uses the tag library When the first two components are done, you can use the tag by using taglib directive:&lt;BR&gt;
Then you are ready to use the tags you defined. Let's say the tag prefix is test: MyJSPTag or JavaBeans are Java utility classes you defined. Beans have a standard format for Java classes. You use tags to declare a bean and use to set value of the bean class and use to get value of the bean class.&lt;/P&gt;
&lt;P&gt;Custom tags and beans accomplish the same goals — encapsulating complex behavior into simple and accessible forms. There are several differences: Custom tags can manipulate JSP content; beans cannot. Complex operations can be reduced to a significantly simpler form with custom tags than with beans. Custom tags require quite a bit more work to set up than do beans. Custom tags usually define relatively self-contained behavior, whereas beans are often defined in one servlet and used in a different servlet or JSP page. Custom tags are available only in JSP 1.1 and later, but beans can be used in all JSP 1.x versions.&lt;/P&gt;
&lt;P&gt;&lt;font color="#000080"&gt;&lt;b&gt;3. What are the two kinds of comments in JSP and what's the difference between them.&lt;/b&gt;&lt;/font&gt;&lt;/P&gt;
&lt;P&gt;&lt;font color="#000080"&gt;&lt;b&gt;4. What is JSP technology?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;Java Server Page is a standard Java extension that is defined on top of the servlet Extensions. The goal of JSP is the simplified creation and management of dynamic Web pages. JSPs are secure, platform-independent, and best of all, make use of Java as a server-side scripting language.&lt;/P&gt;
&lt;P&gt;&lt;font color="#000080"&gt;&lt;b&gt;5. What is JSP page?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
A JSP page is a text-based document that contains two types of text: static template data, which can be expressed in any text-based format such as HTML, SVG, WML, and XML, and JSP elements, which construct dynamic content.&lt;/P&gt;
&lt;P&gt;&lt;font color="#000080"&gt;&lt;b&gt;
6. What are the implicit objects?&lt;/b&gt;&lt;/font&gt;
&lt;br /&gt;Implicit objects are objects that are created by the web container and contain information related to a particular request, page, or application. They are: –request –response –pageContext –session –application –out –config –page –exception&lt;/P&gt;
&lt;P&gt;&lt;font color="#000080"&gt;&lt;b&gt;
7. How many JSP scripting elements and what are they?&lt;/b&gt;&lt;/font&gt;
&lt;br /&gt;There are three scripting language elements: –declarations –scriptlets –expressions&lt;/P&gt;
&lt;P&gt;&lt;font color="#000080"&gt;&lt;b&gt;
8. Why are JSP pages the preferred API for creating a web-based client program?&lt;/b&gt;&lt;/font&gt;
&lt;br /&gt;Because no plug-ins or security policy files are needed on the client systems(applet does). Also, JSP pages enable cleaner and more module application design because they provide a way to separate applications programming from web page design. This means personnel involved in web page design do not need to understand Java programming language syntax to do their jobs.&lt;/P&gt;
&lt;P&gt;&lt;font color="#000080"&gt;&lt;b&gt;
9. Is JSP technology extensible?&lt;/b&gt;&lt;/font&gt;
&lt;br /&gt;YES. JSP technology is extensible through the development of custom actions, or tags, which are encapsulated in tag libraries.&lt;/P&gt;
&lt;P&gt;&lt;font color="#000080"&gt;&lt;b&gt;
10. Can we use the constructor, instead of init(), to initialize servlet?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
Yes , of course you can use the constructor instead of init(). There’s nothing to stop you. But you shouldn’t. The original reason for init() was that ancient versions of Java couldn’t dynamically invoke constructors with arguments, so there was no way to give the constructur a ServletConfig. That no longer applies, but servlet containers still will only call your no-arg constructor. So you won’t have access to a ServletConfig or ServletContext.&lt;/P&gt;
&lt;P&gt;&lt;font color="#000080"&gt;&lt;b&gt;&lt;br /&gt;
11. How can a servlet refresh automatically if some new data has entered the database?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
You can use a client-side Refresh or Server Push.
&lt;font color="#000080"&gt;&lt;b&gt;&lt;br /&gt;&lt;br /&gt;12. The code in a finally clause will never fail to execute, right?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
Using System.exit(1); in try block will not allow finally code to execute.&lt;br /&gt;
&lt;font color="#000080"&gt;&lt;b&gt;&lt;br /&gt;13. How many messaging models do JMS provide for and what are they?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
JMS provide for two messaging models, publish-and-subscribe and point-to-point queuing.
&lt;P&gt;&lt;font color="#000080"&gt;&lt;b&gt;14. What information is needed to create a TCP Socket?&lt;/b&gt;&lt;/font&gt;
&lt;br /&gt;The Local Systems IP Address and Port Number. And the Remote System’s IPAddress and Port Number.
&lt;P&gt;&lt;font color="#000080"&gt;&lt;b&gt;15. What Class.forName will do while loading drivers?&lt;/b&gt;&lt;/font&gt;
&lt;br /&gt;It is used to create an instance of a driver and register it with the DriverManager. When you have loaded a driver, it is available for making a connection with a DBMS.&lt;br /&gt;
&lt;br /&gt;&lt;font color="#000080"&gt;&lt;b&gt;16. How to Retrieve Warnings?&lt;/b&gt;&lt;/font&gt;
SQLWarning objects are a subclass of SQLException that deal with database access warnings. Warnings do not stop the execution of an application, as exceptions do; they simply alert the user that something did not happen as planned. A warning can be reported on a Connection object, a Statement object (including PreparedStatement and CallableStatement objects), or a ResultSet object. Each of these classes has a getWarnings method, which you must invoke in order to see the first warning reported on the calling object&lt;/P&gt;
&lt;P&gt;SQLWarning warning = stmt.getWarnings(); if (warning != null) { while (warning != null) { System.out.println(&amp;quot;Message: &amp;quot; + warning.getMessage()); System.out.println(&amp;quot;SQLState: &amp;quot; + warning.getSQLState()); System.out.print(&amp;quot;Vendor error code: &amp;quot;); System.out.println(warning.getErrorCode()); warning = warning.getNextWarning(); } } &lt;br /&gt;&lt;br /&gt;&lt;font color="#000080"&gt;&lt;b&gt;17. How many JSP scripting elements are there and what are they?&lt;/b&gt;&lt;/font&gt;
&lt;br /&gt;There are three scripting language elements: declarations, scriptlets, expressions.&lt;/P&gt;
&lt;P&gt;&lt;font color="#000080"&gt;&lt;b&gt;18. In the Servlet 2.4 specification SingleThreadModel has been deprecated, why?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;Because it is not practical to have such model. Whether you set isThreadSafe to true or false, you should take care of concurrent client requests to the JSP page by synchronizing access to any shared objects defined at the page level.&lt;/P&gt;
&lt;P&gt;&lt;font color="#000080"&gt;&lt;b&gt;19. What are stored procedures? How is it useful?&lt;/b&gt;&lt;/font&gt;
&lt;br /&gt;A stored procedure is a set of statements/commands which reside in the database. The stored procedure is pre-compiled and saves the database the effort of parsing and compiling sql statements everytime a query is run. Each database has its own stored procedure language, usually a variant of C with a SQL preproceesor. Newer versions of db’s support writing stored procedures in Java and Perl too. Before the advent of 3-tier/n-tier architecture it was pretty common for stored procs to implement the business logic( A lot of systems still do it). The biggest advantage is of course speed. Also certain kind of data manipulations are not achieved in SQL. Stored procs provide a mechanism to do these manipulations. Stored procs are also useful when you want to do Batch updates/exports/houseKeeping kind of stuff on the db. The overhead of a JDBC Connection may be significant in these cases.&lt;/P&gt;
&lt;P&gt;&lt;font color="#000080"&gt;&lt;b&gt;20. How do I include static files within a JSP page?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;Static resources should always be included using the JSP include directive. This way, the inclusion is performed just once during the translation phase. Do note that you should always supply a relative URL for the file attribute. Although you can also include static resources using the action, this is not advisable as the inclusion is then performed for each and every request.&lt;/P&gt;
&lt;P&gt;&lt;font color="#000080"&gt;&lt;b&gt;21. Why does JComponent have add() and remove() methods but Component does not?&lt;/b&gt;&lt;/font&gt;
&lt;br /&gt;because JComponent is a subclass of Container, and can contain other components and jcomponents. How can I implement a thread-safe JSP page? - You can make your JSPs thread-safe by having them implement the SingleThreadModel interface. This is done by adding the directive&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TD WIDTH="20"&gt;&lt;/TD&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>JSF Interview Question</title><link>http://javaspecialization.blogspot.com/2009/08/jsf-interview-question_5093.html</link><category>JSF Interview Question</category><author>noreply@blogger.com (Yash Vysya)</author><pubDate>Sat, 15 Aug 2009 23:27:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8981950642035125982.post-3952642675070157662</guid><description>

&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 11"&gt;&lt;meta name="Originator" content="Microsoft Word 11"&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="Edit-Time-Data" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_editdata.mso"&gt;&lt;!--[if !mso]&gt; &lt;style&gt; v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} &lt;/style&gt; &lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" latentstylecount="156"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman";} p 	{mso-margin-top-alt:auto; 	margin-right:0in; 	mso-margin-bottom-alt:auto; 	margin-left:0in; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman";} span.apple-converted-space 	{mso-style-name:apple-converted-space;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:986741518; 	mso-list-type:hybrid; 	mso-list-template-ids:-524242322 67698705 -1969568504 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l0:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.75in; 	mso-level-number-position:left; 	margin-left:.75in; 	text-indent:-.25in;} @list l0:level2 	{mso-level-number-format:alpha-lower; 	mso-level-text:"%2\)"; 	mso-level-tab-stop:1.25in; 	mso-level-number-position:left; 	margin-left:1.25in; 	text-indent:-.25in; 	mso-ansi-font-weight:bold;} ol 	{margin-bottom:0in;} ul 	{margin-bottom:0in;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNormal" style="margin-bottom: 12pt; margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;1)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="color:navy;"&gt;Which standard converters have their own tags?&lt;/span&gt;&lt;/b&gt;&lt;span style="color:navy;"&gt;
DateTimeConverter and NumberConverter are two standard converters that have their own tags&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;convertDateTime&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;and&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;convertNumber&lt;/b&gt;respectively that help configuring the format of the component data by configuring tag attributes.&lt;/span&gt;
&lt;span style="color:navy;"&gt;
&lt;b style=""&gt;a.&lt;/b&gt; &lt;b&gt;DateTimeConverter :&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;A component data can be converted to a Date object using convertDateTime tag within the component tag like,&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-2-Xa0uf94uIsLFIX2_ixlwEsfI2eqooq247w09kwtEvkICAEvvWwQbx-cpbWE0dxfn4CidqRJVi-RoP3ULzw0RbwRqXNz4MYB8kGPQ8HX0lVWhgy6pqF7hHoaayCfc-XJ-gKvlLt41o/s1600-h/1a.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 51px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-2-Xa0uf94uIsLFIX2_ixlwEsfI2eqooq247w09kwtEvkICAEvvWwQbx-cpbWE0dxfn4CidqRJVi-RoP3ULzw0RbwRqXNz4MYB8kGPQ8HX0lVWhgy6pqF7hHoaayCfc-XJ-gKvlLt41o/s400/1a.JPG" alt="" id="BLOGGER_PHOTO_ID_5370251614000461490" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 12pt; margin-left: 0.75in; text-indent: -0.25in;"&gt;
&lt;span style="color:navy;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 12pt; margin-left: 0.5in;"&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;           &lt;/span&gt;&lt;/span&gt;&lt;img src="file:///C:/Documents%20and%20Settings/Administrator/Desktop/1a.JPG" alt="" /&gt;&lt;img src="file:///C:/Documents%20and%20Settings/Administrator/Desktop/1a.JPG" alt="" /&gt;&lt;/p&gt;  &lt;p style="margin: 6pt 6pt 6pt 0.5in;"&gt;&lt;b&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;       &lt;/span&gt;b. NumberConverter :&lt;/span&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="color:navy;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:navy;"&gt;Co&lt;/span&gt;&lt;span style="color:navy;"&gt;nverter for dealing with numbers such as type of &lt;span style=""&gt;   &lt;/span&gt;number,  maximum integer digits, currency symbol etc.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 6pt 6pt 6pt 0.5in;"&gt;
&lt;/p&gt;&lt;p style="margin: 6pt 6pt 6pt 0.5in;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPlxMCM32phP5YncvokUXCwLw5usLkjC7Rjx7WvfYSnOhbjAxjfSP0Hg9ifDA59_Vt8-p8kAbtvo106VuAJYJfIJ8ffzG_g8dCK73SJxlbTWLxG6b_TDmssxEgqJEBmyl0aMbvpszNYpM/s1600-h/1b.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 84px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPlxMCM32phP5YncvokUXCwLw5usLkjC7Rjx7WvfYSnOhbjAxjfSP0Hg9ifDA59_Vt8-p8kAbtvo106VuAJYJfIJ8ffzG_g8dCK73SJxlbTWLxG6b_TDmssxEgqJEBmyl0aMbvpszNYpM/s400/1b.JPG" alt="" id="BLOGGER_PHOTO_ID_5370252007039779298" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;2)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="color:navy;"&gt;What are the ways of using standard converters of JSF?
&lt;/span&gt;&lt;/b&gt;&lt;span style="color:navy;"&gt;Standard converters other than the two which have their own tags (DateTimeConverter and NumberConverter) can be used in one of the following three ways. The first one converts the model value of the component and the other two ways convert the component's local value. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span class="apple-converted-space"&gt;&lt;b style=""&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;a)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="color:navy;"&gt;Bind UI Component to Backing Bean Property :&lt;/span&gt;&lt;/b&gt;&lt;span style="color:navy;"&gt;
Make sure that the component has its value bound to a backing bean property of the same type as the converter. For example, converting component data to a float number requires binding the component to the property like :&lt;span class="apple-converted-space"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtnznBTXAfvvQvlM7bopQM_haGRmslpAx9oOAvIE81mKmGzdNfRW_OF9wA_J27jxLKelNwh-rjdiy6WsDswpTaE8gnz2UV18zdTV4C6bhCVBfI3Wbb3IjMKOtCTu2l3Y_n6huh05vnzt0/s1600-h/2a.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 65px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtnznBTXAfvvQvlM7bopQM_haGRmslpAx9oOAvIE81mKmGzdNfRW_OF9wA_J27jxLKelNwh-rjdiy6WsDswpTaE8gnz2UV18zdTV4C6bhCVBfI3Wbb3IjMKOtCTu2l3Y_n6huh05vnzt0/s400/2a.JPG" alt="" id="BLOGGER_PHOTO_ID_5370252271317724482" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-left: 1in;"&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="color:navy;"&gt;
&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in;"&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="color:navy;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style=""&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;b)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="color:navy;"&gt;Use “converter” attribute on the UI Component :&lt;/span&gt;&lt;/b&gt;&lt;span style="color:navy;"&gt;
Using the converter attribute of the component tag. Just specify the fully qualified class name or ID of the converter in the converter attribute. If the component is not bound to a bean property then this option can be used. For example,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 6pt 6pt 6pt 60pt;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqMeXM9lwiGradTeZ5VO9NwOnQc5ooreujNJLX_c7lLG4Eyhlqal85B6TsJxBY4hhU7_IWwSp-09Vy7P4HIBFgmIWRLXbp7oDajf2A4JHrpLVFvT5BjcEittqAYC8mi4IKL2dgTcxZk48/s1600-h/2b.JPG"&gt;     &lt;img style="cursor: pointer; width: 400px; height: 22px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqMeXM9lwiGradTeZ5VO9NwOnQc5ooreujNJLX_c7lLG4Eyhlqal85B6TsJxBY4hhU7_IWwSp-09Vy7P4HIBFgmIWRLXbp7oDajf2A4JHrpLVFvT5BjcEittqAYC8mi4IKL2dgTcxZk48/s400/2b.JPG" alt="" id="BLOGGER_PHOTO_ID_5370252520645104786" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style=""&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;c)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="color:navy;"&gt;Use &lt;f:converter&gt; Tag with ConverterId Attribute :&lt;/f:converter&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="color:navy;"&gt;
Using converter tag within the component tag and refer the converter by specifying the ID of the converter in the convertId attribute. For example:&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-left: 1.25in; text-indent: -0.25in;"&gt;
&lt;/p&gt;&lt;p class="MsoNormal" style="margin-left: 1.25in; text-indent: -0.25in;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixNwMM7iH9HGjMbX5MP7hlCS0fXnsOhuz9bqSyQGSSK3ontp-nIKnxFlu2YUzeJE8vBLCZ2ctFiMtcjI2_L08dpqSsdtmxMKqFE-dDbS7Li96FsEx8uDxX67KzMrVRODkC95I-1sAPMvw/s1600-h/2c.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 55px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixNwMM7iH9HGjMbX5MP7hlCS0fXnsOhuz9bqSyQGSSK3ontp-nIKnxFlu2YUzeJE8vBLCZ2ctFiMtcjI2_L08dpqSsdtmxMKqFE-dDbS7Li96FsEx8uDxX67KzMrVRODkC95I-1sAPMvw/s400/2c.JPG" alt="" id="BLOGGER_PHOTO_ID_5370252734028226578" border="0" /&gt;&lt;/a&gt;
&lt;span style="color:navy;"&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;                          &lt;/span&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1029" type="#_x0000_t75" style="'width:306.75pt;height:42pt'"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\01\clip_image005.jpg" title="2c"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;                            &lt;/span&gt;&lt;img src="file:///C:/Documents%20and%20Settings/Administrator/Desktop/2c.JPG" alt="" /&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;3)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="color:navy;"&gt;When to create and use custom convertors?
&lt;/span&gt;&lt;/b&gt;&lt;span style="color:navy;"&gt;The main reasons behind creating our converter are :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style=""&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;a)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;span style="color:navy;"&gt;When we want to convert a component's data to a type other than a standard type&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style=""&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;b)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;span style="color:navy;"&gt;When we want to convert the format of the data.

&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;4)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="color:navy;"&gt;What are the steps of creating and using custom converter in our application?
&lt;/span&gt;&lt;/b&gt;&lt;span style="color:navy;"&gt;Creating and using a custom converter requires the following steps :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 6pt 6pt 6pt 42pt;"&gt;&lt;span style="color:navy;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 6pt 6pt 6pt 42pt;"&gt;&lt;b&gt;&lt;span style="color:navy;"&gt;Steps to follow :&lt;/span&gt;&lt;/b&gt;&lt;span style="color:navy;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style=""&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;a)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;span style="color:navy;"&gt;Create a class that implements&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;javax.faces.converter.Converter&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;interface.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style=""&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;b)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;span style="color:navy;"&gt;Import necessary packages and classes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style=""&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;c)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;span style="color:navy;"&gt;Implement two abstract methods&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;"getAsObject()"&lt;/b&gt;,&lt;span class="apple-converted-space"&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;b&gt;"getAsString()"&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;provided by&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;Converter&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;interface.&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;getAsObject()&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/b&gt;method converts the String (User Input) to Object and&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;getAsString()&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;method converts the Object to String to send back to the page.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style=""&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;d)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;span style="color:navy;"&gt;Register the converter class in configuration file&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;(faces-config.xml)&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;adding&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;converter&gt;&lt;/converter&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;element. This element has child elements&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;converter-id&gt;&lt;/converter-id&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;(name of the converter to be used while programming )&lt;/b&gt;and&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;converter-class&gt;&lt;/converter-class&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;( name of the converter class which we have created)&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style=""&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;e)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;span style="color:navy;"&gt;Create&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;view&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;page where&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;f:converter&gt;&lt;/f:converter&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;tag is used with attribute&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;"converterId"&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;which specifies the name of the converter which we have specified in&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;converter-id&gt;&lt;/converter-id&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;element of&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;converter&gt;&lt;/converter&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;element in&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;"faces-config.xml"&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style=""&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;f)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;span style="color:navy;"&gt;Use&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;h:message&gt;&lt;/h:message&gt;&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;tag to display the error message.  &lt;!--[if !supportLineBreakNewLine]--&gt;  &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;5)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="color:navy;"&gt;What are the ways to register the custom converters in faces context?
&lt;/span&gt;&lt;/b&gt;&lt;span style="color:navy;"&gt;After creating custom converter class implementing Converter interface it needs to register in the faces context. This can be done in one of the two ways :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 12pt; margin-left: 1.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style=""&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;a)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;span style="color:navy;"&gt;Register the converter class with the id. This id is used in &lt;f:convertrer&gt; tag in our view page (For example, JSP).&lt;o:p&gt;&lt;/o:p&gt;&lt;/f:convertrer&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 12pt; margin-left: 1in;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7WklLB29VhcPYBYJJiVmoQWMgC5i80ykHed064ITu11S6M2a2w-oAEZHyLiz0RCKEV3YtziYXKOA281WF8u_73CjnnPm1W_JouzNOehqUreJ8CGzm0ntMNv8woCZx5zYjUH7B3BtVdn0/s1600-h/5a.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 101px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7WklLB29VhcPYBYJJiVmoQWMgC5i80ykHed064ITu11S6M2a2w-oAEZHyLiz0RCKEV3YtziYXKOA281WF8u_73CjnnPm1W_JouzNOehqUreJ8CGzm0ntMNv8woCZx5zYjUH7B3BtVdn0/s400/5a.JPG" alt="" id="BLOGGER_PHOTO_ID_5370252917378186130" border="0" /&gt;&lt;/a&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1030" type="#_x0000_t75" style="'width:304.5pt;height:77.25pt'"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\01\clip_image006.jpg" title="5a"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 12pt; margin-left: 1in;"&gt;&lt;span style="color:navy;"&gt;
&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 6pt 6pt 6pt 78pt; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style=""&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;b)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;              &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;span style="color:navy;"&gt;Use this converter in the view page as :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 6pt 6pt 6pt 60pt;"&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;          &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 6pt 6pt 6pt 60pt;"&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;          &lt;/span&gt;&lt;!--[if gte vml 1]&gt;&lt;v:shape id="_x0000_i1031" type="#_x0000_t75" style="'width:304.5pt;height:39.75pt'"&gt;  &lt;v:imagedata src="file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\01\clip_image007.jpg" title="5b"&gt; &lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;       &lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZbBLMMZIXXE-Qe0ykaLUAlvdfzT3nrqFmVegeQAvXyczBqogQz7kb62YYIkvNic0KLO03PtHFgMcn56xVDp0YW1aeF2mQxm3JSZEk2l0vFygSBRoAl3yy3ONV7NBnwwtSbU2atApbJaA/s1600-h/5b.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 52px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZbBLMMZIXXE-Qe0ykaLUAlvdfzT3nrqFmVegeQAvXyczBqogQz7kb62YYIkvNic0KLO03PtHFgMcn56xVDp0YW1aeF2mQxm3JSZEk2l0vFygSBRoAl3yy3ONV7NBnwwtSbU2atApbJaA/s400/5b.JPG" alt="" id="BLOGGER_PHOTO_ID_5370253053087492386" border="0" /&gt;&lt;/a&gt;&lt;span style="color:navy;"&gt;
&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 6pt 6pt 6pt 0in;"&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;                            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style=""&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;c)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;span style="color:navy;"&gt;Register the converter class to handle all "Email" objects, for example,  automatically.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-left: 1.25in; text-indent: -0.25in;"&gt;
&lt;/p&gt;                      &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNQh5YHOp0dGaMlcEEi0Oa_O37eTZieq-odBpfVFPJWOvLfqRH0qtKZBiEJeHp68iV59kIJ3ZeIaZ16_yZdVnyjP1_0vRulRXNpg2uOhwqSVwQujW-XD_O9jm_Ph_EMzP_MaTTZoXvtnM/s1600-h/5c.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 84px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNQh5YHOp0dGaMlcEEi0Oa_O37eTZieq-odBpfVFPJWOvLfqRH0qtKZBiEJeHp68iV59kIJ3ZeIaZ16_yZdVnyjP1_0vRulRXNpg2uOhwqSVwQujW-XD_O9jm_Ph_EMzP_MaTTZoXvtnM/s400/5c.JPG" alt="" id="BLOGGER_PHOTO_ID_5370253260413756706" border="0" /&gt;&lt;/a&gt; &lt;p style="margin: 6pt 6pt 6pt 78pt; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style=""&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;d)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;              &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;span style="color:navy;"&gt;If  we register the EmailConverter class to handle all Email objects automatically then there is no need to use the &lt;f:converter&gt; tag in view page. Use this converter as :&lt;/f:converter&gt;&lt;/span&gt;&lt;/p&gt;                        &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsiQZ-RVm01bKQ1i93O6ptJXI9i9JQastYLtKlaIbEMCSdx8EPueOge5vW6mAd9gsXPGmHdw9rYPE4BpfoeoJPDpAM1Sre4RHC_cWOF9msW49ug926PoA91cZ9NesH_sX-RnQCnRqtkXo/s1600-h/5d.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 52px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsiQZ-RVm01bKQ1i93O6ptJXI9i9JQastYLtKlaIbEMCSdx8EPueOge5vW6mAd9gsXPGmHdw9rYPE4BpfoeoJPDpAM1Sre4RHC_cWOF9msW49ug926PoA91cZ9NesH_sX-RnQCnRqtkXo/s400/5d.JPG" alt="" id="BLOGGER_PHOTO_ID_5370253453677310066" border="0" /&gt;&lt;/a&gt;  &lt;p style="margin: 6pt 6pt 6pt 0in;"&gt;&lt;span style="color:navy;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="color:navy;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="color:navy;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="color:navy;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  </description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-2-Xa0uf94uIsLFIX2_ixlwEsfI2eqooq247w09kwtEvkICAEvvWwQbx-cpbWE0dxfn4CidqRJVi-RoP3ULzw0RbwRqXNz4MYB8kGPQ8HX0lVWhgy6pqF7hHoaayCfc-XJ-gKvlLt41o/s72-c/1a.JPG" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>JSF Interview Question</title><link>http://javaspecialization.blogspot.com/2009/08/jsf-interview-question_5293.html</link><category>JSF Interview Question</category><author>noreply@blogger.com (Yash Vysya)</author><pubDate>Sat, 15 Aug 2009 21:43:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8981950642035125982.post-8125836802010646698</guid><description>&lt;meta equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 11"&gt;&lt;meta name="Originator" content="Microsoft Word 11"&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C13%5Cclip_filelist.xml"&gt;&lt;o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"&gt;&lt;/o:smarttagtype&gt;&lt;o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"&gt;&lt;/o:smarttagtype&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" latentstylecount="156"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if !mso]&gt;&lt;object classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id="ieooui"&gt;&lt;/object&gt; &lt;style&gt; st1\:*{behavior:url(#ieooui) } &lt;/style&gt; &lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman";} a:link, span.MsoHyperlink 	{color:blue; 	text-decoration:underline; 	text-underline:single;} a:visited, span.MsoHyperlinkFollowed 	{color:purple; 	text-decoration:underline; 	text-underline:single;} p 	{mso-margin-top-alt:auto; 	margin-right:0in; 	mso-margin-bottom-alt:auto; 	margin-left:0in; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman";} span.apple-converted-space 	{mso-style-name:apple-converted-space;} span.klink 	{mso-style-name:klink;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:100686105; 	mso-list-template-ids:-1266668770;} @list l0:level1 	{mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l0:level2 	{mso-level-tab-stop:1.0in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l1 	{mso-list-id:538472028; 	mso-list-template-ids:1343373012;} @list l1:level1 	{mso-level-tab-stop:.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l1:level2 	{mso-level-tab-stop:1.0in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l1:level3 	{mso-level-number-format:alpha-lower; 	mso-level-tab-stop:1.5in; 	mso-level-number-position:left; 	text-indent:-.25in;} @list l2 	{mso-list-id:986741518; 	mso-list-type:hybrid; 	mso-list-template-ids:-524242322 67698705 -1969568504 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l2:level1 	{mso-level-text:"%1\)"; 	mso-level-tab-stop:.75in; 	mso-level-number-position:left; 	margin-left:.75in; 	text-indent:-.25in;} @list l2:level2 	{mso-level-number-format:alpha-lower; 	mso-level-text:"%2\)"; 	mso-level-tab-stop:1.25in; 	mso-level-number-position:left; 	margin-left:1.25in; 	text-indent:-.25in; 	mso-ansi-font-weight:bold;} @list l3 	{mso-list-id:1016999995; 	mso-list-template-ids:264906060;} @list l3:level1 	{mso-level-number-format:alpha-lower; 	mso-level-text:"%1\)"; 	mso-level-tab-stop:1.0in; 	mso-level-number-position:left; 	margin-left:1.0in; 	text-indent:-.25in;} ol 	{margin-bottom:0in;} ul 	{margin-bottom:0in;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;1)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="color:navy;"&gt;What does component mean and what are its types?
&lt;/span&gt;&lt;/b&gt;&lt;span style="color:navy;"&gt;Components in JSF are elements like text box, button, table etc. that are used to create user interfaces of JSF Applications. These are objects that manage interaction with a user. Components help&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="klink"&gt;&lt;u&gt;&lt;span style="color:blue;"&gt;developers&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="color:navy;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:navy;"&gt;to create UIs by assembling a number of components , associating them with object properties and event handlers. Would u like to repeat the same code again &amp;amp; again and waste time if u want to create many tables in hundreds of pages in your web application? Not at all. Once you create a component, it’s simple to drop that component onto any&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="klink"&gt;&lt;u&gt;&lt;span style="color:blue;"&gt;JSP&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style="color:navy;"&gt;. Components in JSF are of two types :&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ol start="1" type="1"&gt;&lt;ol start="1" type="1"&gt;&lt;li class="MsoNormal" color="navy"&gt;&lt;b&gt;Simple Components&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;like text box, button and&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: navy;"&gt;&lt;b&gt;Compound Components&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/b&gt;like table, data grid etc.&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;  &lt;p style="margin: 6pt 6pt 6pt 0.75in;"&gt;&lt;span style="color:navy;"&gt;A component containing many components inside it is called a&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;compound component&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 6pt 6pt 6pt 24pt; text-indent: 30pt;"&gt;&lt;span style="color:navy;"&gt;JSF allows you to create and use components of two types:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 6pt 6pt 6pt 1in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;a)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="color:navy;"&gt;Standard UI Components:
&lt;/span&gt;&lt;/b&gt;&lt;span style="color:navy;"&gt;JSF contains its basic set of  UI components like text box, check box, list boxe, button, label, radio button, table, panel etc. These are called standard components.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;b)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="color:navy;"&gt;Custom UI Components:
&lt;/span&gt;&lt;/b&gt;&lt;span style="color:navy;"&gt;Generally UI designers need some different , stylish components like fancy calendar, tabbed panes . These types of components are not standard JSF components. JSF provides this additional facility to let you create and use  your own set of reusable components. These components are called custom components.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;2)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="color:navy;"&gt;What are third party components and how they are useful?
&lt;/span&gt;&lt;/b&gt;&lt;span style="color:navy;"&gt;One of the greatest power of JSF is to support third party components . Third party components are custom components created by another vendor. Several components are available in the market, some of them are commercial and some are&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="klink"&gt;&lt;u&gt;&lt;span style="color:blue;"&gt;open&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;span class="klink"&gt;&lt;u&gt;&lt;span style="color:blue;"&gt;source&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="color:navy;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:navy;"&gt;. These pre-built &amp;amp; enhanced components can be used in UI of your web application. For example, we are in need of a stylish calendar then we have an option to take it from third party rather than creating it our own. This will help saving time &amp;amp; cost creating effective &amp;amp; robust UI and to concentrate on business logic part of web application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;3)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="color:navy;"&gt;What are tags in JSF ?&lt;/span&gt;&lt;/b&gt;&lt;span style="color:navy;"&gt;
JSF application typically uses JSP pages to represent views. JSF provides useful special tags to enhance these views. Each tag gives rise to an associated component. JSF (Sun Implementation) provides 43 tags in two standard JSF tag libraries:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style=""&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;a)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="color:navy;"&gt;JSF Core Tags&lt;/span&gt;&lt;/b&gt;&lt;span style="color:navy;"&gt; &lt;span class="apple-converted-space"&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;b&gt;Library&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 1.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style=""&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;b)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="color:navy;"&gt;JSF Html Tags Library&lt;/span&gt;&lt;/b&gt;&lt;span style="color:navy;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 6pt 6pt 6pt 42pt;"&gt;&lt;span style="color:navy;"&gt;Even a very simple page uses tags from both libraries. These tags can be used adding the following lines of code at the head of the page.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin: 6pt 6pt 6pt 42pt;"&gt;&lt;span style="color:navy;"&gt;&lt;%@ taglib uri=”&lt;a href="http://java.sun.com/jsf/core"&gt;&lt;span style="color: rgb(0, 0, 170);"&gt;http://java.sun.com/jsf/core&lt;/span&gt;&lt;/a&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;“ prefix=”f” %&gt; (For Core Tags)
&lt;%@ taglib uri=”&lt;a href="http://java.sun.com/jsf/html"&gt;&lt;span style="color: rgb(0, 0, 170);"&gt;http://java.sun.com/jsf/html&lt;/span&gt;&lt;/a&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;“ prefix=”h” %&gt; (For Html Tags)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;4)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="color:navy;"&gt;What is the difference between JSP and JSF?
&lt;/span&gt;&lt;/b&gt;&lt;span style="color:navy;"&gt;JSP simply provides a Page which may contain markup,&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="klink"&gt;&lt;u&gt;&lt;span style="color:blue;"&gt;embedded&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;span class="klink"&gt;&lt;u&gt;&lt;span style="color:blue;"&gt;Java&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="color:navy;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:navy;"&gt;code, and tags which encapsulate more complicated logic / html.&lt;span class="apple-converted-space"&gt; &lt;/span&gt;
JSF may use JSP as its template, but provides much more. This includes validation, rich component model and lifecycle, more sophisticated EL, separation of data, navigation handling, different view&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="klink"&gt;&lt;u&gt;&lt;span style="color:blue;"&gt;technologies&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span class="apple-converted-space"&gt;&lt;span style="color:navy;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:navy;"&gt;(instead of JSP), ability to provide more advanced features such as &lt;st1:city st="on"&gt;&lt;st1:place st="on"&gt;AJAX&lt;/st1:place&gt;&lt;/st1:city&gt;, etc.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="color:navy;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.75in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="color:navy;"&gt;&lt;span style=""&gt;5)&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="color:navy;"&gt;Which type of converters can we use in our application?
&lt;/span&gt;&lt;/b&gt;&lt;span style="color:navy;"&gt;A JSF application can use two types of converters :&lt;span class="apple-converted-space"&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ol start="1" type="1"&gt;&lt;ol start="1" type="1"&gt;&lt;li class="MsoNormal" style="color: navy;"&gt;&lt;b&gt;JSF standard       Converters&lt;/b&gt;
     JSF supplies built-in converters known as standard converters. All       standard converters implements&lt;b&gt;javax.faces.convert.Converter&lt;/b&gt;&lt;span class="apple-converted-space"&gt; &lt;/span&gt;interface. These converter       classes are listed below :&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;ol start="1" type="a"&gt;&lt;li class="MsoNormal" style="color: navy;"&gt;BigDecimalConverter&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: navy;"&gt;BigIntegerConverter&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: navy;"&gt;BooleanConverter&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: navy;"&gt;ByteConverter&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: navy;"&gt;CharacterConverter&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: navy;"&gt;DateTimeConverter&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: navy;"&gt;DoubleConverter&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: navy;"&gt;FloatConverter&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: navy;"&gt;IntegerConverter&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: navy;"&gt;LongConverter&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: navy;"&gt;NumberConverter&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: navy;"&gt;ShortConverter&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li class="MsoNormal" style="color: navy;"&gt;&lt;b&gt;Custom Converter
     &lt;/b&gt;Custom data converter is useful in in converting field data into an       application-specific value object. For example,&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;ol start="1" type="a"&gt;&lt;li class="MsoNormal" style="color: navy;"&gt; String to User        object.&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="color: navy;"&gt; String to        Product object    etc.&lt;o:p&gt;&lt;/o:p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;/ol&gt;  </description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>JSF Interview Question</title><link>http://javaspecialization.blogspot.com/2009/08/jsf-interview-question.html</link><category>JSF Interview Question</category><author>noreply@blogger.com (Yash Vysya)</author><pubDate>Sat, 15 Aug 2009 01:36:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8981950642035125982.post-1372996687278193112</guid><description>&lt;span class="Apple-style-span"  style=" color: rgb(0, 0, 128); font-family:'times new roman';"&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;A) What is JSF (Java Server Faces)?
&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:100%;color:#000080;"&gt;JavaServer Faces (JSF) is an application framework containing a rich and robust set of APIs and JSP custom tag libraries to simplify creating user interfaces for web based Java applications. Set of APIs represent user interface components and are responsible for managing their state, handling events, validating input. APIs also define page navigation, internationalization and accessibility. JSF includes  JSP custom tag library for including JSF interface within a JSP page. &lt;/span&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt; &lt;span style="font-size:100%;color:#000080;"&gt;So JSF offers a flexible and extensible architecture that makes &lt;span style="color:#000080;"&gt;easy creating reusable, complex server side UI components without limiting developer&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000080;"&gt; to a particular mark-up language, protocol, or client device by combining the UI component functionality with custom renderers.&lt;/span&gt;&lt;span style="font-size:100%;color:#000080;"&gt; Here extensible means additional functionality can be given on the top of JSF core i.e. we can customize the functionality and reusable stands for being able to add and reuse components many times in the page.  &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="font-size:100%;color:#000080;"&gt;In the past many  web development frameworks came in to existence founded on servlet and jsp. Struts emerged as a standard web application framework. It became framework of choice because it came early in the market and provided  necessary features at the time but competitors continued providing  additional features that struts lacks. So it became necessary for java to advent new standard framework with a powerful component model. This was the reason for developing JSF technology. So main purpose of developing JSF was to create a collection of APIs for the UI components with the capacity to manage their states, handle events and validation. So JSF can be think of a combination of two frameworks, Struts and Swing. Struts is a popular open source JSP-based Web application framework and Swing is a standard Java user interface framework for desktop applications. Like Struts, JSF provides Web application lifecycle management through a controller servlet (FacesServlet) and like Swing, JSF provides a rich component model complete with event handling and component rendering. JSF also ensures that applications are well designed with greater maintainability by integrating the well established Model-View-Controller (MVC) design pattern into its architecture. So it &lt;span style="color:#000080;"&gt;clearly separates behavior (Model) and presentation (View) in an application.&lt;/span&gt; &lt;span style="color:#000080;"&gt;This  separation enables a wide range of users &lt;b&gt;Page authors(&lt;/b&gt;web-page designers), &lt;b&gt;Application developers&lt;/b&gt;, &lt;b&gt;Component writers&lt;/b&gt;, &lt;b&gt;Application architects &lt;/b&gt;, &lt;b&gt;Tool vendors&lt;/b&gt; and allows members of team to focus on their own work only , resulting in division of labor and shorter development cycle. &lt;/span&gt;JSF&lt;span style="color:#000080;"&gt; has been developed by Java Community Process(JCP) that is a community of web application experts from different groups like Jakarta Struts, Oracle, Sun, IBM, ATG etc. They all collectively worked together to take the best from existing technologies and removed problems. So their collective effort brought a new technology named Java Server Faces (JSF).

Facts about JSF can be summarized as below :&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;JSF is standard web UI server side component framework for Java.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;Built on top of Servlet API.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;UI components are stored on the server.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;Easy use of third party components.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;Event driven programming model.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;Events generated by user are handled on the  server.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;Navigation handling.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;Can automatically synchronize UI components .&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;JSF supports multiple client devices.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;JSF has extensible architecture.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;International language support.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;Extensive tool support (Sun, Oracle , IBM etc.).&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;Rapid application Development approach.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;b&gt;&lt;span style="color:#000080;"&gt;B) What is the significance of MVC model in JSF?
&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:100%;color:#000080;"&gt; JSF ensures that applications are well designed with greater maintainability by integrating the well established Model-View-Controller (MVC) design pattern into its architecture. So it &lt;span style="color:#000080;"&gt;clearly separates behavior (&lt;b&gt;Model&lt;/b&gt;) and presentation of data (&lt;b&gt;View&lt;/b&gt;) in an application. &lt;b&gt;UI components&lt;/b&gt; represent&lt;b&gt;View&lt;/b&gt; (Typically in &lt;b&gt;JSP&lt;/b&gt;), &lt;b&gt;managed beans&lt;/b&gt; represent &lt;b&gt;Model&lt;/b&gt; and &lt;b&gt;FacesServlet&lt;/b&gt; is the &lt;b&gt;Controller&lt;/b&gt; in the JSF framework. All the requests are handled by this controller. Any request passes through and examined by FacesServlet that calls various actions on the model (managed beans). The separation of behavior and presentation enables a wide range of users &lt;b&gt;Page authors(&lt;/b&gt; web-page designers), &lt;b&gt;Application developers&lt;/b&gt;, &lt;b&gt;Component writers&lt;/b&gt;,&lt;b&gt;Application architects &lt;/b&gt;, &lt;b&gt;Tool vendors&lt;/b&gt; and allows members of team to focus on their own work only , resulting in division of labor and shorter development cycle.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;C) Which plays role of controller in JSF?
&lt;/b&gt;&lt;/span&gt;&lt;span style="color:#000080;"&gt;JSF&lt;/span&gt;&lt;span style="font-size:100%;color:#000080;"&gt; integrates the well established Model-View-Controller (MVC) design pattern into its architecture. The purpose of MVC is to &lt;span style="color:#000080;"&gt;separate data (Model) and presentation of data (View) in an application. User requests are handled centrally by the controller that might result in changes in the model and views.  In JSF, &lt;b&gt;UI components&lt;/b&gt; represent &lt;b&gt;View layer&lt;/b&gt; and &lt;b&gt;managed beans&lt;/b&gt; represent &lt;b&gt;Model&lt;/b&gt;. &lt;b&gt;FacesServlet&lt;/b&gt; is the &lt;b&gt;Controller&lt;/b&gt; in the JSF framework. All the requests are handled by this controller. Any request passes through and examined by FacesServlet that calls various actions on the model (managed beans).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style="color:#000080;"&gt;D) What is JSF life cycle and its phases?
&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000080;"&gt;The series of steps followed by an application is called its life cycle. A JSF application typically follows six steps in its life.
&lt;/span&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-size:100%;color:#000080;"&gt;Restore view phase &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;color:#000080;"&gt;Apply request values phase&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;color:#000080;"&gt;Process validations phase&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;color:#000080;"&gt;Update model values phase&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;color:#000080;"&gt;Invoke application phase&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;color:#000080;"&gt;Render response phase&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;b&gt;E) What is the role of Renderer in JSF? and justify the statement "JSF supports multiple client devices".
&lt;/b&gt;After creating JSF components, it is also necessary&lt;span&gt;  &lt;/span&gt;for each component to be rendered to the client so that it can be visible to the client’s device. Each of the tag gives rise to an associated component. A renderer is a type of class that is responsible for encoding and decoding components. Encoding displays the component while decoding translates the user’s input into components value i.e. transform it into values the component can understand.
Now a days there are many devices that are web enabled. So application developers have challenge to develop components that can work across various platforms. For example, if we have an application that works on standard web browser and we want to extend it to make it enable to work on a WAP device. So, to handle this case we need components to be rendered in more than one way. Here JSF can be helpful. This is a simple task for JSF. The solution is to develop separate renderers for the component. JSF components use different renderers depending on the device used.&lt;/div&gt;&lt;div&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;F) What is Render Kit in JSF?
&lt;/b&gt;Component classes generally transfer the task of generating output to the renderer. All JSF components follow it. Render kit is a set of related renderers. &lt;b&gt;javax.faces.render.RenderKit &lt;/b&gt;is the class which represents the render kit. The default render kit contains renderers for html but it’s up to you to make it for other markup languages. Render kit can implement a skin (a look &amp;amp; feel). Render kit can target a specific device like phone, PC or markup language like HTML, WML, SVG. This is one of the best benefit of  JSF because JSF doesn't limit to any device or markup.&lt;/div&gt;&lt;div&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;G) What is conversion and validation? and how are they related?
&lt;/b&gt;This is one of the phase of JSF life cycle that happens before binding the component data to the related backing bean in the Update model values phase. &lt;b&gt;
&lt;/b&gt;Conversion is the process of transforming the component data from String to Java objects and vice versa. For example, an user enters a value (String) in an input component and this value is to store in a Date field in the backing bean then this String value is converted to a java.util.Date value when request is sent to the server and vice versa. This process is called Conversion.
Validation is the process of ensuring data contains the expected content. For example, checking the Date value is in MM./dd/YYYY format or any integer value is between 1 to 10.
The main purpose of conversion and validation is to ensure the values are of correct type and following the required criteria before updating model data. So this step allows you to focus on business logic rather than working on tedious qualifications of input data such as null checks, length qualifiers, range boundaries, etc.&lt;/div&gt;&lt;div&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;H) When automatic conversion is supplied by JSF Implementation?&lt;/b&gt;
JSF implementation automatically converts component data between presentation view and model when the bean property associated with the component is of one of the types supported by the component's data.
For example, If a UISelectBoolean component is associated with a bean property of type Boolean, then JSF implementation will automatically convert the data from String to Boolean.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;
&lt;/div&gt;&lt;div&gt;&lt;span style="font-size:100%;color:#000080;"&gt;&lt;b&gt;I) Who are the users of JSF technology?
&lt;/b&gt;&lt;span style="color:#000080;"&gt;JSF is that it has not only been designed for coding experts but for others also Page authors, Component writers etc. &lt;/span&gt;Because of integrating MVC model and flexible in its architecture JSF allows a wide range of users :
&lt;/span&gt;&lt;ol start="1" type="1"&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Page authors :&lt;/b&gt;
Web designers have experience with graphic design. They can design look and feel of web application in html/jsp using custom tag libraries of JSF. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Application developers :&lt;/b&gt;
Application developers can integrate this design with UI components. They program objects, event handling, converters, validators.

&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Component writers :&lt;/b&gt;
Component developer can build custom UI components because of JSF’s extensible and customizable nature. They can create their own components directly from UI component classes or extending the standard components of JSF. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Application architects : &lt;/b&gt;
Application architects are responsible for designing web applications. Defining page navigation, ensuring Scalability of application, configuring beans object registration are the key points that an application architect handles. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Tool vendors :&lt;/b&gt;
JSF is well suited for tool vendors, for example &lt;b&gt;Sun Java Studio Creator&lt;/b&gt; application development tool, who provide tools that take advantages of JSF to create UI easier.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;span style="font-size:100%;color:#000080;"&gt;&lt;b&gt;J) What are JSF releases?&lt;/b&gt;&lt;/span&gt;&lt;span style="color:#000080;"&gt;
JSF started its journey from version 1.0 and now it has come to its latest version JSF1.2. The listing of versions released so far is :
&lt;/span&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;JSF 1.2&lt;/b&gt; (11 may &lt;b&gt;2006&lt;/b&gt;) - &lt;b&gt;   &lt;/b&gt; &lt;b&gt;Latest release of JSF specification.&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;JSF 1.1&lt;/b&gt; (27 may &lt;b&gt;2004&lt;/b&gt;) - &lt;b&gt;   &lt;/b&gt; &lt;b&gt;Bug fix release. No specification changes. No HTML renderkit changes.&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;JSF 1.0&lt;/b&gt; (11 mar &lt;b&gt;2004&lt;/b&gt;) - &lt;b&gt;   &lt;/b&gt; &lt;b&gt;Initial release&lt;/b&gt; &lt;b&gt;of JSF specification.&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;There are many releases of 1.1 and 1.2 and these are listed below showing released date also:&lt;/span&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;1.2_04 P01&lt;/b&gt;  (20 Mar &lt;b&gt;2007&lt;/b&gt;)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;1.2_04  &lt;/b&gt;       (5 Mar &lt;b&gt;2007&lt;/b&gt;)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;1.2_02 &lt;/b&gt;        (25 Aug &lt;b&gt;2006&lt;/b&gt;)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;1.2_01&lt;/b&gt;         (14 July &lt;b&gt;2006&lt;/b&gt;)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;1.1_02&lt;/b&gt;         (24 Apr &lt;b&gt;2006&lt;/b&gt;)   &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;1.1_01&lt;/b&gt;         (07 Sep &lt;b&gt;2004&lt;/b&gt;)&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;
&lt;/div&gt;&lt;div&gt;&lt;p align="left" style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="font-size:100%;color:#000080;"&gt;&lt;b&gt;K) How JSF Fits For Web Applications?&lt;/b&gt;
&lt;span style="color:#000080;"&gt;JSF has many  advantages over other existing frameworks that makes it a better choice for Java web application development. Some of the reasons are below:
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:100%;color:#000080;"&gt;&lt;ol&gt;&lt;li&gt;&lt;b&gt;Easy creation of UI:&lt;/b&gt;
It makes easier to create complex UI for an applicaton using jsf tags.Its APIs are layered directly on  top of servlet APIs that enables us to use  presentation technology other than JSP,creating your own custom components and rendering output for various client devices.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Capacity to handle complexities of UI management: &lt;/b&gt;
It handles cleanly the complexities of UI management like input validation, component-state management, page navigation, and event handling.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Clean separation between presentation and logic:&lt;/b&gt;
One of the greatest advantage of jsf is to clearly separate behaviour and presentation in an application. JSF is based on the Model View Controller (MVC) architecture&lt;/li&gt;&lt;li&gt;&lt;b&gt;Shorter development cycle:&lt;/b&gt;
This  separation between logic and presentation enables a wide range of users( from web-page designers to component developers). It allows members of team to focus on their own work only , resulting in division of labour and shorter development cycle.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Standard Java framework:&lt;/b&gt;
JSF is a Java standard which is being developed through Java Community Process (JCP). Several prominent tool vendors are members of the group and are committed  to provide easy to use, visual, and productive develop environments for JavaServer Faces.&lt;/li&gt;&lt;li&gt;&lt;b&gt;An extensible architecture:
&lt;/b&gt;JSF architecture has been designed to be extensible.Extensible means additional functionality can be given on the top of JSF core i.e. we can customize the functionality. JSF UI components are customizable and reusable elements. You can extend standard components and create your own complex  components like stylish calendar, menu bar etc.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Support for multiple client devices:&lt;/b&gt;
Component developers can extend the component classes to generate their own component tag libraries to support specific client. JSF flexible and extensible architecture allows developers to do so.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Flexible rendering model:&lt;/b&gt;
Renderer separates the functionality and view of the component. So we can create multiple renderers and give them different functionality to get different appearance of the same component for the same client or different .&lt;/li&gt;&lt;li&gt;&lt;b&gt;International language support:&lt;/b&gt;
Java has excellent support for internationalization . It allows you to localize messages  with user specific locale. A locale is a combination of a country, a language, and a variant code. Java Server Faces adopts this property and let you specify which locale your application supports. So you can display you messages in different languages.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Robust tool support:&lt;/b&gt;
There are several standard tool vendors like Sun Java Studio Creator who provide robust tools that take advantages of JSF to create server side UI  easily.&lt;/li&gt;&lt;/ol&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Struts Interview Questions</title><link>http://javaspecialization.blogspot.com/2009/08/struts-interview-questions_5463.html</link><category>Struts Interview Questions</category><author>noreply@blogger.com (Yash Vysya)</author><pubDate>Sat, 15 Aug 2009 00:46:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8981950642035125982.post-2888565750731326546</guid><description>&lt;span class="Apple-style-span"  style=" color: rgb(0, 0, 128); line-height: 24px; font-family:'times new roman';"&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Question:&lt;/b&gt; Can I setup Apache Struts to use multiple configuration files?
&lt;b&gt;Answer:&lt;/b&gt; Yes Struts can use multiple configuration files. Here is the configuration example:
&lt;servlet&gt;
     &lt;servlet-name&gt;banking&lt;/servlet-name&gt;
     &lt;servlet-class&gt;org.apache.struts.action.ActionServlet
     &lt;/servlet-class&gt;
     &lt;init-param&gt;
     &lt;param-name&gt;config&lt;/param-name&gt;
&lt;/init-param&gt;&lt;/servlet&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color:#0000FF;"&gt;        &lt;param-value&gt;/WEB-INF/struts-config.xml,
             /WEB-INF/struts-authentication.xml,
             /WEB-INF/struts-help.xml
        &lt;/param-value&gt;
&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000080;"&gt; 
 &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:'times new roman';color:#000080;"&gt;&lt;span class="Apple-style-span" style="line-height: 24px;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:'times new roman';color:#000080;"&gt;&lt;span class="Apple-style-span" style="line-height: 24px;"&gt;&lt;span class="Apple-style-span" style="line-height: normal; "&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Question:&lt;/b&gt; What are the disadvantages of &lt;/span&gt;Struts&lt;span style="color:#000080;"&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;b&gt;a) High Learning Curve
&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 style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;b) Harder to learn&lt;/b&gt;
Struts are harder to learn, benchmark and optimize.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Question:&lt;/b&gt; What is Struts Flow?
&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" style="color: rgb(0, 0, 170); "&gt;http://struts.sourceforge.net/struts-flow/index.html&lt;/a&gt; )&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Question:&lt;/b&gt; What are the difference between &lt;bean:message&gt; and &lt;bean:write&gt;?
&lt;b&gt;Answer:&lt;/b&gt; &lt;b&gt;&lt;bean:message&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;b&gt;&lt;bean:write&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 programers to easily present the data.&lt;/bean:write&gt;&lt;/bean:write&gt;&lt;/bean:message&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Question:&lt;/b&gt; What is LookupDispatchAction?
&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" style="color: rgb(0, 0, 170); "&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 style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Question:&lt;/b&gt; What are the components of Struts?
&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;b&gt;Model: &lt;/b&gt;Components like business logic / business processes and data are the part of Model.
&lt;b&gt;View: JSP, &lt;/b&gt;HTML etc. are part of View
&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 style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Question:&lt;/b&gt; What are Tag Libraries provided with Struts?
&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;b&gt;a) Bean Tags:&lt;/b&gt; Bean Tags are used to access the beans and their properties.
&lt;b&gt;b) HTML Tags: HTML's&lt;/b&gt; provides tags for creating the view components like forms, buttons, etc..
&lt;b&gt;c) Logic Tags:&lt;/b&gt; Logic Tags provides presentation logics that eliminate the need for scriptlets.
&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;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Question:&lt;/b&gt; What are the core classes of the Struts Framework?
&lt;b&gt;Answer:&lt;/b&gt; &lt;/span&gt;&lt;span style="color:#000080;"&gt;Core classes of Struts Framework are ActionForm, Action, ActionMapping, ActionForward, ActionServlet etc.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Question:&lt;/b&gt; What are difference between ActionErrors and ActionMessage?
&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.
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 style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&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 style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Question:&lt;/b&gt; How you will handle exceptions in Struts?
&lt;b&gt;Answer:&lt;/b&gt; In Struts you can handle the exceptions in two ways:
&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;b&gt;Example:&lt;/b&gt;&lt;/span&gt;
&lt;span style="color:#000080;"&gt;&lt;exception&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/exception&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;      key="database.error.duplicate"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;      path="/UserExists.jsp"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;      type="mybank.account.DuplicateUserException"/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&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 style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;
&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;We welcome your's suggestion &lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Struts Interview Questions</title><link>http://javaspecialization.blogspot.com/2009/08/struts-interview-questions_14.html</link><category>Struts Interview Questions</category><author>noreply@blogger.com (Yash Vysya)</author><pubDate>Sat, 15 Aug 2009 00:43:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8981950642035125982.post-8686106562744939037</guid><description>&lt;span class="Apple-style-span"  style=" color: rgb(0, 0, 128); font-family:'times new roman';"&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Question: What is RequestProcessor and RequestDispatcher?
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.

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;b&gt;The ActionServlet Class
The RequestProcessor Class
The Action Class&lt;/b&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.
The controller is implemented by the ActionServlet class. All incoming requests are mapped to the central controller in the deployment descriptor as follows.
&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&lt;servlet&gt;
           &lt;servlet-name&gt;action&lt;/servlet-name&gt;
           &lt;servlet-class&gt;org.apache.struts.action.ActionServlet&lt;/servlet-class&gt;
&lt;/servlet&gt;&lt;/span&gt;&lt;span style="color:#000080;"&gt;


All request URIs with the pattern *.do are mapped to this servlet in the deployment descriptor as follows.

&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&lt;servlet-mapping&gt;
&lt;servlet-name&gt;action&lt;/servlet-name&gt;
       &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;
       &lt;url-pattern&gt;*.do&lt;/url-pattern&gt;&lt;/servlet-mapping&gt;&lt;/span&gt;&lt;span style="color:#000080;"&gt;
A request URI that matches this pattern will have the following form.
&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;http://www.java.com/mycontext/actionName.do&lt;/span&gt;&lt;span style="color:#000080;"&gt;

The preceding mapping is called extension mapping, however, you can also specify path mapping where a pattern ends with /* as shown below.
&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&lt;servlet-mapping&gt;
   &lt;servlet-name&gt;action&lt;/servlet-name&gt;
   &lt;url-pattern&gt;/do/*&lt;/url-pattern&gt;
&lt;url-pattern&gt;*.do&lt;/url-pattern&gt;&lt;/servlet-mapping&gt;&lt;/span&gt;&lt;span style="color:#000080;"&gt;
A request URI that matches this pattern will have the following form.
http://www.my_site_name.com/mycontext/do/action_Name
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.

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;/span&gt;&lt;span style="color:#0000FF;"&gt;public ActionForward execute(ActionMapping mapping,
           ActionForm form, HttpServletRequest request, HttpServletResponse response)    throws Exception; &lt;/span&gt;&lt;span style="color:#000080;"&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.

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;/span&gt;&lt;span style="color:#0000FF;"&gt;&lt;action&gt;
       path= "/somerequest"
       type="com.somepackage.someAction"
       scope="request"
       name="someForm"
       validate="true"
       input="somejsp.jsp"
   &lt;forward name="Success" path="/action/xys" redirect="true"&gt;
   &lt;forward name="Failure" path="/somejsp.jsp" redirect="true"&gt;
&lt;/forward&gt;&lt;/forward&gt;&lt;/action&gt;&lt;/span&gt;&lt;span style="color:#000080;"&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;/span&gt;&lt;span style="color:#0000FF;"&gt;&lt;action&gt;
       path= "/somerequest"
       type="com.somepackage.someAction"
       scope="request"
       name="someForm"
       validate="true"
       input="somejsp.jsp"
   &lt;forward name="Success" path="/action/xys" redirect="true"&gt;
   &lt;forward name="Failure" path="/somejsp.jsp" redirect="true"&gt;
&lt;/forward&gt;&lt;/forward&gt;&lt;/action&gt;&lt;/span&gt;&lt;span style="color:#000080;"&gt;
The action forward mappings also can be specified in a global section, independent of any specific action mapping.
&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;&lt;global-forwards&gt;
   &lt;forward name="Success" path="/action/somejsp.jsp"&gt;
   &lt;forward name="Failure" path="/someotherjsp.jsp"&gt;
&lt;/forward&gt;&lt;/forward&gt;&lt;/global-forwards&gt;&lt;/span&gt;&lt;span style="color:#000080;"&gt;

&lt;b&gt;public interface RequestDispatcher&lt;/b&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.
This interface is intended to wrap servlets, but a servlet container can create RequestDispatcher objects to wrap any type of resource.

&lt;b&gt;getRequestDispatcher&lt;/b&gt;

&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;public RequestDispatcher getRequestDispatcher(java.lang.String path)&lt;/span&gt;&lt;span style="color:#000080;"&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.
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;b&gt;Parameters:
   path - a String specifying the pathname to the resource
Returns:
   a RequestDispatcher object that acts as a wrapper for the resource at the specified path
See Also:
   RequestDispatcher, getContext(java.lang.String)&lt;/b&gt;

getNamedDispatcher

&lt;/span&gt;&lt;span style="color:#0000FF;"&gt;public RequestDispatcher getNamedDispatcher(java.lang.String name)&lt;/span&gt;&lt;span style="color:#000080;"&gt;

Returns a RequestDispatcher object that acts as a wrapper for the named servlet.
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().
This method returns null if the ServletContext cannot return a RequestDispatcher for any reason.

&lt;b&gt;Parameters:
   name - a String specifying the name of a servlet to wrap
Returns:
   a RequestDispatcher object that acts as a wrapper for the named servlet
See Also:
   RequestDispatcher, getContext(java.lang.String), ServletConfig.getServletName()&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:'times new roman';color:#000080;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:'times new roman';color:#000080;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:'times new roman';color:#000080;"&gt;&lt;b&gt;-----------------------------------------------------------------------------------------------------------------------------------------------------------&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:'times new roman';color:#000080;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:'times new roman';color:#000080;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Question: Why cant we overide create method in StatelessSessionBean?
Answer:&lt;/b&gt;  &lt;/span&gt;&lt;span style="color:#000080;"&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;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Question: Is struts threadsafe?Give an example?
Answer:&lt;/b&gt;  &lt;/span&gt;&lt;span style="color:#000080;"&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;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Question: Can we Serialize static variable?
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
1. Serialization ignores static fields, because they are not part of any particular object's state.
2. Base class fields are only handled if the base class itself is serializable.
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:#000080;"&gt;Implement the Serializable interface.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&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:#000080;"&gt;Make sure that superclass state is serialized properly.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color:#000080;"&gt;Override equals( )and hashCode( ).
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" style="color: rgb(0, 0, 170); "&gt;http://www.oreilly.com/catalog/javarmi/chapter/ch10.html&lt;/a&gt;)
 &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Question: What are the uses of tiles-def.xml file, resourcebundle.properties file, validation.xml file?
Answer:  &lt;/b&gt;&lt;/span&gt;&lt;span style="color:#000080;"&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" style="color: rgb(0, 0, 170); "&gt;http://www.roseindia.net/struts/using-tiles-defs-xml.shtml&lt;/a&gt;.

The &lt;/span&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;resourcebundle.properties &lt;/b&gt;file is used to configure the message (error/ other messages) for the struts applications.

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" style="color: rgb(0, 0, 170); "&gt;http://www.roseindia.net/struts/address_struts_validator.shtml&lt;/a&gt;.
  &lt;/span&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Question: What is the difference between perform() and execute() methods?
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:#000080;"&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;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Question: What are the various Struts tag libraries?
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:
* Bean tag library - Tags for accessing JavaBeans and their properties.
* &lt;span class="Apple-style-span"  style="font-size:7;"&gt;&lt;span class="Apple-style-span" style="font-size: 48px; line-height: 72px;"&gt;HTML Tag &lt;/span&gt;&lt;/span&gt; library - Tags to output standard HTML, including forms, text boxes, checkboxes, radio buttons etc..
* Logic tag library - Tags for generating conditional output, iteration capabilities and flow management
* Tiles or Template tag library - For the application using tiles
* Nested tag library - For using the nested beans in the application
  &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Question: What do you understand by DispatchAction?
Answer:  &lt;/b&gt;&lt;/span&gt;&lt;span style="color:#000080;"&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;b&gt;For example: &lt;/b&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 style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&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 style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;code&gt;&lt;span style="color:#000080;"&gt;&lt;html:hidden property="dispatch" value="error"&gt;
&lt;script&gt;function set(target) {document.forms[0].dispatch.value=target;}&lt;/script&gt;
&lt;html:submit onclick="set('save');"&gt;SAVE&lt;/html:submit&gt;
&lt;html:submit onclick="set('create');"&gt;SAVE AS NEW
&lt;html:submit onclick="set('delete);"&gt;DELETE&lt;/html:submit&gt;&lt;/html:submit&gt;&lt;/html:hidden&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&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 style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;code&gt;&lt;span style="color:#000080;"&gt;String dispatch = myForm.getDispatch();
if ("create".equals(dispatch)) { ...
if ("save".equals(dispatch)) { ...&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&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 style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&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 style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;code&gt;&lt;span style="color:#000080;"&gt;public ActionForward create(
   ActionMapping mapping,
   ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response)
 throws IOException, ServletException { ...&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;code&gt;&lt;span style="color:#000080;"&gt;public ActionForward save(
   ActionMapping mapping,
   ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response)
 throws IOException, ServletException { ...&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&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 style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;code&gt;&lt;span style="color:#000080;"&gt;&lt;action path="/reg/dispatch" type="app.reg.RegDispatch" name="regForm" scope="request" validate="true" parameter="dispatch"&gt;&lt;/action&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&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 style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;code&gt;&lt;span style="color:#000080;"&gt;&lt;action path="/reg/dispatch" type="app.reg.RegDispatch" name="regForm" scope="request" validate="true" parameter="o"&gt;&lt;/action&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&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 style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&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 programers. Localization becomes virtually impossible. (Source: &lt;a href="http://husted.com/struts/tips/002.html" target="_blank" style="color: rgb(0, 0, 170); "&gt;http://husted.com/struts/tips/002.html&lt;/a&gt;).
   &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Question: How Struts relates to J2EE?
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;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Question: What is Struts actions and action mappings?
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.

An action can perform tasks such as validating a user name and password.

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.

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;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Struts Interview Questions</title><link>http://javaspecialization.blogspot.com/2009/08/struts-interview-questions.html</link><category>Struts Interview Questions</category><author>noreply@blogger.com (Yash Vysya)</author><pubDate>Sat, 15 Aug 2009 00:39:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8981950642035125982.post-1364949053310574964</guid><description>&lt;span class="Apple-style-span"  style=" color: rgb(0, 0, 128); font-family:'times new roman';"&gt;&lt;b&gt;Q: What is Jakarta Struts Framework?
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;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:'times new roman';color:#000080;"&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:'times new roman';color:#000080;"&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Q: What is ActionServlet?
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;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Q: How you will make available any Message Resources Definitions file to the Struts Framework Environment?
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;/message-resources&gt;&lt;/b&gt; tag.
&lt;b&gt;Example:&lt;/b&gt;
&lt;message-resources parameter="MessageResources"&gt;
   &lt;/message-resources&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Q: What is Action Class?
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;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;Q: Write code of any Action Class?
A: &lt;/b&gt;Here is the code of Action Class that returns the &lt;i&gt;ActionForward&lt;/i&gt; object.
&lt;b&gt;TestAction.java&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;b&gt;  &lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;span class="Apple-style-span"  style=" font-weight: normal; line-height: normal;  white-space: nowrap; font-family:-webkit-monospace;"&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;package &lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;com.java.ac.net;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;span class="Apple-style-span"  style="  white-space: nowrap; font-family:-webkit-monospace;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;
&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;import &lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;javax.servlet.http.HttpServletRequest;
&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;import &lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;javax.servlet.http.HttpServletResponse;
&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;import &lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;org.apache.struts.action.Action;
&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;import &lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;org.apache.struts.action.ActionForm;
&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;import &lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;org.apache.struts.action.ActionForward;
&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;import &lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;org.apache.struts.action.ActionMapping;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:'times new roman';color:#000080;"&gt;&lt;span class="Apple-style-span"   style="  white-space: nowrap; font-family:-webkit-monospace;font-size:13px;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;
&lt;/span&gt;&lt;b&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;public class TestAction extends Action&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;  public ActionForward execute(&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;    ActionMapping mapping,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;    ActionForm form,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;    HttpServletRequest request,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;    HttpServletResponse response) throws Exception{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;      return mapping.findForward("testAction");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;  }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  font-weight: normal; white-space: normal; font-family:'times new roman';font-size:16px;"&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Q: What is ActionForm?
A: &lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;An ActionForm is a JavaBean that extends &lt;/span&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;org.apache.struts.action.ActionForm&lt;/span&gt;&lt;/code&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&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;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Q: What is Struts Validator Framework?
A: &lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&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;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;DynaValidatorForm&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; class. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&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;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Q. Give the Details of XML files used in Validator Framework?
A: &lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;The Validator Framework uses two XML configuration files &lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;validator-rules.xml&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; and &lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;validation.xml&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;. The &lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;validator-rules.xml&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; defines the standard validation routines, these are reusable and used in &lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;validation.xml&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;. to define the form specific validations. The &lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;validation.xml&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; defines the validations applied to a form bean.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Q. How you will display validation fail errors on jsp page?
A: &lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Following tag displays all the errors:
&lt;/span&gt;&lt;html:errors&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;
 &lt;/span&gt;&lt;/html:errors&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; line-height: 1.5; "&gt;&lt;span style="color:#000080;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Q. How you will enable front-end validation based on the xml in validation.xml?
A: &lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;The &lt;/span&gt;&lt;html:javascript&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; tag to allow front-end validation based on the xml in validation.xml. For  example the code: &lt;/span&gt;&lt;html:javascript formname="logonForm" dynamicjavascript="true" staticjavascript="true"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; generates the client side java script for the form "logonForm" as defined in the validation.xml file. The &lt;/span&gt;&lt;html:javascript&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; when added in the jsp file generates the client site validation script.&lt;/span&gt;&lt;/html:javascript&gt;&lt;/html:javascript&gt;&lt;/html:javascript&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"    style="font-family:-webkit-monospace;font-size:100%;color:#000080;"&gt;&lt;span class="Apple-style-span"  style=" white-space: nowrap; font-size:13px;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Java Interview Questions</title><link>http://javaspecialization.blogspot.com/2009/08/java-interview-questions.html</link><category>Java Interview Questions</category><author>noreply@blogger.com (Yash Vysya)</author><pubDate>Fri, 14 Aug 2009 19:59:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-8981950642035125982.post-6435738155968363939</guid><description>&lt;tr valign="top"&gt;&lt;td width="12%"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt;&lt;span class="Apple-style-span" style="text-decoration: none;"&gt;Question:&lt;/span&gt;&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td width="88%"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;What is the difference between an Interface and an Abstract class?

&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt;                                       &lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt;Question:&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="color:#551A8B;"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="text-decoration: "&gt;What is the purpose of garbage collection in Java, and when is it used?&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt;                                       &lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt; &lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt;Question:&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt; &lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;Describe synchronization in respect to multithreading.

&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt;Question:&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt; &lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;Explain different way of using thread?

&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt;                                       &lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt; &lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt;Question:&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt; &lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;What are pass by reference and passby value?

&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt;                                    &lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt;Question:&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt; &lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;What is HashMap and Map?

&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt;Question:&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt; &lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;Difference between HashMap and HashTable?

&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt;Question:&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;Difference between Vector and ArrayList?

&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt;Question:&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt; &lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;Difference between Swing and Awt?

&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt;Question:&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt; &lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;What is the difference between a constructor and a method?

&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt; &lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt;Question:&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt; &lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;What is an Iterator?

&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="32"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt;Question:&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt; &lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span&gt;&lt;span class="Apple-style-span"    style="font-family:Verdana;font-size:100%;color:#000099;"&gt;&lt;span class="Apple-style-span"  style="font-size:13px;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;State the significance of public, private, protected, default modifiers both singly and in combination and state the effect of package relationships on declared items qualified by these modifiers.
&lt;/span&gt;
&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt;Question:&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;What is an abstract class?

&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt;Question:&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;&lt;a href="http://google.com/"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;&lt;i&gt;What is static in java?
&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt;

&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#000099;"&gt; &lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td&gt;&lt;p&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;color:#990000;"&gt;
&lt;table class="bodytext" width="100%" border="0" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr valign="top"&gt;&lt;td width="3%"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;Q:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td class="bodytext"&gt; &lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;What                                         is the difference between an Interface                                         and an Abstract class? &lt;a name="q1"&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;A:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract. An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private, protected, etc.), but has some abstract methods.
                          .                                       &lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td&gt; &lt;/td&gt;                                     &lt;td valign="bottom"&gt;                                       &lt;div align="right"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
                    &lt;table class="bodytext" width="100%" border="0" cellpadding="0" cellspacing="0"&gt;                                   &lt;tbody&gt;&lt;tr valign="top"&gt;                                     &lt;td width="3%"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;Q:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td class="bodytext" width="97%"&gt; &lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;What                                         is the purpose of garbage collection in                                         Java, and when is it used?&lt;a name="q2"&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="65"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;A:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;The                                       purpose of garbage collection is to identify                                       and discard objects that are no longer needed                                       by a program so that their resources can                                       be reclaimed and reused. A Java object is                                       subject to garbage collection when it becomes                                       unreachable to the program in which it is                                       used. &lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td&gt; &lt;/td&gt;                                     &lt;td&gt; &lt;div align="right"&gt;&lt;span class="Apple-style-span"   style="font-size:85%;color:#990000;"&gt;&lt;span class="Apple-style-span"  style="font-size:10px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                 &lt;/tbody&gt;&lt;/table&gt;                    
                    &lt;table class="bodytext" width="100%" border="0" cellpadding="0" cellspacing="0"&gt;                                   &lt;tbody&gt;&lt;tr valign="top"&gt;                                     &lt;td width="3%"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;Q:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td class="bodytext" width="97%"&gt; &lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Describe                                         synchronization in respect to multithreading.&lt;a name="q3"&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;A:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;With                                       respect to multithreading, synchronization                                       is the capability to control the access                                       of multiple threads to shared resources.                                       Without synchonization, it is possible for                                       one thread to modify a shared variable while                                       another thread is in the process of using                                       or updating same shared variable. This usually                                       leads to significant errors.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;                                        &lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td&gt; &lt;/td&gt;                                     &lt;td&gt;&lt;div align="right"&gt;&lt;span class="Apple-style-span"   style="font-size:85%;color:#990000;"&gt;&lt;span class="Apple-style-span"  style="font-size:10px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                 &lt;/tbody&gt;&lt;/table&gt;                    
                    &lt;table class="bodytext" width="100%" border="0" cellpadding="0" cellspacing="0"&gt;                                   &lt;tbody&gt;&lt;tr valign="top"&gt;                                     &lt;td width="3%"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;Q:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td class="bodytext" width="97%"&gt; &lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;b&gt;                                         Explain different way of using thread?                                         &lt;a name="q4"&gt;&lt;/a&gt; &lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="48"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;A:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;The                                       thread could be implemented by using runnable                                       interface or by inheriting from the Thread                                       class. The former is more advantageous,                                       'cause when you are going for multiple inheritance..the                                       only interface can help.&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="18"&gt; &lt;/td&gt;                                     &lt;td&gt;&lt;div align="right"&gt;&lt;span class="Apple-style-span"   style="font-size:85%;color:#990000;"&gt;&lt;span class="Apple-style-span"  style="font-size:10px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;                    
                    &lt;table class="bodytext" width="100%" border="0" cellpadding="0" cellspacing="0"&gt;                                   &lt;tbody&gt;&lt;tr valign="top"&gt;                                     &lt;td width="3%"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;Q:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td class="bodytext" width="97%"&gt; &lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;What                                         are pass by reference and passby value?&lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;                                         &lt;a name="q5" id="q5"&gt;&lt;/a&gt; &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="34"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;A:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-size:85%;"&gt;Pass By Reference means the                                       passing the address itself rather than passing                                       the value. Passby Value means passing a                                       copy of the value to be passed. &lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="18"&gt; &lt;/td&gt;                                     &lt;td&gt;&lt;div align="right"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
                    &lt;table class="bodytext" width="100%" border="0" cellpadding="0" cellspacing="0"&gt;                                   &lt;tbody&gt;&lt;tr valign="top"&gt;                                     &lt;td width="3%"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;Q:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td class="bodytext" width="97%"&gt; &lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;What                                         is HashMap and Map?&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;a name="q6"&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="16"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;A:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;Map                                       is Interface and Hashmap is class that implements                                       that.&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="18"&gt; &lt;/td&gt;                                     &lt;td&gt;&lt;div align="right"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
                    &lt;table class="bodytext" width="100%" border="0" cellpadding="0" cellspacing="0"&gt;                                   &lt;tbody&gt;&lt;tr valign="top"&gt;                                     &lt;td width="3%"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;Q:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td class="bodytext" width="97%"&gt; &lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;Difference                                         between HashMap and HashTable?&lt;a name="q7"&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="27"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;A:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;The                                       HashMap class is roughly equivalent                                       to Hashtable, except that it is unsynchronized                                       and permits nulls. (HashMap allows null                                       values as key and value whereas Hashtable                                       doesnt allow). HashMap does not guarantee                                       that the order of the map will remain constant                                       over time. HashMap is unsynchronized and                                       Hashtable is &lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;synchronized&lt;/span&gt;.                                    &lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="18"&gt; &lt;/td&gt;                                     &lt;td&gt;&lt;div align="right"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
                    &lt;table class="bodytext" width="100%" border="0" cellpadding="0" cellspacing="0"&gt;                                   &lt;tbody&gt;&lt;tr valign="top"&gt;                                     &lt;td width="3%"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;Q:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td class="bodytext" width="97%"&gt; &lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;b&gt;                                         Difference between Vector and ArrayList?&lt;a name="q8" id="q8"&gt;&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="19"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;A:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;Vector                                       is synchronized whereas arraylist is not.&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="19"&gt; &lt;/td&gt;                                     &lt;td&gt;&lt;div align="right"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
                    &lt;table class="bodytext" width="100%" border="0" cellpadding="0" cellspacing="0"&gt;                                   &lt;tbody&gt;&lt;tr valign="top"&gt;                                     &lt;td width="3%"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;Q:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td class="bodytext" width="97%"&gt; &lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;b&gt;Difference                                         between Swing and Awt?&lt;a name="q9"&gt;&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="18"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;A:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;AWT                                       are heavy-weight componenets. Swings are                                       light-weight components. Hence swing works                                       faster than AWT.&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="18"&gt; &lt;/td&gt;                                     &lt;td&gt;&lt;div align="right"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
                    &lt;table class="bodytext" width="100%" border="0" cellpadding="0" cellspacing="0"&gt;                                   &lt;tbody&gt;&lt;tr valign="top"&gt;                                     &lt;td width="3%"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;Q:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td class="bodytext" width="97%"&gt; &lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;What                                         is the difference between a constructor                                         and a method? &lt;a name="q10"&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="81"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;A:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;A                                       constructor is a member function of a class                                       that is used to create objects of that class.                                       It has the same name as the class itself,                                       has no return type, and is invoked using                                       the new operator.
                          A method is an ordinary member function                                       of a class. It has its own name, a return                                       type (which may be void), and is invoked                                       using the dot operator.&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="18"&gt; &lt;/td&gt;                                     &lt;td&gt;&lt;div align="right"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
                    &lt;table class="bodytext" width="100%" border="0" cellpadding="0" cellspacing="0"&gt;                                   &lt;tbody&gt;&lt;tr valign="top"&gt;                                     &lt;td width="3%"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;Q:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td class="bodytext" width="97%"&gt; &lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;What                                         is an Iterator?&lt;a name="q11"&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="81"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;A:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;Some                                       of the collection classes provide traversal                                       of their contents via a java.util.Iterator                                       interface. This interface allows you to                                       walk through a collection of objects, operating                                       on each object in turn. Remember when using                                       Iterators that they contain a snapshot of                                       the collection at the time the Iterator                                       was obtained; generally it is not advisable                                       to modify the collection itself while traversing                                       an Iterator.&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="18"&gt; &lt;/td&gt;                                     &lt;td&gt;&lt;div align="right"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
                    &lt;table class="bodytext" width="100%" border="0" cellpadding="0" cellspacing="0"&gt;                                   &lt;tbody&gt;&lt;tr valign="top"&gt;                                     &lt;td width="3%"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;Q:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td class="bodytext" width="97%"&gt; &lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;                                         &lt;a name="q12"&gt;&lt;/a&gt; &lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;State                                         the significance of public, private, protected,                                         default modifiers both singly and in combination                                         and state the effect of package relationships                                         on declared items qualified by these modifiers.&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="81"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;A:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;&lt;strong&gt;public                                       : &lt;/strong&gt;&lt;/em&gt;Public class is visible                                       in other packages, field is visible everywhere                                       (class must be public too)
                          &lt;em&gt;&lt;strong&gt;private :&lt;/strong&gt;&lt;/em&gt; Private                                       variables or methods may be used only by                                       an instance of the same class that declares                                       the variable or method, A private feature                                       may only be accessed by the class that owns                                       the feature.
                          &lt;em&gt;&lt;strong&gt;protected :&lt;/strong&gt;&lt;/em&gt; Is                                       available to all classes in the same package                                       and also available to all subclasses of                                       the class that owns the protected feature.This                                       access is provided even to subclasses that                                       reside in a different package from the class                                       that owns the protected feature.
                          &lt;em&gt;&lt;strong&gt;default :&lt;/strong&gt;&lt;/em&gt;What                                       you get by default ie, without any access                                       modifier (ie, public private or protected).It                                       means that it is visible to all within a                                       particular package&lt;/span&gt;&lt;/span&gt;.&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="18"&gt; &lt;/td&gt;                                     &lt;td&gt;&lt;div align="right"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
                    &lt;table class="bodytext" width="100%" border="0" cellpadding="0" cellspacing="0"&gt;                                   &lt;tbody&gt;&lt;tr valign="top"&gt;                                     &lt;td width="3%"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;Q:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td class="bodytext" width="97%"&gt; &lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;What                                         is an abstract class?&lt;a name="q13"&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="81"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;A:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;                                       &lt;/strong&gt;Abstract class must be extended/subclassed                                       (to be useful). It serves as a template.                                       A class that is abstract may not be instantiated                                       (ie, you may not call its constructor),                                       abstract class may contain static data.                                       Any class with an abstract method is automatically                                       abstract itself, and must be declared as                                       such.
                          A class may be declared abstract even if                                       it has no abstract methods. This prevents                                       it from being instantiated.&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="18"&gt; &lt;/td&gt;                                     &lt;td&gt;&lt;div align="right"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
                    &lt;table class="bodytext" width="100%" border="0" cellpadding="0" cellspacing="0"&gt;                                   &lt;tbody&gt;&lt;tr valign="top"&gt;                                     &lt;td width="3%"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;Q:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td class="bodytext" width="97%"&gt; &lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;What                                         is static in java?&lt;a name="q14"&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="81"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;A:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;Static                                       means one per class, not one for each object                                       no matter how many instance of a class might                                       exist. This means that you can use them                                       without creating an instance of a class.Static                                       methods are implicitly final, because overriding                                       is done based on the type of the object,                                       and static methods are attached to a class,                                       not an object. A static method in a superclass                                       can be shadowed by another static method                                       in a subclass, as long as the original method                                       was not declared final. However, you can't                                       override a static method with a nonstatic                                       method. In other words, you can't change                                       a static method into an instance method                                       in a subclass.&lt;/span&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="18"&gt; &lt;/td&gt;                                     &lt;td&gt;&lt;div align="right"&gt;&lt;span class="Apple-style-span"   style="font-size:85%;color:#990000;"&gt;&lt;span class="Apple-style-span"  style="font-size:10px;"&gt;&lt;b&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;                    
                    &lt;table class="bodytext" width="100%" border="0" cellpadding="0" cellspacing="0"&gt;                                   &lt;tbody&gt;&lt;tr valign="top"&gt;                                     &lt;td width="3%"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;Q:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td class="bodytext" width="97%"&gt; &lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;/span&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;strong&gt;What                                         is final?&lt;a name="q15"&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;                                   &lt;/tr&gt;                                   &lt;tr valign="top"&gt;                                     &lt;td height="48"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;A:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt;                                     &lt;td&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;A                                       final class can't be extended ie., final                                       class may not be subclassed. A final method                                       can't be overridden when its class is inherited.                                       You can't change value of a final variable                                       (is a constant).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item></channel></rss>