<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-18870537</id><updated>2012-02-01T17:31:43.821+05:30</updated><category term='java 1.5'/><category term='Threading'/><category term='Swings.SWT'/><category term='Design patterns'/><category term='Struts'/><category term='AWT'/><category term='Performance'/><category term='JSP'/><category term='Multitasking'/><category term='list'/><category term='java'/><category term='Isolation Levels'/><category term='Singletone'/><category term='Thread'/><category term='jakarta struts'/><category term='static'/><category term='map'/><category term='JSTL'/><category term='Ioc'/><category term='Heap Analysis'/><category term='Memory Leak'/><category term='memory leaks'/><category term='JDBC'/><category term='exceptions'/><category term='set'/><category term='Exception'/><category term='Soft references'/><category term='ActionErrors'/><category term='errors'/><category term='Java Collections'/><category term='JSF'/><category term='Apache struts'/><category term='Spring'/><category term='ActionMessage'/><category term='Multithreading'/><category term='Phantom references'/><category term='Weak References'/><category term='zip'/><title type='text'>Java Rocks!!!</title><subtitle type='html'>World of tricky Core Java Q and A Covering Object Oriented Analysis and Design, JVM Internals,Java Language Fundamentals,Datatypes,Keywords,Operators and Assignments,Identifies,Declarations and Modifiers, Conversion,Casting and Promotion, Flow control,Assertions,
Exception Handling and Garbage Collection,Objects and Classes), Basic Packages and their classes,JDBC,JFC Swing,Java Server Pages (JSP),
Servlets,EJB,JMS,JNDI etc and Open 
source technologies like Struts,Hibernate,Spring etc</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default?start-index=101&amp;max-results=100'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>203</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-18870537.post-8360921750236414147</id><published>2011-08-10T03:34:00.001+05:30</published><updated>2012-01-18T03:50:34.126+05:30</updated><title type='text'>How to add BASIC Authentication into HttpURLConnection?</title><content type='html'>Here is one sample.&lt;br /&gt;&lt;br /&gt;    ...&lt;br /&gt;    try {&lt;br /&gt;      //Create connection&lt;br /&gt;      url = new URL(targetURL);&lt;br /&gt;      connection = (HttpURLConnection)url.openConnection();&lt;br /&gt;      connection.setRequestMethod("POST");&lt;br /&gt;      ...&lt;br /&gt;      BASE64Encoder enc = new sun.misc.BASE64Encoder();&lt;br /&gt;      String userpassword = username + ":" + password;&lt;br /&gt;      String encodedAuthorization = enc.encode( userpassword.getBytes() );&lt;br /&gt;      connection.setRequestProperty("Authorization", "Basic "+&lt;br /&gt;            encodedAuthorization);&lt;br /&gt;      ...&lt;br /&gt;      //Send post data&lt;br /&gt;      ...&lt;br /&gt;&lt;br /&gt;    } catch (Exception e) {&lt;br /&gt;      ...&lt;br /&gt;    } finally {&lt;br /&gt;&lt;br /&gt;      if(connection != null) {&lt;br /&gt;        connection.disconnect(); &lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;  ...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-8360921750236414147?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/8360921750236414147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=8360921750236414147&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/8360921750236414147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/8360921750236414147'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2011/08/how-to-add-basic-authentication-into.html' title='How to add BASIC Authentication into HttpURLConnection?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-1004962881173007302</id><published>2011-08-10T03:33:00.002+05:30</published><updated>2011-12-09T23:34:50.440+05:30</updated><title type='text'>How to Use JDBC Java to Create Table?</title><content type='html'>his example demonstrates how to create a table in JDBC in MySQL database.&lt;br /&gt;&lt;br /&gt;import java.sql.Connection;&lt;br /&gt;import java.sql.DriverManager;&lt;br /&gt;import java.sql.SQLException;&lt;br /&gt;import java.sql.Statement;&lt;br /&gt;&lt;br /&gt;public class JDBCCreateTable {&lt;br /&gt;&lt;br /&gt;    private static final String DBURL = &lt;br /&gt;                   "jdbc:mysql://localhost:3306/mydb?user=usr&amp;password=sql&amp;" +&lt;br /&gt;                   "useUnicode=true&amp;characterEncoding=UTF-8";&lt;br /&gt;    private static final String DBDRIVER = "org.gjt.mm.mysql.Driver";&lt;br /&gt;  &lt;br /&gt;    static {&lt;br /&gt;        try {&lt;br /&gt;            Class.forName(DBDRIVER).newInstance();&lt;br /&gt;        } catch (Exception e){&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private static Connection getConnection() &lt;br /&gt;    {&lt;br /&gt;        Connection connection = null;&lt;br /&gt;        try {&lt;br /&gt;            connection = DriverManager.getConnection(DBURL);&lt;br /&gt;        }&lt;br /&gt;        catch (Exception e) {&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        }&lt;br /&gt;        return connection;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        Connection con = getConnection();&lt;br /&gt;        Statement stmt =null;&lt;br /&gt;        String createString;&lt;br /&gt;        createString = "CREATE TABLE  `mydb`.`employees` ("+&lt;br /&gt;        "`EmployeeID` int(10) unsigned NOT NULL default '0',"+&lt;br /&gt;        "`Name` varchar(45) collate utf8_unicode_ci NOT NULL default '',"+&lt;br /&gt;        "`Office` varchar(10) collate utf8_unicode_ci NOT NULL default '',"+&lt;br /&gt;        "`CreateTime` timestamp NOT NULL default CURRENT_TIMESTAMP,"+&lt;br /&gt;        "PRIMARY KEY  (`EmployeeID`)"+&lt;br /&gt;         ") ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";            &lt;br /&gt;        try {&lt;br /&gt;            stmt = con.createStatement();&lt;br /&gt;            stmt.executeUpdate(createString);&lt;br /&gt;        } catch(SQLException ex) {&lt;br /&gt;            System.err.println("SQLException: " + ex.getMessage());&lt;br /&gt;        }&lt;br /&gt;        finally {&lt;br /&gt;            if (stmt != null) {&lt;br /&gt;                try {&lt;br /&gt;                    stmt.close();&lt;br /&gt;                } catch (SQLException e) {&lt;br /&gt;                    System.err.println("SQLException: " + e.getMessage());&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            if (con != null) {&lt;br /&gt;                try {&lt;br /&gt;                    con.close();&lt;br /&gt;                } catch (SQLException e) {&lt;br /&gt;                    System.err.println("SQLException: " + e.getMessage());&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-1004962881173007302?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/1004962881173007302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=1004962881173007302&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1004962881173007302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1004962881173007302'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2011/08/how-to-use-jdbc-java-to-create-table.html' title='How to Use JDBC Java to Create Table?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-5300029713528466604</id><published>2011-08-10T03:31:00.001+05:30</published><updated>2011-12-09T23:34:44.544+05:30</updated><title type='text'>How to read input from console (keyboard) in Java?</title><content type='html'>There are few ways to read input string from  your console/keyboard. The following smaple code shows how to read a string from the console/keyboard by using Java.&lt;br /&gt;&lt;br /&gt;public class ConsoleReadingDemo {&lt;br /&gt;&lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;&lt;br /&gt;        // ====&lt;br /&gt;        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));&lt;br /&gt;        System.out.print("Please enter user name : ");&lt;br /&gt;        String username = null;&lt;br /&gt;        try {&lt;br /&gt;            username = reader.readLine();&lt;br /&gt;        } catch (IOException e) {&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        }&lt;br /&gt;        System.out.println("You entered : " + username);&lt;br /&gt;&lt;br /&gt;        // ===== In Java 5, Java.util,Scanner is used for this purpose.&lt;br /&gt;        Scanner in = new Scanner(System.in);&lt;br /&gt;        System.out.print("Please enter user name : ");&lt;br /&gt;        username = in.nextLine();      &lt;br /&gt;        System.out.println("You entered : " + username);&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;        // ====== Java 6&lt;br /&gt;        Console console = System.console();&lt;br /&gt;        username = console.readLine("Please enter user name : ");   &lt;br /&gt;        System.out.println("You entered : " + username);&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The last part of code used java.io.Console class. you can not get Console instance from System.Console() when running the demo code through Eclipse. Because eclipse runs your application as a background process and not as a top-level process with a system console.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-5300029713528466604?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/5300029713528466604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=5300029713528466604&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/5300029713528466604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/5300029713528466604'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2011/08/how-to-read-input-from-console-keyboard.html' title='How to read input from console (keyboard) in Java?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-3858050436061035867</id><published>2011-08-10T03:17:00.001+05:30</published><updated>2011-08-10T03:17:35.840+05:30</updated><title type='text'>Why we call start() method which in turns calls run method, why not we directly call run method ?</title><content type='html'>In both the above examples, the run() method is the most important method in the thread classes, it is also the only method that we need to implement in both cases. Why it's only proper to call the start() method to start the thread instead of calling the run() method directly? Because the run() method is not a regular class method. It should only be called by the JVM. Writing thread classes is not about a single sequential thread, it's about the use of multiple threads running at the same time and performing different tasks in a single program. The JVM needs to work closely with the underneath operating system for the actual implementation of concurrent operations. This is how the performance can be improved, and all other benefits mentioned above can be achieved.&lt;br /&gt;&lt;br /&gt;You should not invoke the run() method directly. If you call the run() method directly, it will simply execute in the caller's thread instead of as its own thread. Instead, you need to call the start() method, which schedules the thread with the JVM. The JVM will call the corresponding run() method when the resources and CPU is ready. The JVM is not guaranteed to call the run() method right way when the start() method is called, or in the order that the start() methods are called. Especially for the computers have a single processor, it is impossible to run all running threads at the same time. The JVM must implement a scheduling scheme that shares the processor among all running threads. This is why when you call the start() methods from more than one thread, the sequence of execution of the corresponding run() methods is random, controlled only by the JVM.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-3858050436061035867?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/3858050436061035867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=3858050436061035867&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/3858050436061035867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/3858050436061035867'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2011/08/why-we-call-start-method-which-in-turns.html' title='Why we call start() method which in turns calls run method, why not we directly call run method ?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-897021857513751723</id><published>2011-08-01T06:31:00.000+05:30</published><updated>2011-08-01T06:33:05.992+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='Isolation Levels'/><title type='text'>Java JDBC Transaction Isolation Levels</title><content type='html'>Generally speaking, as the isolation levels become more restrictive, the performance of the system decreases because transactions are prevented from accessing the same data. If isolation levels are very restrictivein other words, if they are at the Serializable levelthen all transactions, even simple reads, must wait in line to execute. This can result in a system that is very slow. J2EE server that process a large number of concurrent transactions and need to be very fast will therefore avoid the Serializable isolation level where it is not necessary.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Read Uncommitted &lt;/strong&gt;&lt;br /&gt;The transaction can read uncommitted data (i.e., data changed by a different transaction that is still in progress). Dirty reads, nonrepeatable reads, and phantom reads can occur. Bean methods with this isolation level can read uncommitted changes.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Read Committed&lt;/strong&gt;&lt;br /&gt;The transaction cannot read uncommitted data; data that is being changed by a different transaction cannot be read. Dirty reads are prevented; nonrepeatable reads and phantom reads can occur. Bean methods with this isolation level cannot read uncommitted data.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Repeatable Read&lt;/strong&gt;&lt;br /&gt;The transaction cannot change data that is being read by a different transaction. Dirty reads and nonrepeatable reads are prevented; phantom reads can occur. Bean methods with this isolation level have the same restrictions as those in the Read Committed level and can execute only repeatable reads.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Serializable&lt;/strong&gt;&lt;br /&gt;The transaction has exclusive read and update privileges; different transactions can neither read nor write to the same data. Dirty reads, nonrepeatable reads, and phantom reads are prevented. This isolation level is the most restrictive.&lt;br /&gt;&lt;br /&gt;Note: J2EE Isolation level on connections used by CMP beans&lt;br /&gt;In a EJB 2.x or EJB 3.0 module, when a CMP bean uses a new data source to access a backend database, the isolation level is determined by J2EE Application Server run time, based on the type of access intent assigned to the bean or the calling method. Other non-CMP connection users can access this same data source and also use the access intent and application profile support to manage their concurrency control.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-897021857513751723?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/897021857513751723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=897021857513751723&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/897021857513751723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/897021857513751723'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2011/08/java-jdbc-transaction-isolation-levels.html' title='Java JDBC Transaction Isolation Levels'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-5062643243474012590</id><published>2011-08-01T06:15:00.001+05:30</published><updated>2011-08-01T06:19:42.886+05:30</updated><title type='text'>Interview Tips</title><content type='html'>Hello All, Today I came across very interesting site where we can find interesting interview tips for different types of interviews&lt;br /&gt;&lt;br /&gt;&lt;a href="http://interviewtip.net/job-interview-tips/"&gt;Read more......&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-5062643243474012590?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://interviewtip.net/job-interview-tips/' title='Interview Tips'/><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/5062643243474012590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=5062643243474012590&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/5062643243474012590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/5062643243474012590'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2011/08/interview-tips.html' title='Interview Tips'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-141242021503399633</id><published>2010-10-29T15:06:00.001+05:30</published><updated>2010-12-24T14:41:59.953+05:30</updated><title type='text'>Struts / Java / J2EE Frequently-Asked Interview Questions</title><content type='html'>&lt;div style="FONT-SIZE: 13px; COLOR: #000000; DIRECTION: ltr; FONT-FAMILY: Tahoma"&gt;&lt;br /&gt;&lt;div dir="ltr"&gt;&lt;span style="font-family:Tahoma;font-size:85%;color:#000000;"&gt;&lt;h3 class="post-title entry-title"&gt; &lt;/h3&gt;&lt;div class="post-header"&gt;&lt;div class="post-header-line-1"&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="post-body entry-content"&gt;&lt;strong&gt;Are Struts's action classes Thread-safe?&lt;/strong&gt;&lt;br /&gt;Yes. Action classes are based on "one-instance and many-threads". This is to conserve resources and to provide the best possible throughput.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are the various Struts Tag libraries?&lt;/strong&gt;&lt;br /&gt;There are various struts tags. But the most-repeated tags are:&lt;br /&gt;struts-bean.tld&lt;br /&gt;struts-html.tld&lt;br /&gt;struts-logic.tld&lt;br /&gt;struts-nested.tld&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is ActionMapping in struts?&lt;/strong&gt;&lt;br /&gt;Action mapping defines the flow of one request. The possible sequence is&lt;br /&gt;User -&amp;gt; request -&amp;gt; Form -&amp;gt; Validation -&amp;gt; Business Code -&amp;gt; Forward -&amp;gt; JSP -&amp;gt; response -&amp;gt; User.&lt;br /&gt;The components involved are Action classes, Forms and JSP.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are the advantages of having multiple struts-config in the same application?&lt;/strong&gt;&lt;br /&gt;The implementation with many struts-config is to organize the development work, so that many people may be involved and it is some organized way of doing things. But this would result in some compromise in performance(speed). Technically there is no any difference between single and multiple struts-config files.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are the ways in which resource file can be used in struts?&lt;/strong&gt;&lt;br /&gt;Defining message resources in struts-config file.&lt;br /&gt;Programmatically using resource files in Java classes or in JSP files.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Explain the term 'architecture of the application'?&lt;/strong&gt;&lt;br /&gt;Architecture is the set of rules (or framework) to bring in some common way of assembling or using J2EE components in the application. This helps in bringing consistency between codes developed by various developers in the team.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Which is the architecture followed by struts?&lt;/strong&gt;&lt;br /&gt;Struts follows MVC architecture.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are components corresponding o M, V and C in struts?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Model : The model represents the data of an application. Anything that an application will persist becomes a part of model. The model also defines the way of accessing this data ( the business logic of application) for manipulation. It knows nothing about the way the data will be displayed by the application. It just provides service to access the data and modify it. Here 'Form Bean' represents Model layer.&lt;br /&gt;&lt;br /&gt;View : The view represents the presentation of the application. The view queries the model for its content and renders it. The way the model will be rendered is defined by the view. The view is not dependent on data or application logic changes and remains same even if the business logic undergoes modification. JSP represents View Layer.&lt;br /&gt;&lt;br /&gt;Controller : All the user requests to the application go through the controller. The controller intercepts the requests from view and passes it to the model for appropriate action. Based on the result of the action on data, the controller directs the user to the subsequent view. Action classes (action servlets) represent Controller layer.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Differentiate between the terms 'Design Patterns', 'Framework' and 'Architecture'.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Design Pattern:&lt;/strong&gt; The various solutions arrived at for the known problem. This helps to avoid re-inventing the wheel. The risk-free solution can be easily used by others. For example, singleton is the design pattern that you can use instantly to enfore one object per class. You do not need to think of this on your own.&lt;br /&gt;&lt;strong&gt;Framework:&lt;/strong&gt; A framework is a structure or set of rules, used to solve or address complex issues. It is basically a reusable designf for the J2EE applications. For example, Struts, JSF,etc., are the frameworks. You can use these frameworks based on the requirements of your application and each has its own set of advantages.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Architecture:&lt;/strong&gt; It is a design that describes how the various components in the application fit together. For example, MVC is an architecture which is helpful to define how the components interact within the application.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the difference between ActionForm and DynaActionForm?&lt;/strong&gt;&lt;br /&gt;In action form, you need to define the form class that extends ActionForm explicitly, whereas you can define the form dynamically inside the struts-config file when using DynaActionForm.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How can you use Validator framework in struts?&lt;br /&gt;&lt;/strong&gt;Validator Frameworks are helpful when the application needs server-side validation such that the particular set of validations occur very frequently within the same application. This avoids writing complex code in validation() method in every form bean. Using validator framework, there are different pre-written validations in place. You can customize these validations in XML file.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are client-side and server-side vaidations?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Client-side validations:&lt;/strong&gt; These are the validations that id done using javascripts. There is always a danger involved that the user can get through (crack-through) these validations. But for some simple validations, like converting lower-case to upper-case or date validations can be done, you can use javascripts.&lt;br /&gt;&lt;strong&gt;Server-side validations:&lt;/strong&gt; These are the validations done in server-side using Java components (Form bean or in business logics) where the user has no chance to crookedly get through the system.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are the advantages &amp;amp; differences between using validate() method in form over validations using validator framework.&lt;/strong&gt;&lt;br /&gt;Refer to the previous-answer.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Define the terms authentication and authorisation.&lt;/strong&gt;&lt;br /&gt;Authentication is the process/rule that validates if the user is allowed to access the system or not.&lt;br /&gt;Authorization is the process/rule that validates if the user is allowed to access the particular part of the system or not. This occurs after user's successful authentication.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are the components provided in J2EE to perform authentication and authorization?&lt;br /&gt;&lt;/strong&gt;Authentication – RequestProcessor and/or Filter.&lt;br /&gt;Authorization - DTO, JDO or Java or Action classes.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Give the difference between between 'DispatchAction' and 'Action'.&lt;/strong&gt;&lt;br /&gt;A DispatchAction contains various different methods other than the standard execute() method in Action classes. These methods are executed based on some request parameter. For example, you can code in such a way that three buttons (namely Insert, Delete, Update) buttons correspond to different methods such as insert(), delete() and udpate(). The submit button in JSP would have the property that has the value which matches to any one of the methods defined in DispatchAction class.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is pagination technique? How can you design them in struts?&lt;/strong&gt;&lt;br /&gt;Pagination is the technique where the bulk of results are split into different pages and only the information where the user can conveniently see are displayed in a page. (Like in Goooooogle). This can be achieved in many ways, but the simplest method is to have a query string (say http://www.testwebsite?pageNumber=2) would lead to information corresponding to resultset rows from 11 to 20. Assuming that you want to display 10 related rows of information, you can set the formula as follows:&lt;br /&gt;&lt;em&gt;Starting row = (pageNumber-1) * &lt;number&gt;+ 1 which is equal to 11.&lt;br /&gt;Ending row = Starting row + &lt;number&gt;which is equal to 20.&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;strong&gt;How can you populate the drop-down list using form properties?&lt;/strong&gt;&lt;br /&gt;There are many ways for this. But the best method is to use &lt;?xml:namespace prefix = html /&gt;&lt;html:options&gt;which defines collection that needs to be used to populate the drop-down list, the property to store the selected value and the collection that is used to display the labels (what we see in JSP page). For Example,&lt;br /&gt;&lt;br /&gt;html:options collection="form-collection-property"&lt;br /&gt;property="form-property"&lt;br /&gt;labelProperty="form-another-collection-property"&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the XML parser provided in struts? Can you use it for other purposes?&lt;/strong&gt;&lt;br /&gt;'Digester' framework. Yes we can use for our applications to store and parse our application-related data.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Difference between Struts 1.0 and 1.1&lt;/strong&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Perform() method was replaced by execute() &lt;/li&gt;&lt;li&gt;DynaActionForms are introduced. &lt;/li&gt;&lt;li&gt;Tiles Concept is introduced &lt;/li&gt;&lt;li&gt;We can write our own Controller by Inheriting RequestProcessor&lt;/html:options&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-141242021503399633?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/141242021503399633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=141242021503399633&amp;isPopup=true' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/141242021503399633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/141242021503399633'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2010/10/struts-java-j2ee-frequently-asked.html' title='Struts / Java / J2EE Frequently-Asked Interview Questions'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-1651900278490671164</id><published>2010-10-29T15:02:00.002+05:30</published><updated>2010-12-24T14:43:29.242+05:30</updated><title type='text'>Advanced J2EE Concepts - Implementing Internationalization in Struts</title><content type='html'>&lt;div style="FONT-SIZE: 13px; COLOR: #000000; DIRECTION: ltr; FONT-FAMILY: Tahoma"&gt;&lt;div dir="ltr"&gt;&lt;span style="font-family:Tahoma;font-size:85%;color:#000000;"&gt;&lt;h3 class="post-title entry-title"&gt;&lt;strong&gt;&lt;u&gt;&lt;/u&gt;&lt;/strong&gt; &lt;/h3&gt;&lt;div class="post-body entry-content"&gt;&lt;p&gt;&lt;strong&gt;How is 'Internationalization' implemented in struts?&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Default Internationalization (Detected based on Browser's settings):&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Internationalization is an important concept of making the application to be compatible with different geographical location and user-friendly with respect to their location by means of providing the information in their preferred language.&lt;br /&gt;&lt;br /&gt;In struts, it can be done quite easily. The application resource file name can be extended with underscore followed by locale.&lt;br /&gt;&lt;br /&gt;For example ,&lt;br /&gt;&lt;br /&gt;When your application contains the file "ApplicationResource_en.properties", it would mean that it supports english language. When another file "ApplicationResource_fr.properties" exists, it would mean the localization for 'French'. &lt;/p&gt;&lt;p&gt;The selection of file and the content is done and decided automatically by struts. When the browser's setting is found with French settings, then struts automatically retrieves the value for the specific key from the appropriate resource file. Similarly you can add multiple property files for various locale. &lt;/p&gt;&lt;p&gt;But please remember that you can have one property file name with different extensions like &lt;span style="COLOR: rgb(0,0,153)"&gt;&lt;strong&gt;_en, _fr, _de&lt;/strong&gt;&lt;/span&gt;, etc., If they differ, the internationalization will not work. Also that only one file (one time), is specified in struts-config.xml. Each property file must have the same key with different values as follows:&lt;/p&gt;&lt;p&gt;In &lt;span style="COLOR: rgb(0,0,153)"&gt;ApplicationResources.properties_en&lt;/span&gt;, you specify &lt;span style="COLOR: rgb(0,0,153)"&gt;mainpage.welcome=Hi, You are welcome..&lt;/span&gt;&lt;/p&gt;&lt;p&gt;In &lt;span style="COLOR: rgb(0,0,153)"&gt;ApplicationResources.properties_fr&lt;/span&gt;, you specify &lt;span style="COLOR: rgb(0,0,153)"&gt;mainpage.welcome=&amp;lt; message in French &amp;gt;&lt;welcome&gt;&lt;/welcome&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;Programmatic implementation of Internationalization (By manual selection)&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The localization can even be done programmatically by placing 'Locale' object in session.&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-size:85%;"&gt;session.setAttribute("org.apache.struts.action.LOCALE", new Locale("fr"));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;For example, You can create links one for each country's localization in the main page. Each link leads to an action class with different query string such as&lt;/p&gt;&lt;p&gt;&lt;span style="COLOR: rgb(0,0,153);font-size:78%;" &gt;&lt;span style="font-size:85%;"&gt;&amp;lt;A HREF="setCountry?lang=en" &amp;gt; English &amp;lt;A&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="COLOR: rgb(0,0,153);font-size:78%;" &gt;&lt;span style="font-size:85%;"&gt;&amp;lt;A HREF = "setCountry?lang=de"&amp;gt; German &amp;lt;A&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="COLOR: rgb(0,0,153);font-size:78%;" &gt;&lt;span style="font-size:85%;"&gt;&amp;lt;A HREF="setCountry?lang=fr"&amp;gt; French &amp;lt;A&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;When clicked, the action is called. Inside the action class you retrieve the lang parameter as follows&lt;/p&gt;&lt;p&gt;&lt;span style="COLOR: rgb(0,0,153);font-size:78%;" &gt;&lt;span style="font-size:85%;"&gt;String lang = request.getParamter("lang");&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="COLOR: rgb(0,0,153);font-size:78%;" &gt;&lt;span style="font-size:85%;"&gt;if (lang.equals("fr")) &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="COLOR: rgb(0,0,153);font-size:78%;" &gt;&lt;span style="font-size:85%;"&gt;session.setAttribute("org.apache.struts.action.LOCALE", new Locale("fr"));&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="COLOR: rgb(0,0,153);font-size:78%;" &gt;&lt;span style="font-size:85%;"&gt;if (lang.equals("de"))&lt;br /&gt;session.setAttribute("org.apache.struts.action.LOCALE", new Locale("de"));&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;-------------------------------------------------------------&lt;/p&gt;&lt;p&gt;Hope this explains the concept of internationalization.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-1651900278490671164?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/1651900278490671164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=1651900278490671164&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1651900278490671164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1651900278490671164'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2010/10/advanced-j2ee-concepts-implementing.html' title='Advanced J2EE Concepts - Implementing Internationalization in Struts'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-2721485813252459141</id><published>2010-10-25T15:23:00.002+05:30</published><updated>2010-12-24T14:44:07.496+05:30</updated><title type='text'>Six Interview Mistakes</title><content type='html'>&lt;div style="FONT-SIZE: 13px; COLOR: #000000; DIRECTION: ltr; FONT-FAMILY: Tahoma"&gt;&lt;div class="post-73 post type-post hentry category-career category-interview-tips" id="post-73" sizcache="10" sizset="0"&gt;&lt;div class="entry-head" sizcache="5" sizset="8"&gt;&lt;p&gt;It's tough to avoid typical interview traps if you're unsure what they are. Here are a half dozen to watch out for.&lt;/p&gt;&lt;p class="normalheading"&gt;&lt;strong&gt;1. Confusing an Interview with an Interrogation.&lt;/strong&gt;&lt;/p&gt;&lt;p class="normal"&gt;Most candidates expect to be interrogated. An interrogation occurs when one person asks all the questions and the other gives the answers. An interview is a business conversation in which both people ask and respond to questions. Candidates who expect to be interrogated avoid asking questions, leaving the interviewer in the role of reluctant interrogator.&lt;/p&gt;&lt;p class="normalheading"&gt;&lt;strong&gt;2. Making a So-Called Weakness Seem Positive.&lt;/strong&gt;&lt;/p&gt;&lt;p class="normal" sizcache="5" sizset="12"&gt;Interviewers frequently ask candidates, "&lt;a class="internal_relative" href="http://interview.monster.com/articles/biggest/"&gt;What are your weaknesses&lt;/a&gt;?" Conventional interview wisdom dictates that you highlight a weakness like "I'm a perfectionist," and turn it into a positive. Interviewers are not impressed, because they've probably heard the same answer a hundred times. If you are asked this question, highlight a skill that you wish to improve upon and describe what you are doing to enhance your skill in this area. Interviewers don't care what your weaknesses are. They want to see how you handle the question and what your answer indicates about you.&lt;/p&gt;&lt;p class="normalheading"&gt;&lt;strong&gt;3. Failing to Ask Questions.&lt;/strong&gt;&lt;/p&gt;&lt;p class="normal" sizcache="5" sizset="13"&gt;Every interview concludes with the interviewer &lt;a class="internal_relative" href="http://interview.monster.com/articles/anyquestions/"&gt;asking if you have any questions&lt;/a&gt;. The worst thing to say is that you have no questions. Having no questions prepared indicates you are not interested and not prepared. Interviewers are more impressed by the questions you ask than the selling points you try to make. Before each interview, make a list of five questions you will ask. "I think a good question is, 'Can you tell me about your career?'" says Kent Kirch, director of global recruiting at Deloitte. "Everybody likes to talk about themselves, so you're probably pretty safe asking that question."&lt;/p&gt;&lt;p class="normalheading"&gt;&lt;strong&gt;4. Researching the Company But Not Yourself.&lt;/strong&gt;&lt;/p&gt;&lt;p class="normal" sizcache="5" sizset="14"&gt;Candidates intellectually prepare by researching the company. Most job seekers do not research themselves by taking inventory of their experience, knowledge and skills. &lt;a class="internal_relative" href="http://interview.monster.com/articles/assessing/"&gt;Formulating a talent inventory&lt;/a&gt; prepares you to immediately respond to any question about your experience. You must be prepared to discuss any part of your background. Creating your talent inventory refreshes your memory and helps you immediately remember experiences you would otherwise have forgotten during the interview.&lt;/p&gt;&lt;p class="normalheading"&gt;&lt;strong&gt;5. Leaving Your Cell Phone On.&lt;/strong&gt;&lt;/p&gt;&lt;p class="normal"&gt;We may live in a wired, always-available society, but a ringing cell phone is not appropriate for an interview. Turn it off before you enter the company.&lt;/p&gt;&lt;p class="normalheading"&gt;&lt;strong&gt;6. Waiting for a Call.&lt;/strong&gt;&lt;/p&gt;&lt;p class="normal" sizcache="5" sizset="15"&gt;Time is your enemy after the interview. After you send a &lt;a class="internal_relative" href="http://interview.monster.com/articles/notes/"&gt;thank-you email and note &lt;/a&gt;to every interviewer, follow up a couple of days later with either a question or additional information. Try to contact the person who can hire you, and assume that everyone you met with has some say in the process. Additional information can be details about your talents, a recent competitor's press release or industry trends. Your intention is to keep everyone's memory of you fresh.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-2721485813252459141?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/2721485813252459141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=2721485813252459141&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/2721485813252459141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/2721485813252459141'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2010/10/six-interview-mistakes.html' title='Six Interview Mistakes'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-1680986858051744995</id><published>2010-10-25T15:01:00.000+05:30</published><updated>2010-10-25T15:02:12.363+05:30</updated><title type='text'>Java Exceptions and Error Handling Interview Questions</title><content type='html'>&lt;div style="FONT-SIZE: 13px; COLOR: #000000; DIRECTION: ltr; FONT-FAMILY: Tahoma"&gt; &lt;div&gt;&lt;/div&gt; &lt;div dir="ltr"&gt;&lt;font face="Tahoma" size="2"&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: What do you mean by exception and error handling?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: When a program encounters and un-expected situation from where it cannot continue the normal flow, it can break from the normal execution flow by throwing and exception or an error.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: What is the difference between an Error and an Exception?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: An Exception is an unexpected scenario from which the program can recover but an error means that the program has encountered an unrecoverable problem.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: Can you give an example of an unrecoverable problem when error is thrown?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: Yes, when a java program runs out of memory it is a problem from which the program cannot recover and OutOfMemoryError will be thrown.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: Does it mean that when error is thrown, we cannot catch it and continue execution?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: We can catch errors, but it is not advised to do that because when error happens it means that some unrecoverable problem has happened. Even if we catch the error, we cannot guarantee the stability of the application and something else  might fail.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: What are the different kinds of Exceptions?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: Checked Exceptions and Unchecked Exceptions.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: What are runtime Exceptions?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: Un Checked Exceptions are also known as Runtime Exceptions.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: What do you mean by Checked Exceptions?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: Checked exceptions are those exceptions which have to be explicitly handled in the code.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: Can we create our own checked exceptions?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: Yes, we just have to extend the Exception class or any of its sub classes (except RuntimeException)&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: How can we create our own runtime exception?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: We have to extend the RuntimeException class or any of its sub classes.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: How can we create our own Errors?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: We have to extend the Error class.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: What are the different approaches of Exception handling?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A:&lt;span&gt; &lt;/span&gt;We can use Try Catch block or we can declare the exception in the method definition's throws clause&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: Explain the difference between the two approaches of exception handling&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: We use the try catch clause where we want to process the exception and perform some action like displaying an error message. When an exception is caught using the catch clause, it will not be propagated to the caller.&lt;/p&gt; &lt;p class="MsoNormal"&gt;We declare the exception in the throws clause of the calling method when the exception has to be propagated to the caller and the exception is supposed to be handled by the caller.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: What is finally?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: Finally is also a block like catch block to be used with the try block. Control will come to finally block irrespective of whether exception was thrown or not.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: What is the difference between catch and finally?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: When a catch block is used, we have to mention what exception has to be caught in the catch clause; where as in finally we need not mention anything. Code in the catch block is executed only when the exception is thrown whereas the code  in finally is executed irrespective of whether exception was thrown or not.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: Can we have a try block without a catch block?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: yes, then we must have a finally block. When try block is used, we must use either a catch block or a finally block or both.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: What happens when we use only try and finally block without a catch block?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: When catch block is not used, the exceptions that are thrown will not be caught and the exception will be propagated to the caller, but before the exception is propagated, the code in the finally block will be executed.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: When do you use a catch block and when do you use a finally block?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: We use a catch block when we want to handle the exception scenario. We use a finally block alone when we want to do some cleanup but at the same time propagate the exception to the caller. We use a finally block together with a catch  block when we want to do something irrespective of what exception is thrown.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: what will happen if we return from the try block, will the finally block get executed?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A:&lt;span&gt; &lt;/span&gt;yes, after the return statement in the try block is executed, the statements in the finally block will be executed before the control goes to the calling method.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: What happens when we have a return statement in the try block as well as in the finally block.&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: when we have return statement both in try and finally blocks, then first the return statement of try block gets executed, the before the method returns, the statements in the finally block will get executed and since there is return  statement in finally also, that will also get executed and the value that will be returned to the caller will be the value returned from the finally block.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: If I write System.exit (0); at the end of the try block, will the finally block still execute?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: No.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: Can I have more than one catch block following a try block?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: yes,&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: what are the rules for having multiple catch blocks?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A:&lt;span&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoListParagraphCxSpFirst" style="MARGIN-LEFT: 0.75in; TEXT-INDENT: -0.25in"&gt; &amp;lt;!--[if !supportLists]--&amp;gt;&lt;span&gt;&lt;span&gt;1)&lt;span style="FONT: 7pt 'Times New Roman'; font-size-adjust: none; font-stretch: normal"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;lt;!--[endif]--&amp;gt;Each exception can be caught only once.&lt;/p&gt; &lt;p class="MsoListParagraphCxSpLast" style="MARGIN-LEFT: 0.75in; TEXT-INDENT: -0.25in"&gt; &amp;lt;!--[if !supportLists]--&amp;gt;&lt;span&gt;&lt;span&gt;2)&lt;span style="FONT: 7pt 'Times New Roman'; font-size-adjust: none; font-stretch: normal"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;lt;!--[endif]--&amp;gt;The catch block for sub class exceptions should come before e the catch block for parent class exceptions for example, FileNotFoundException extends IOException, so the catch block for FileNotFoundException should come before  the catch block for IOException.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: Suppose I have a class A that has a method X which throws FileNotFoundException. I have a class B that extends class A and the method X is overridden in B. In the ovverriden  method X in class B can I throw IOException?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: No, because FileNotFoundException is a subclass if IOException and in the overridden method X in class B we can throw only FileNotFoundException or any other exception that extends FileNotFoundException.&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="COLOR: #c00000"&gt;&lt;font color="#000000"&gt;Q: Is the above rule logical?&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;A: yes, the above rule is logical because java supports runtime polymorphism and at runtime an object of type B can be assigned to a variable of type A because B extends A, and when the method X is called on the variable of type A, the  compile only check that the calling method should either catch or declare the exception that method X in class A is throwing, and if the method X in class B throws IOException, and the caller is handling only FileNotFoundException, then the exception will  escape unhandled.&lt;/p&gt; &lt;/font&gt;&lt;/div&gt; &lt;/div&gt; &lt;pre&gt;&lt;/PRE&gt;&lt;p style="font-family:arial;color:grey" style="font-size:13px"&gt;This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.&lt;/p&gt;&lt;PRE&gt; &lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-1680986858051744995?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/1680986858051744995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=1680986858051744995&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1680986858051744995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1680986858051744995'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2010/10/java-exceptions-and-error-handling.html' title='Java Exceptions and Error Handling Interview Questions'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-1105699529725691647</id><published>2010-10-25T14:40:00.001+05:30</published><updated>2010-10-25T14:40:45.661+05:30</updated><title type='text'>What are Java Comparators and Comparables?</title><content type='html'>&lt;div style="FONT-SIZE: 13px; COLOR: #000000; DIRECTION: ltr; FONT-FAMILY: Tahoma"&gt; &lt;div dir="ltr"&gt;&lt;font face="Tahoma" color="#000000" size="2"&gt;As both names suggest (and you may have guessed), these are used for comparing objects in Java. Using these concepts; Java objects can be &lt;br&gt; sorted according to a predefined order.&lt;br&gt; &lt;br&gt; Two of these concepts can be explained as follows.&lt;br&gt; &lt;h2 class="post-subtitle2"&gt;&lt;font size="4"&gt;Comparable&lt;/font&gt;&lt;/h2&gt; A comparable object is capable of comparing itself with another object. The class itself must implements the java.lang.Comparable interface in order to be able to compare its instances.&lt;br&gt; &lt;br&gt; &lt;h2 class="post-subtitle2"&gt;&lt;font size="4"&gt;Comparator&lt;/font&gt;&lt;/h2&gt; A comparator object is capable of comparing two different objects. The class is not comparing its instances, but some other class's instances. This comparator class must implement the java.util.Comparator interface&lt;/font&gt;&lt;/div&gt; &lt;/div&gt; &lt;pre&gt;&lt;/PRE&gt;&lt;p style="font-family:arial;color:grey" style="font-size:13px"&gt;This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.&lt;/p&gt;&lt;PRE&gt; &lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-1105699529725691647?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/1105699529725691647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=1105699529725691647&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1105699529725691647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1105699529725691647'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2010/10/what-are-java-comparators-and.html' title='What are Java Comparators and Comparables?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-7659335974404151484</id><published>2010-10-25T14:18:00.001+05:30</published><updated>2010-12-24T14:46:13.018+05:30</updated><title type='text'>Advantages of Hibernate</title><content type='html'>&lt;div style="FONT-SIZE: 13px; COLOR: #000000; DIRECTION: ltr; FONT-FAMILY: Tahoma"&gt;&lt;br /&gt;&lt;div dir="ltr"&gt;&lt;span style="font-family:Tahoma;font-size:85%;color:#000000;"&gt;&lt;div class="entry-content"&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Caching objects.&lt;/strong&gt; The session is a transaction-level cache of persistent objects. You may also enable a JVM-level/cluster cache to memory and/or local disk. &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Executing SQL statements later,&lt;/strong&gt; when needed. The session never issues an INSERT or UPDATE until it is actually needed. So if an exception occurs and you need to abort the transaction, some statements will never actually be issued. Furthermore, this keeps lock times in the database as short as possible (from the late UPDATE to the transaction end). &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Never updating unmodified objects.&lt;/strong&gt; It is very common in hand-coded &lt;a class="answerlink" href="http://www.answers.com/topic/jdbc?nafid=22"&gt;JDBC&lt;/a&gt; to see the persistent state of an object updated, just in case it changed…..for example, the user pressed the save button but may not have edited any fields. Hibernate always knows if an object's state &lt;em&gt;actually&lt;/em&gt; changed, as long as you are inside the same (possibly very long) unit of work. &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Efficient Collection Handling.&lt;/strong&gt; Likewise, Hibernate only ever inserts/updates/deletes collection rows that actually changed. &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Rolling two updates into one.&lt;/strong&gt; As a &lt;a class="answerlink" href="http://www.answers.com/topic/corollary?nafid=22"&gt;corollary&lt;/a&gt; to (1) and (3), Hibernate can roll two seemingly unrelated updates of the same object into one UPDATE statement. &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Updating only the modified columns.&lt;/strong&gt; Hibernate knows exactly which columns need updating and, if you choose, will update only those columns. &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Outer join fetching.&lt;/strong&gt; Hibernate implements a very efficient outer-join fetching algorithm! In addition, you can use &lt;em&gt;subselect&lt;/em&gt; and &lt;em&gt;batch&lt;/em&gt; pre-fetch optimizations. &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Lazy collection initialization.&lt;/strong&gt; &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Lazy object initialization.&lt;/strong&gt; Hibernate can use runtime-generated proxies (CGLIB) or interception injected through bytecode instrumentation at build-time. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;A few more (optional) features of Hibernate that your handcoded JDBC may or may not currently benefit from&lt;/p&gt;&lt;ul&gt;&lt;li&gt;second-level caching of arbitrary query results, from HQL, Criteria, and even native &lt;a class="answerlink" href="http://www.answers.com/topic/sql?nafid=22"&gt;SQL&lt;/a&gt; queries &lt;/li&gt;&lt;li&gt;efficient 'PreparedStatement' caching (Hibernate &lt;em&gt;always&lt;/em&gt; uses 'PreparedStatement' for calls to the database) &lt;/li&gt;&lt;li&gt;JDBC 2 style batch updates &lt;/li&gt;&lt;li&gt;Pluggable connection pooling &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-7659335974404151484?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/7659335974404151484/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=7659335974404151484&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/7659335974404151484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/7659335974404151484'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2010/10/advantages-of-hibernate.html' title='Advantages of Hibernate'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-8359195444118212712</id><published>2010-10-24T14:57:00.001+05:30</published><updated>2010-10-24T14:57:59.908+05:30</updated><title type='text'>Multiple Resource bundle in struts.</title><content type='html'>&lt;div class="gmail_quote"&gt;I had got one requirement from client as I had to implement multiple resource bundles and define same key in both bundle.&lt;br&gt; &lt;br&gt;Example –&lt;br&gt; &lt;br&gt;Say I have ApplicationResources.properties which has all global level messages defined and another module specific property file. If because of some reason the key didn't find in module specific file then System should display message from my global (ApplicationResources.properties) file.&lt;br&gt;  &lt;br&gt;I struggled a lot to find solution for the same and finally I found one.&lt;br&gt; &lt;br&gt;Keep both properties files in class path.&lt;br&gt;updated struts-config.xml file as below&lt;br&gt; &lt;br&gt;&amp;lt;message-resources parameter=&amp;quot;Account,ApplicationResources&amp;quot; null=&amp;quot;false&amp;quot; /&amp;gt;&lt;br&gt;  &lt;br&gt;Create CustomeActionServlet and  CustomMessageResources.javause &amp;lt;bean:message&amp;gt; tag in the jsp to display text &lt;br&gt;And the message will be render from all files. Download here.. &lt;/div&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-8359195444118212712?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/8359195444118212712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=8359195444118212712&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/8359195444118212712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/8359195444118212712'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2010/10/multiple-resource-bundle-in-struts.html' title='Multiple Resource bundle in struts.'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-614146291873574522</id><published>2009-07-23T19:16:00.003+05:30</published><updated>2010-12-24T14:44:52.232+05:30</updated><title type='text'>How to find unused code in Eclipse</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Its easy to find unused code using eclipse editor .The java compiler detects unreachable code, unused variables, parameters, imports and unused private types, methods and fields.&lt;br /&gt;The setting is on the Java &gt; Compiler preference page.&lt;/span&gt;&lt;img id="BLOGGER_PHOTO_ID_5361655053054522450" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 281px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_e7A8Ag097L4/Smhs3Q1-NFI/AAAAAAAAADE/fGcim0nIAdo/s320/Eclipse-unused-Code.bmp" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-614146291873574522?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/614146291873574522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=614146291873574522&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/614146291873574522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/614146291873574522'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2009/07/how-to-find-unused-code-in-eclipse.html' title='How to find unused code in Eclipse'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_e7A8Ag097L4/Smhs3Q1-NFI/AAAAAAAAADE/fGcim0nIAdo/s72-c/Eclipse-unused-Code.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-1025781734948915478</id><published>2009-07-23T19:14:00.001+05:30</published><updated>2010-12-24T14:45:26.759+05:30</updated><title type='text'>C to Java converter</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;While browsing I found very cool tool which converts C code to java code. I know everybody would be things how?? Need to know how?? &lt;a href="http://www.soften.ktu.lt/~stonis/c2java/index.html"&gt;Read more….&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-1025781734948915478?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/1025781734948915478/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=1025781734948915478&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1025781734948915478'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1025781734948915478'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2009/07/c-to-java-converter.html' title='C to Java converter'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-7154429796733489341</id><published>2009-07-23T18:56:00.002+05:30</published><updated>2009-08-01T23:23:26.911+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='zip'/><title type='text'>How to create a ZIP File</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Java tip illustrates a method of creating a ZIP file. ZIP is a universal format used by many applications to compress their files. By using this option developer may give their user an option of compressing their files in ZIP format. Read &lt;a href="http://www.java-tips.org/java-se-tips/java.util.zip/how-to-create-a-zip-file.html"&gt;more on....&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-7154429796733489341?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/7154429796733489341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=7154429796733489341&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/7154429796733489341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/7154429796733489341'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2009/07/how-to-create-zip-file.html' title='How to create a ZIP File'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-7739860175358404156</id><published>2009-07-23T18:48:00.000+05:30</published><updated>2009-07-23T18:53:57.706+05:30</updated><title type='text'>Top 10 Things Need to Know About Java SE 6</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Version 6 of the Java Platform, Standard Edition (Java SE), was released for general availability in December 2006. So here are the top 10 things you need to know about the release, if you're still hovering hesitantly over&lt;br /&gt;Web Services &lt;br /&gt;Scripting&lt;br /&gt;Database&lt;br /&gt;More Desktop APIs&lt;br /&gt;Monitoring and Management&lt;br /&gt;Compiler Access&lt;br /&gt;Pluggable Annotations&lt;br /&gt;Desktop Deployment&lt;br /&gt;Security&lt;br /&gt;The -lities: Quality, Compatibility, Stability&lt;br /&gt; Know more about above point on &lt;/span&gt;&lt;a href="http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/beta2.html"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;link&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;….&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-7739860175358404156?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/7739860175358404156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=7739860175358404156&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/7739860175358404156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/7739860175358404156'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2009/07/top-10-things-need-to-know-about-java.html' title='Top 10 Things Need to Know About Java SE 6'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-8963612108501119645</id><published>2009-06-07T22:37:00.002+05:30</published><updated>2009-06-07T22:43:20.116+05:30</updated><title type='text'>The J2EE Architect's Handbook</title><content type='html'>&lt;span style="font-family:arial;"&gt;This book is written for technical architects and senior developers tasked with designing and leading the development of J2EE java applications. This book will guide the architect through the entire process of delivering a project from analysis through application deployment providing numerous tips, tricks, and “best practices” along the way.&lt;br /&gt;It is available in ZIP format.&lt;br /&gt;&lt;/span&gt;&lt;a href="http://www.theserverside.com/tt/books/DVTPress/J2EEArchitectsHandbook/index.tss"&gt;&lt;span style="font-family:arial;"&gt;Download..&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-8963612108501119645?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/8963612108501119645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=8963612108501119645&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/8963612108501119645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/8963612108501119645'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2009/06/j2ee-architects-handbook.html' title='The J2EE Architect&apos;s Handbook'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-1658691118972433339</id><published>2009-05-30T15:36:00.001+05:30</published><updated>2009-05-30T15:40:35.433+05:30</updated><title type='text'>Coding Standards - Part IV</title><content type='html'>&lt;strong&gt;Error and Exception Handling &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Does the code avoid catching Exception (as opposed to more specific exception types)? &lt;br /&gt;Does the code avoid throwing an explicit Exception object? &lt;br /&gt;&lt;br /&gt;Does the code avoid having empty catch blocks? &lt;br /&gt;&lt;br /&gt;Do methods check for null / empty arguments using Asserts in the Service Layer?&lt;br /&gt;"E.g. &lt;br /&gt;  public void identifyUnadjustableCharges(List&lt;ChargesDetail&gt; chargesDetails) {&lt;br /&gt;    Assert.notNull(chargesDetails,""Charges detail cannot be null."");&lt;br /&gt;    Assert.notEmpty(chargesDetails,""Charges detail cannot be empty."");"&lt;br /&gt;&lt;br /&gt;Does the code use logging instead of System.out.println() or Throwable.printStackTrace()? &lt;br /&gt;&lt;br /&gt;Are log types (fatal, error, warn, info, debug and trace) used appropriately? &lt;br /&gt; &lt;br /&gt;&lt;strong&gt;Comment Rules &lt;/strong&gt;&lt;br /&gt;Is the amount of commenting appropriate?&lt;br /&gt;A good rule of thumb is a ratio of comments to code of about 20-25%.&lt;br /&gt;Commenting just for the sake of commenting should be avoided.&lt;br /&gt;&lt;br /&gt;Are all date comments in the format YYYY/MM/DD? &lt;br /&gt;&lt;br /&gt;Are all class members commented except for getters/setters? &lt;br /&gt; &lt;br /&gt;&lt;strong&gt;Unit Test&lt;/strong&gt;  &lt;br /&gt;&lt;br /&gt;Do test cases use meaningful Input combinations?&lt;br /&gt;Include boundary conditions and invalid conditions. Null inputs has to be tested&lt;br /&gt;&lt;br /&gt;Do test cases adequately cover functionality?&lt;br /&gt;Test should exercise most of branches.80% code coverage is a good rule-of-thumb. &lt;br /&gt;Is every method tested?&lt;br /&gt;Simple getters and setters can be exempted. &lt;br /&gt;&lt;br /&gt;Are all test cases independent of one another?  &lt;br /&gt;&lt;br /&gt;Is all test code under test folder?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-1658691118972433339?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/1658691118972433339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=1658691118972433339&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1658691118972433339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1658691118972433339'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2009/05/coding-standards-part-iv.html' title='Coding Standards - Part IV'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-5993182715532144792</id><published>2009-05-30T15:34:00.000+05:30</published><updated>2009-05-30T15:35:59.738+05:30</updated><title type='text'>Coding Standards - Part-III</title><content type='html'>&lt;strong&gt;Hibernate&lt;/strong&gt; &lt;br /&gt;Does the DAO extend Spring's Hibernate DAO support class? &lt;br /&gt;&lt;br /&gt;Does the DAO methods throw Spring's DataAccessException?&lt;br /&gt;Like All DAO methods should throw Spring DataAccessException. Also, declare the throw in the DAO interface.&lt;br /&gt;&lt;br /&gt;Does the Hibernate code generate n+1 queries for 1 to many queries?&lt;br /&gt;i.e. If code fetchs parent class along with its childern, it should only issue one query. Verify by viewing the logs.&lt;br /&gt;&lt;br /&gt;Does the HQL uses named parameters?&lt;br /&gt;&lt;br /&gt;Does the collection mappings have lazy initialization set to true?&lt;br /&gt;All collections should lazy initialized; Verify by looking at the logs.&lt;br /&gt; &lt;br /&gt;&lt;strong&gt;Struts&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;Does the code use duplicate form submission for POST operations?&lt;br /&gt;use saveToken and isTokenMethod in the action class&lt;br /&gt;&lt;br /&gt;Does the name of the action class conform with the naming conventions? &lt;br /&gt;&lt;br /&gt;Does the action class contain business logic?&lt;br /&gt;Verify that most of the code is for page flow, validation, object conversion etc.&lt;br /&gt;&lt;br /&gt;Is the action scope set to "request" in the mapping? &lt;br /&gt; &lt;br /&gt;&lt;strong&gt;JSP&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Are labels and texts externalize to properties files? &lt;br /&gt;&lt;br /&gt;Does the code use JSTL?&lt;br /&gt;Majority of the code should be written in JSLT. &lt;br /&gt;&lt;br /&gt;Are the html tages lower case?&lt;br /&gt;All html tags should be lower case.&lt;br /&gt;&lt;br /&gt;JSP's that will be used for AJAX should not contain the HEAD and BODY tags.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-5993182715532144792?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/5993182715532144792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=5993182715532144792&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/5993182715532144792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/5993182715532144792'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2009/05/coding-standards-part-iii.html' title='Coding Standards - Part-III'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-422393058706093745</id><published>2009-05-30T15:30:00.000+05:30</published><updated>2009-05-30T15:31:44.330+05:30</updated><title type='text'>Coding Standards - Part II</title><content type='html'>&lt;strong&gt;Naming: (mostly covered by checkstyle)&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;Are class, variable, and method names descriptive?&lt;br /&gt;Like Other than following naming convention, all names should be descriptive&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;Coding Standard &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Is the code self-descriptive and easily understood?&lt;br /&gt;Like Code should be self-descriptive and logically paragraphed.If a reviewer can not get general idea of a method in 30 seconds,&lt;br /&gt;either the design or the comments should be updated&lt;br /&gt;     &lt;br /&gt;Does the code use if/else for mutually exclusive conditions rather than if/if?&lt;br /&gt;like avoid using flat if while nested conditionals are more accurate&lt;br /&gt;&lt;br /&gt;When comparing a constant with a variable, is the constant's equals() method used?&lt;br /&gt;like Avoid null object reference&lt;br /&gt;&lt;br /&gt;Are static final String constants used instead of string literals? &lt;br /&gt;&lt;br /&gt;Is StringBuilder used instead of appending Strings? &lt;br /&gt;&lt;br /&gt;Is StringBuilder used instead of StringBuffer? &lt;br /&gt;&lt;br /&gt;Are JDK  1.5 enhanced for loops used instead of using index on collections? &lt;br /&gt;&lt;br /&gt;Does the code use equals() instead of comparing references (==||!=)? &lt;br /&gt;&lt;br /&gt;Does the code check instanceof before a casting? &lt;br /&gt;&lt;br /&gt;Does the code check for null before accessing an object? &lt;br /&gt;&lt;br /&gt;Does the code use Spring for resource access? &lt;br /&gt;&lt;br /&gt;Are variables declared using an interface when available rather than a class?  &lt;br /&gt;&lt;br /&gt;Does the code avoid making assignments to loop iterator variables?&lt;br /&gt;&lt;br /&gt;Assignment to loop variable makes the code difficult to read and maintain&lt;br /&gt;&lt;br /&gt;Does the code avoid using unnecessary return statements? &lt;br /&gt;&lt;br /&gt;Will all loops terminate whether or not an exception occurs?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-422393058706093745?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/422393058706093745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=422393058706093745&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/422393058706093745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/422393058706093745'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2009/05/coding-standards-part-ii.html' title='Coding Standards - Part II'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-8814934351901617524</id><published>2009-05-28T21:03:00.005+05:30</published><updated>2009-05-30T15:56:29.954+05:30</updated><title type='text'>Coding Standards - Part I</title><content type='html'>Some of you would be thinking why do need coding Standards. As a developer, I would like to highlight few points which will definatly convince every developer why we need to follow coding Standards. &lt;br /&gt;           The best applications are coded properly. This sounds like an obvious statement, but by 'properly', I mean that the code not only does its job well, but is also easy to add to, maintain and debug. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Why do need coding Standards?&lt;/strong&gt;&lt;br /&gt;1)80% of the lifetime cost of a piece of software goes to maintenance. &lt;br /&gt;2)Hardly any software is maintained for its whole life by the original author. &lt;br /&gt;etc etc...&lt;br /&gt;     Code conventions/Standards improve the readability of the software, allowing engineers to understand new code more quickly and thoroughly. &lt;br /&gt;&lt;br /&gt;1)Coding standards are great -- but how do you decide which standards you want to apply, and how they will be defined? When you formulate your ideal coding style, you should think about these points&lt;br /&gt;&lt;br /&gt;2)Can you actually read the code? Is it spaced out clearly?&lt;br /&gt;&lt;br /&gt;3)Do you separate blocks of code into 'paragraphs' so that different sections are &lt;br /&gt;  easily defined? &lt;br /&gt;&lt;br /&gt;4)Are you using indentation to show where control structures (if, else, while and &lt;br /&gt;  other loops) begin and end, and where the code within them is? &lt;br /&gt;&lt;br /&gt;5)Are your variable naming conventions consistent throughout the code and do they &lt;br /&gt;  briefly describe that data that they'll contain? &lt;br /&gt;&lt;br /&gt;6)Are functions named in accordance with what they do? &lt;br /&gt;&lt;br /&gt;7)If you come back to the code in a few weeks or months, will you be able to work &lt;br /&gt;  out what's happening without needing to look at every line?&lt;br /&gt;&lt;br /&gt;8)How are you commenting the work?&lt;br /&gt;&lt;br /&gt;9)Have you used complex language functions/constructs that are quicker to write but &lt;br /&gt;  affect readability?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-8814934351901617524?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/8814934351901617524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=8814934351901617524&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/8814934351901617524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/8814934351901617524'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2009/05/coding-standards-part-i.html' title='Coding Standards - Part I'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-6925205154607719781</id><published>2009-05-10T15:41:00.004+05:30</published><updated>2009-05-28T20:59:41.477+05:30</updated><title type='text'>Improving code quality with Eclipse plugins (Check-Style and PMD))</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;One of my primary goals when developing software is either preventing a defect from being introduced into a code base or limiting its lifetime; in other words, I try to find defects as early as possible. Obviously, the more I learn about how to write better code and learn how to effectively test software, the better I am at catching defects. But, I also like to have a safety net that can find potential defects. To achieve this we have lots of plug-in available on the Internet. I would suggest to used PMD as i found this is one of the most useful tool to improve the code quality as well as Its very easy to install. The plug-in which I found on Internet is check-Style, This is also one of the best tool I have ever used. Other than PMD and check-Style there lot other plug-in available, please find details for few as below&lt;br /&gt;&lt;a name="N100C3"&gt;&lt;/a&gt;&lt;br /&gt;Table 1. List of code improvement plugins and installation URLs&lt;br /&gt;&lt;strong&gt;CheckStyle :&lt;/strong&gt; Coding standard analysis - &lt;a href="http://eclipse-cs.sourceforge.net/update/"&gt;http://eclipse-cs.sourceforge.net/update/&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;Coverlipse :&lt;/strong&gt; Test code coverage - &lt;a href="http://coverlipse.sf.net/update"&gt;http://coverlipse.sf.net/update&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;CPD&lt;/strong&gt; :Copy/Paste detection - &lt;a href="http://pmd.sourceforge.net/eclipse/"&gt;http://pmd.sourceforge.net/eclipse/&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;JDepend:&lt;/strong&gt; Package dependency analysis - &lt;a href="http://andrei.gmxhome.de/eclipse/"&gt;http://andrei.gmxhome.de/eclipse/&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;PMD&lt;/strong&gt; Coding standard analysis - &lt;a title="http://pmd.sourceforge.net/" href="http://pmd.sourceforge.net/"&gt;http://pmd.sourceforge.net/&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-6925205154607719781?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/6925205154607719781/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=6925205154607719781&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/6925205154607719781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/6925205154607719781'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2009/05/improving-code-quality-with-eclipse.html' title='Improving code quality with Eclipse plugins (Check-Style and PMD))'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-6370852978563562451</id><published>2009-05-01T13:30:00.002+05:30</published><updated>2009-05-01T16:07:49.302+05:30</updated><title type='text'>REST vs SOAP Webservices</title><content type='html'>&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;After long time I am updating my blog since, I was very busy with my new project. Today I got some free time so thought I will update my blog with technology which I am using in my project. this time I am working on RESTful webservices ...ummm I know what next is coming in your mind..... what is RESTFul webservice and how its different from the the SOAP right ??? so here we go......&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;REST -&lt;/strong&gt; stands for "Representational State Transfer", this basically means that each unique URL is a representation of some object. You can get the contents of that object using an HTTP GET, to delete it, you then might use a POST, PUT, or DELETE to modify the object (in practice most of the services use a POST for this).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;SOAP -&lt;/strong&gt; stands for "Simple Object Access Protocol" was designed to be a platform and language-neutral alternative to previous middleware techologies like &lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.omg.org/docs/formal/04-03-12.pdf"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;CORBA&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;font-size:85%;"&gt; and DCOM&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;strong&gt;Pros and cons of SOAP &lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;Pros :&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Langauge, platform, and transport agnostic &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Designed to handle distributed computing environments&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Is the prevailing standard for web services, and hence has better support from other standards (WSDL, WS-*) and tooling from vendors Built-in error handling (faults) Extensibility &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div align="justify"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Cons:&lt;/strong&gt; &lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Conceptually more difficult, &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;more "heavy-weight" than REST &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;More verbose Harder to develop, requires tools &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;strong&gt;Pros and cons of REST&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;Pros:&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Language and platform agnostic &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Much simpler to develop than SOAP &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Small learning curve, less reliance on tools &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Concise, no need for additional messaging layer &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Closer in design and philosophy to the Web &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Cons :&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Assumes a point-to-point communication model&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Generaly not usable for distributed computing environment where message may go through one or more intermediaries &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Lack of standards support for security, policy, reliable messaging, etc.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Services that have more sophisticated requirements are harder to develop ("roll your own") Tied to the HTTP transport model&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-6370852978563562451?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/6370852978563562451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=6370852978563562451&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/6370852978563562451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/6370852978563562451'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2009/05/resr-vs-soap-webservices.html' title='REST vs SOAP Webservices'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-1212418963232700336</id><published>2008-09-22T09:58:00.002+05:30</published><updated>2008-09-22T10:03:13.520+05:30</updated><title type='text'>Hibernate Vs JDBC</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Following link has very good explanation about hibernate and JDBC as well as it explains difference between hibernate and JDBC.&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.mindfiresolutions.com/mindfire/Java_Hibernate_JDBC.pdf"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;http://www.mindfiresolutions.com/mindfire/Java_Hibernate_JDBC.pdf&lt;/span&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-1212418963232700336?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/1212418963232700336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=1212418963232700336&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1212418963232700336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1212418963232700336'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/09/hibernate-vs-jdbc.html' title='Hibernate Vs JDBC'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-1183945770239675277</id><published>2008-09-22T09:00:00.000+05:30</published><updated>2008-09-22T09:58:01.826+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design patterns'/><title type='text'>Explain Facade Design Pattern in Java?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;The objective of Facade pattern is to make a complex system simple. It is achieved by providing a unified or general interface, which is a higher layer to these subsystems.Facade pattern decouples subsystems, reduce its dependency, and improve portability,makes an entry point to your subsystems and hides clients from subsystem components and their implementation.&lt;br /&gt;JDBC design is a good example of Façade pattern. A database design is complicated. JDBC is used to connect the database and manipulate data without exposing details to the clients.&lt;br /&gt;A client is exposed to certain set of methods like just getting a single instance of database connection or closing it when not required.&lt;br /&gt;Another possibility is designing security of a system with Façade pattern. Clients' authorization to access information may be classified. General users may be allowed to access general information, special guests may be allowed to access more information,administrators and executives may be allowed to access the most important information. These subsystems may be generalized by oneinterface. The identified users may be directed to the relatedsubsystems.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-1183945770239675277?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/1183945770239675277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=1183945770239675277&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1183945770239675277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1183945770239675277'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/09/explain-facade-design-pattern-in-java.html' title='Explain Facade Design Pattern in Java?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-1140493212341535071</id><published>2008-09-18T16:52:00.002+05:30</published><updated>2008-09-18T17:03:28.163+05:30</updated><title type='text'>What Is Caster Mapping?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Castor XML mapping is a way to simplify the binding of java classes to XML document. It allows to transform the data contained in a java object model into/from an XML document.&lt;br /&gt;Although it is possible to rely on Castor's default behavior to marshal and unmarshal Java objects into an XML document, it might be necessary to have more control over this behavior. For example, if a Java object model already exists, Castor XML Mapping can be used as a bridge between the XML document and that Java object model.&lt;br /&gt;Castor allows one to specify some of its marshalling/unmarshalling behavior using a mapping file. This file gives explicit information to Castor on how a given XML document and a given set of Java objects relate to each other...........&lt;a href="http://www.castor.org/xml-mapping.html"&gt;http://www.castor.org/xml-mapping.html&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-1140493212341535071?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/1140493212341535071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=1140493212341535071&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1140493212341535071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1140493212341535071'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/09/what-is-caster-mapping.html' title='What Is Caster Mapping?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-9119014882944136159</id><published>2008-06-30T15:02:00.000+05:30</published><updated>2008-06-30T15:02:05.332+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActionMessage'/><category scheme='http://www.blogger.com/atom/ns#' term='ActionErrors'/><title type='text'>What are the differences between ActionErrors and ActionMessage?/What are the differences between Action.saveErrors(...) and Action.saveMessages(...)?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;To summarize, the difference between the classes ActionErrors/ActionError/ActionMessages/ActionMessage has absolutely nothing to do with the difference in behavior in Action.saveErrors(...) and Action.saveMessages(...)The &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;difference between the classes is zero -- all behavior in ActionErrors was pushed up into ActionMessages and all behavior in ActionError was pushed up into ActionMessage. This was done in the attempt to clearly signal that these classes can be used to pass any kind of messages from the controller to the view -- errors being only one kind of message. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;The difference between saveErrors(...) and saveMessages(...) is simply the attribute name under which the ActionMessages object is stored, providing two convenient default locations for storing controller messages for use by the view. If you look more closely at the html:errors and html:messages tags, you can actually use them to get an ActionMessages object from any arbitrary attribute name in any scope.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;The difference between html:errors and html:messages is purely in syntax and model -- both tags *default* to look for an ActionMessages object under Globals.ERROR_KEY despite the difference in names.html:messages provides more flexibility at the cost of more typing&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-9119014882944136159?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/9119014882944136159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=9119014882944136159&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/9119014882944136159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/9119014882944136159'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/06/what-are-differences-between.html' title='What are the differences between ActionErrors and ActionMessage?/What are the differences between Action.saveErrors(...) and Action.saveMessages(...)?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-2799589181686622654</id><published>2008-06-28T15:04:00.000+05:30</published><updated>2008-06-28T15:04:00.868+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='memory leaks'/><title type='text'>First steps for diagnosis of memory leaks in Websphere Application Server v6.1</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Enable verbose GC.&lt;br /&gt;- If using Sun JVM, use the -XX:+HeapDumpOnOutOfMemoryError option to tell the VM to generate a heap dump if OutOfMemoryError is thrown. If using IBM JVM, then enable automatic heap dump generation.&lt;br /&gt;- Start the lightweight memory leak detection&lt;br /&gt;- Generate heap dumps manually if required using the wsadmin tool.&lt;br /&gt;- Use the MDD4J tool (Memory Dump Diagnostic for Java) for diagnosing root causes behind memory leaks in the Java heap. The heap dump collected in the above steps will be the input to this tool. More information about this tool can be found here , here and here.The MDD4J tool supports the following heap dump formats:1.IBM Portable Heap Dump (.phd) format (for WebSphere Application Server Versions 6.x on most platforms)2.IBM Text heap dump format (for WebSphere Application Server Versions 5.0 and 4.0 on most platforms)3.HPROF heap dump format (for WebSphere Application Server on the Solaris® and HP-UX platforms)4.SVC Dumps (WebSphere on the IBM zSeries)&lt;br /&gt;On Solaris platform, starting with Java 1.5, Sun has been shipping a cool tool called jmap which allows you to attach to any 1.5 JVM and obtain heap layout information, class histograms and complete heap snapshots. The cool thing is that you don’t have to configure the JVM with any special options, and that it therefore runs exactly as during normal operation.&lt;br /&gt;jmap -dump:format=b,file=snapshot2.jmap PID_OF_PROCESSjhat snapshot2.jmap&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-2799589181686622654?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/2799589181686622654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=2799589181686622654&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/2799589181686622654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/2799589181686622654'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/06/first-steps-for-diagnosis-of-memory.html' title='First steps for diagnosis of memory leaks in Websphere Application Server v6.1'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-1145951259792881330</id><published>2008-06-21T11:00:00.000+05:30</published><updated>2008-06-21T11:00:00.910+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSTL'/><category scheme='http://www.blogger.com/atom/ns#' term='JSP'/><category scheme='http://www.blogger.com/atom/ns#' term='JSF'/><title type='text'>JSF Interview Questions</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Does JSF require JSP? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;No, it does not. As a matter of fact, JSF was written to be render-technology neutral. This means you can use it with all sorts of non-JSP technology, including XML-based languages like XUL and templating systems like Velocity. The reference implementation includes an XUL-based example that has nothing to do with JSP. That being said, you'll definitely find more industry support behind use of JSP with JSF. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Can we use JSF with JSTL or other custom tags? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;When used with JSP, JSF is implemented with JSP custom tags (also called custom actions). The JSF tags will generally work with other custom tags that you or third-parties have developed. Faces tags can be nested within other tags, and vice-versa. In addition, there has been a lot of specific work done to make sure that JSF tags work well with JSTL custom tags. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-1145951259792881330?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/1145951259792881330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=1145951259792881330&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1145951259792881330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1145951259792881330'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/06/jsf-interview-questions.html' title='JSF Interview Questions'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-3821473488787640185</id><published>2008-06-17T15:07:00.000+05:30</published><updated>2008-06-27T14:43:40.017+05:30</updated><title type='text'>How to get localized objects in Java?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;A lot of "i18N" programs only have to deal with "strings" that need to be localized. For e.g. labels, other text etc.But what if U need a localized object ?..i.e a double object, a JPEG object etc.There is a special class in Java "ListResourceBundle" that allows a ResourseBundle to be loaded from a ".class" file.Read the tutorial below for more info :&lt;/span&gt;&lt;a href="http://java.sun.com/docs/books/tutorial/i18n/resbundle/list.html"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;http://java.sun.com/docs/books/tutorial/i18n/resbundle/list.html&lt;/span&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-3821473488787640185?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/3821473488787640185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=3821473488787640185&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/3821473488787640185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/3821473488787640185'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/06/how-to-get-localized-objects-in-java.html' title='How to get localized objects in Java?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-8815258217868610330</id><published>2008-06-06T15:08:00.000+05:30</published><updated>2008-06-27T14:42:29.430+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Weak References'/><category scheme='http://www.blogger.com/atom/ns#' term='Soft references'/><category scheme='http://www.blogger.com/atom/ns#' term='Phantom references'/><title type='text'>Soft references, Weak References, Phantom references in Java !!!</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;The Reference API in Java can leave any sane person fully confused !!!..I tried to make sense of what the different types of references are and what purpose do they solve.I am still not crystal clear about the usability of all these references, but I hope I will understand someday.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;ReferentAn object that is softly, weakly, or phantomly referenced from inside a SoftReference, WeakReference, or PhantomReference object, respectively.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Soft references:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;The garbage collector might or might not reclaim a softly reachable object depending on how recently the object was created or accessed, but is required to clear all soft references before throwing an OutOfMemoryError.Weakly reachable objects are finalized some time after their weak references have been cleared. The only real difference between a soft reference and a weak reference is that the garbage collector uses algorithms to decide whether or not to reclaim a softly reachable object, but always reclaims a weakly reachable object.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Phantomly reachable objects are objects that have been finalized, but not reclaimed.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;The garbage collector will never clear a phantom reference. All phantom references must be explicitly cleared by the program.An excellent article explaining GC in Java is given at&lt;/span&gt;&lt;a href="http://www.artima.com/insidejvm/ed2/gc17.html"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;http://www.artima.com/insidejvm/ed2/gc17.html&lt;/span&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-8815258217868610330?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/8815258217868610330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=8815258217868610330&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/8815258217868610330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/8815258217868610330'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/06/soft-references-weak-references-phantom.html' title='Soft references, Weak References, Phantom references in Java !!!'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-4633635315683095437</id><published>2008-06-05T15:10:00.000+05:30</published><updated>2008-06-15T20:26:04.974+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='map'/><category scheme='http://www.blogger.com/atom/ns#' term='set'/><category scheme='http://www.blogger.com/atom/ns#' term='list'/><category scheme='http://www.blogger.com/atom/ns#' term='Java Collections'/><title type='text'>Cool Cool The below code is in .NET C#</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;With JDK 1.2, Sun introducted the Java Collection Framework, a cool API for data-structures in Java. At the base of the heirarchy were collection interfaces like:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;List: A collection that is ordered and whose members can be accessed by index. A list can also contain duplicates and null values.Set: A collection that is not ordered and hence there are no methods that allow to access members thru a index. Also a Set does not allow duplicates and atmost one null value.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Though I personally feel that the JDK Collection framework is quite comprehensive and should suffice most development needs, it is good to know about some other alternatives:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;1) Jakarta Commons Collections - An open source initiative that contains some extra cool collections like MultiMap etc.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;2) JGL (Java Generic Library) - A port of the C++ STL (Standard tag library) to the Java language. Thought I was first impressed by this package, I think this API would appleal more to those from the C++ background. Also the latest version is no longer free, I believe.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-4633635315683095437?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/4633635315683095437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=4633635315683095437&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/4633635315683095437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/4633635315683095437'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/06/cool-cool-below-code-is-in-net-c.html' title='Cool Cool The below code is in .NET C#'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-8213015925182498498</id><published>2008-05-30T15:12:00.000+05:30</published><updated>2008-06-15T20:23:47.035+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Swings.SWT'/><category scheme='http://www.blogger.com/atom/ns#' term='AWT'/><title type='text'>Awt, Swing and SWT</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;strong&gt;AWT&lt;/strong&gt;: The idea was to wrap the native GUI widgets of the various operating systems with a platform-independent Java API called Abstract Window Toolkit (AWT). Only common widgets such as text field, text area, check box, radio button, list, and push button were supported by AWT. The graphics and imaging features were also very limited. That was, at best, enough for building simple applets.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;strong&gt;SWING&lt;/strong&gt;: is one of the most complex GUI frameworks ever developed. It has a complete set of GUI components ranging from buttons and text fields to tables, trees, and styled text editors. These components do not rely on the native widgets of the operating system; instead, Swing components are painted using graphic primitives such as lines, rectangles, and text. The painting is delegated to a look and feel (L&amp;amp;F) plug-in that can imitate the native L&amp;amp;F. Swing also has a platform-independent L&amp;amp;F called "Metal." JBuilder, uses Swing, and its speed is quite good.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;strong&gt;Standard Widget Toolkit (SWT)&lt;/strong&gt; is the GUI toolkit developed by IBM for its Eclipse IDE. SWT can be used outside of the Eclipse environment and offers direct access to the native GUI features of the operating system. Therefore, SWT-based Java applications have native GUIs and can be integrated with other native applications and components. SWT delegates to native widgets for common components (such as labels, lists, tables, and so on) as AWT does, while emulating in Java more sophisticated components (for example, toolbars are emulated when running on Motif) similarly to Swing's strategy.SWT has been designed to be as inexpensive as possible. This means (among the other things) that it is native-oriented. Anyway, it differs from AWT in a number of details. SWT provides different Java implementations for each platform, and each of these implementations calls natively (through the Java Native Interface, JNI) the underlying native implementation. The old AWT is different in that all platform-dependent details are hidden in C (native) code and the Java implementation is the same for all the platforms.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-8213015925182498498?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/8213015925182498498/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=8213015925182498498&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/8213015925182498498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/8213015925182498498'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/05/awt-swing-and-swt.html' title='Awt, Swing and SWT'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-4792222703775691194</id><published>2008-05-17T15:13:00.000+05:30</published><updated>2008-06-15T20:22:59.650+05:30</updated><title type='text'>A simple recursive function to get all files in all sub-dirs of a folder</title><content type='html'>The below code is in .NET C#public ArrayList&lt;br /&gt;&lt;br /&gt;GetAllFiles(string directory)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;ArrayList totalFilesList = new ArrayList(10);&lt;br /&gt;&lt;br /&gt;string[] files = Directory.GetFiles(directory);//add all files in that current folder.totalFilesList.AddRange(files);//Check if the current directory has sub-directories string [] subDirs = Directory.GetDirectories(directory);&lt;br /&gt;&lt;br /&gt;if(subDirs.Length &gt; 0)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;//now look for all files in current folder's sub-dir's. foreach(string subDir in subDirs)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;ArrayList tempArrayList = GetAllFiles(subDir);&lt;br /&gt;&lt;br /&gt;totalFilesList.AddRange(tempArrayList);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;return totalFilesList;&lt;br /&gt;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-4792222703775691194?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/4792222703775691194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=4792222703775691194&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/4792222703775691194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/4792222703775691194'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/05/simple-recursive-function-to-get-all.html' title='A simple recursive function to get all files in all sub-dirs of a folder'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-6424662027797839808</id><published>2008-04-30T12:06:00.000+05:30</published><updated>2008-04-29T20:22:54.601+05:30</updated><title type='text'>38. What is multithreading and what are the methods for inter-thread communication and what is the class in which these methods are defined?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Multithreading is the mechanism in which more than one thread run independent of each other within the process. wait (), notify () and notifyAll() methods can be used for inter-thread communication and these methods are in Object class. wait() : When a thread executes a call to wait() method, it surrenders the object lock and enters into a waiting state. notify() or notifyAll() : To remove a thread from the waiting state, some other thread must make a call to notify() or notifyAll() method on the same object. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-6424662027797839808?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/6424662027797839808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=6424662027797839808&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/6424662027797839808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/6424662027797839808'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/04/38-what-is-multithreading-and-what-are.html' title='38. What is multithreading and what are the methods for inter-thread communication and what is the class in which these methods are defined?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-3130513405552414332</id><published>2008-04-30T11:00:00.001+05:30</published><updated>2008-06-15T20:21:35.168+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSTL'/><category scheme='http://www.blogger.com/atom/ns#' term='JSP'/><category scheme='http://www.blogger.com/atom/ns#' term='JSF'/><title type='text'>JSF Interview Questions</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Does JSF require JSP? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;No, it does not. As a matter of fact, JSF was written to be render-technology neutral. This means you can use it with all sorts of non-JSP technology, including XML-based languages like XUL and templating systems like Velocity. The reference implementation includes an XUL-based example that has nothing to do with JSP. That being said, you'll definitely find more industry support behind use of JSP with JSF. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Can we use JSF with JSTL or other custom tags? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;When used with JSP, JSF is implemented with JSP custom tags (also called custom actions). The JSF tags will generally work with other custom tags that you or third-parties have developed. Faces tags can be nested within other tags, and vice-versa. In addition, there has been a lot of specific work done to make sure that JSF tags work well with JSTL custom tags. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-3130513405552414332?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/3130513405552414332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=3130513405552414332&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/3130513405552414332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/3130513405552414332'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/04/jsf-interview-questions.html' title='JSF Interview Questions'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-4323170375332767464</id><published>2008-04-22T10:35:00.000+05:30</published><updated>2008-04-29T20:23:59.199+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><title type='text'>What are ORMs supported by Spring and how it integrates with Hibernate?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Spring framework supports the following ORMs:&lt;br /&gt;-Hibernate&lt;br /&gt;-TopLink&lt;br /&gt;-JDO&lt;br /&gt;-iBatis&lt;br /&gt;-JPA&lt;br /&gt;and more..&lt;br /&gt;With Hibernate,Spring can be integrated in following steps:&lt;br /&gt;-Wire with datasource&lt;br /&gt;-Declaring Hibernate properties&lt;br /&gt;-Tell Spring about the Hibernate Mapping files. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-4323170375332767464?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/4323170375332767464/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=4323170375332767464&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/4323170375332767464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/4323170375332767464'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/04/how-you-will-handle-exceptions-in.html' title='What are ORMs supported by Spring and how it integrates with Hibernate?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-5418522173924772024</id><published>2008-04-21T10:57:00.000+05:30</published><updated>2008-04-21T11:06:23.344+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='JDBC'/><title type='text'>Some More JDBC Interview Questions</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;1)How do we get a JBDC connection?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;2) What are prepared statements?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;3) What are callable statements?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;4) What is the BCNF? &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;5)What is partial dependency? &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;6)What is transitive dependency?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;7) What is lossless decomposition?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;8) Is there something called `lossy' decomposition ?&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-5418522173924772024?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://javapeople.blogspot.com/2008/04/what-are-problems-you-have-with-jdbc.html' title='Some More JDBC Interview Questions'/><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/5418522173924772024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=5418522173924772024&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/5418522173924772024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/5418522173924772024'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/04/some-more-jdbc-interview-questions.html' title='Some More JDBC Interview Questions'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-3877516434182638399</id><published>2008-04-21T10:50:00.000+05:30</published><updated>2008-04-21T10:57:04.756+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='Threading'/><category scheme='http://www.blogger.com/atom/ns#' term='Thread'/><category scheme='http://www.blogger.com/atom/ns#' term='Multitasking'/><category scheme='http://www.blogger.com/atom/ns#' term='Multithreading'/><title type='text'>Java Threading/ Multithreading Interview Questions with Answers</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;strong&gt;Describe synchronization in respect to multithreading.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Ans: 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;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Explain different way of using thread?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Ans: 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;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are the two types of multitasking?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Ans :&lt;br /&gt;&lt;br /&gt;1.process-based&lt;br /&gt;&lt;br /&gt;2.Thread-based&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are the two ways to create the thread?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Ans :&lt;br /&gt;&lt;br /&gt;1.by implementing Runnable&lt;br /&gt;&lt;br /&gt;2.by extending Thread&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the signature of the constructor of a thread class?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans : Thread(Runnable threadob,String threadName)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are all the methods available in the Runnable Interface?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans : run()&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the data type for the method isAlive() and this method is available in which class?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans : boolean, Thread&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are all the methods available in the Thread class?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Ans :&lt;br /&gt;&lt;br /&gt;1.isAlive()&lt;br /&gt;&lt;br /&gt;2.join()&lt;br /&gt;&lt;br /&gt;3.resume()&lt;br /&gt;&lt;br /&gt;4.suspend()&lt;br /&gt;&lt;br /&gt;5.stop()&lt;br /&gt;&lt;br /&gt;6.start()&lt;br /&gt;&lt;br /&gt;7.sleep()&lt;br /&gt;&lt;br /&gt;8.destroy()&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are all the methods used for Inter Thread communication and what is the class in which these methods are defined?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans :&lt;br /&gt;&lt;br /&gt;1. wait(),notify() &amp;amp; notifyall()&lt;br /&gt;&lt;br /&gt;2. Object class&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;What is the mechanisam defind by java for the Resources to be used by only one Thread at a time?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans : Synchronisation&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the procedure to own the moniter by many threads?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Ans : not possible&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the unit for 1000 in the below statement?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;ob.sleep(1000)&lt;br /&gt;&lt;br /&gt;Ans : long milliseconds&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the data type for the parameter of the sleep() method?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans : long&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are all the values for the following level?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;max-priority&lt;br /&gt;&lt;br /&gt;min-priority&lt;br /&gt;&lt;br /&gt;normal-priority&lt;br /&gt;&lt;br /&gt;Ans : 10,1,5&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the method available for setting the priority?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Ans : setPriority()&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the default thread at the time of starting the program?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans : main thread&lt;br /&gt;&lt;br /&gt;The word synchronized can be used with only a method.&lt;br /&gt;&lt;br /&gt;True/ False&lt;br /&gt;&lt;br /&gt;Ans : False&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Which priority Thread can prompt the lower primary Thread?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Ans : Higher Priority&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How many threads at a time can access a monitor?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Ans : one&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are all the four states associated in the thread?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Ans : 1. new 2. runnable 3. blocked 4. dead&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The suspend()method is used to teriminate a thread?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;True /False&lt;br /&gt;&lt;br /&gt;Ans : False&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The run() method should necessary exists in clases created as subclass of thread?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;True /False&lt;br /&gt;&lt;br /&gt;Ans : True&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;When two threads are waiting on each other and can't proceed the programe is said to be in a deadlock?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;True/False&lt;br /&gt;&lt;br /&gt;Ans : True&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Which method waits for the thread to die ?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Ans : join() method&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Which of the following is true?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1) wait(),notify(),notifyall() are defined as final &amp;amp; can be called only from with in a synchronized method&lt;br /&gt;&lt;br /&gt;2) Among wait(),notify(),notifyall() the wait() method only throws IOException&lt;br /&gt;&lt;br /&gt;3) wait(),notify(),notifyall() &amp;amp; sleep() are methods of object class&lt;br /&gt;&lt;br /&gt;1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;1 &amp;amp; 2&lt;br /&gt;1,2 &amp;amp; 3&lt;br /&gt;Ans : D&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Garbage collector thread belongs to which priority?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans : low-priority&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is meant by timeslicing or time sharing?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Ans : Timeslicing is the method of allocating CPU time to individual threads in a priority schedule.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is meant by daemon thread? In java runtime, what is it's role?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Ans : Daemon thread is a low priority thread which runs intermittently in the background doing the garbage collection operation for the java runtime system.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-3877516434182638399?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/3877516434182638399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=3877516434182638399&amp;isPopup=true' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/3877516434182638399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/3877516434182638399'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/04/java-threading-multithreading-interview.html' title='Java Threading/ Multithreading Interview Questions with Answers'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-6685425904696323284</id><published>2008-04-18T15:03:00.000+05:30</published><updated>2008-04-18T13:47:08.751+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Struts'/><title type='text'>How to handle duplicate submits in Struts?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;The duplicate form submission occurs-When a user clicks the Submit button more than once before the response is sent back or- When a client accesses a view by returning to a previously bookmarked page.It may result in inconsistent transactions and must be avoided.In Struts this problem can be handled by using the saveToken() and isTokenValid() methods of Action class. saveToken() method creates a token (a unique string) and saves that in the user's current session, while isTokenValid() checks if the token stored in the user's current session is the same as that was passed as the request parameter.It can be done by loading JSP through an Action and before loading the JSP call saveToken() to save the token in the user session. When the form is submitted, check the token against that in the session by calling isTokenValid&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-6685425904696323284?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/6685425904696323284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=6685425904696323284&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/6685425904696323284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/6685425904696323284'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/04/how-to-handle-duplicate-submits-in.html' title='How to handle duplicate submits in Struts?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-1925344354724546010</id><published>2008-04-17T15:01:00.001+05:30</published><updated>2008-09-03T20:07:48.390+05:30</updated><title type='text'>Explain different inheritance mapping models in Hibernate?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;There can be three kinds of inheritance mapping in hibernate&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;1. Table per concrete class with unions&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;2. Table per class hierarchy&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;3. Table per subclassExample:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;We can take an example of three Java classes like Vehicle, which is an abstract class and two subclasses of Vehicle as Car and UtilityVan.1. Table per concrete class with unionsIn this scenario there will be 2 tablesTables: Car, UtilityVan, here in this case all common attributes will be duplicated.2. Table per class hierarchySingle Table can be mapped to a class hierarchyThere will be only one table in database named 'Vehicle' which will represent all attributes required for all three classes.Here it is be taken care of that discriminating columns to differentiate between Car and UtilityVan3. Table per subclassSimply there will be three tables representing Vehicle, Car and UtilityVan&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-1925344354724546010?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/1925344354724546010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=1925344354724546010&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1925344354724546010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1925344354724546010'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/04/explain-different-inheritance-mapping.html' title='Explain different inheritance mapping models in Hibernate?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-5002270797014349972</id><published>2008-04-17T14:59:00.000+05:30</published><updated>2008-04-17T15:27:39.006+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='JDBC'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><title type='text'>What are the problems you have with JDBC and how does Spring framework help to resolve them?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;JDBC helps in accessing underlying RDBMS but it sometimes be quite cumbersome to use them and in following situations it become problematic:&lt;br /&gt;-You have to ensure that ResultSets, Statements and (most importantly) Connections are closed after use. Hence correct use of JDBC results in a lot of code which is a common source of errors. Connection leaks can quickly bring applications down under load.&lt;br /&gt;-The SQLException does not provide much information about what actually the probelm is as JDBC does not offer an exception hierarchy, but throws SQLException in response to all errors.The meaning of these values varies among databases.&lt;br /&gt;Spring addresses these problems in two ways:&lt;br /&gt;-By providing APIs that move tedious and error-prone exception handling out of application code into the framework. The framework takes care of all exception handling; application code can concentrate on issuing the appropriate SQL and extracting results. -By providing a meaningful exception hierarchy for your application code to work with in place of SQLException. When Spring first obtains a connection from a DataSource it examines the metadata to determine the database product. It uses this knowledge to map SQLExceptions to the correct exception in its own hierarchy descended from org.springframework.dao.DataAccessException. Thus your code can work with meaningful exceptions, and need not worry about proprietary SQLState or error codes. Spring's data access exceptions are not JDBC-specific, so your DAOs are not necessarily tied to JDBC because of the exceptions they may throw&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-5002270797014349972?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/5002270797014349972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=5002270797014349972&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/5002270797014349972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/5002270797014349972'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/04/what-are-problems-you-have-with-jdbc.html' title='What are the problems you have with JDBC and how does Spring framework help to resolve them?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-977288175809482240</id><published>2008-04-17T14:54:00.000+05:30</published><updated>2008-04-17T15:26:38.535+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='errors'/><category scheme='http://www.blogger.com/atom/ns#' term='Struts'/><category scheme='http://www.blogger.com/atom/ns#' term='exceptions'/><title type='text'>How you will handle errors and exceptions in Struts?</title><content type='html'>&lt;p&gt;&lt;span style="font-size:85%;"&gt;An efficient error and exception handling makes an application behave gracefully under abnormal conditions.Struts has errors and exception handling done in different ways.The form validations using Struts require a proper mechanism.For handling errors in Struts,it has two objects ActionError and ActionErrors.Whenever a form is submitted then cotroller receives request and then create ActionForm object which calls reset() method and stores ActionForm object to required scope and then it loads ActionForm object from request and calls validate() method.If validate method fails then errors are displayed on the form itself through html:errors tags.&lt;br /&gt;Exception Handling can be done in following ways: &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;-try-catch block within -Using declarative exception handling.In struts-config.xml we can declare on which type of exception, a request should be redirected to.Use Global Exceptions tag in struts-config.xml&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;global-exceptions&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;"&lt;"exception key="errors.MyException" type="java.lang.MyException" path="/myExcption.jsp"/ "&gt;"&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;So whenever MyException occurs then Struts framework will display 'myException.jsp' page.The interpretation of this is that if MyException is caught by Struts' ActionServlet then it should redirect to myExcption.jsp. The key is as usual a pointer to the message resource file. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-977288175809482240?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/977288175809482240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=977288175809482240&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/977288175809482240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/977288175809482240'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/04/how-you-will-handle-errors-and.html' title='How you will handle errors and exceptions in Struts?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-574061332908021666</id><published>2008-04-16T15:05:00.000+05:30</published><updated>2008-04-17T15:06:57.024+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Heap Analysis'/><category scheme='http://www.blogger.com/atom/ns#' term='Memory Leak'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><title type='text'>What causes memory leaks in Java?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;We know that a memory leak can occur in Java applications when object references are unintentionally held onto after the references are no longer needed. Typical examples of these are large collection objects, a unbounded cache, large number of session objects, infinite loops etc. A memory leak results in a OutOfMemoryError.Besides this core reason, there are other factors that may also result in a OutOfMemoryError exception&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;1. Java heap fragmentation: Heap fragmentation occurs when no contiguous chunk of free Java heap space is available from which to allocate Java objects. Various causes for this problem exist, including the repeated allocation of large objects (no single large fragment in first generation). In this case, even if we see good amount of free heap, memory allocation fails.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;2. Memory leaks in native heap. This problem occurs when a native component, like database connections, is leaking.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;3. Perm size has exhausted. The permanent generation of the heap contains class objects. If your code is using a lot of reflection/introspection, then a number of temporary class objects are created that would exhaust the perm space. More info can be found &lt;/span&gt;&lt;a href="http://narencoolgeek.blogspot.com/2007/08/heap-size-and-perm-size.html"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;here&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-574061332908021666?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/574061332908021666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=574061332908021666&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/574061332908021666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/574061332908021666'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/04/what-causes-memory-leaks-in-java.html' title='What causes memory leaks in Java?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-6409753988231071176</id><published>2008-04-11T10:47:00.000+05:30</published><updated>2008-04-11T10:49:20.331+05:30</updated><title type='text'>Collection Of good Technical Websites For Tutorials And Books</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Enterprise JavaBeans Tutorial&lt;/span&gt;&lt;br /&gt;&lt;a href="http://developer.java.sun.com/developer/onlineTraining/Beans/EJBTutorial/index.html" target="_blank"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;http://developer.java.sun.com/developer/onlineTraining/Beans/EJBTutorial/index.html&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;JavaBeans Short &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Course&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://developer.java.sun.com/developer/onlineTraining/Beans/JBShortCourse/index.html" target="_blank"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;http://developer.java.sun.com/developer/onlineTraining/Beans/JBShortCourse/index.html&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Introduction to the JavaBeans API&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://developer.java.sun.com/developer/onlineTraining/Beans/JBeansAPI/index.html" target="_blank"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;http://developer.java.sun.com/developer/onlineTraining/Beans/JBeansAPI/index.html&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.indijava.in/community/node/94"&gt;read more&lt;br /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-6409753988231071176?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/6409753988231071176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=6409753988231071176&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/6409753988231071176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/6409753988231071176'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/04/collection-of-good-technical-websites.html' title='Collection Of good Technical Websites For Tutorials And Books'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-1294563656802160709</id><published>2008-04-08T14:04:00.000+05:30</published><updated>2008-04-08T14:19:42.571+05:30</updated><title type='text'>Developer and Testing/Tester</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Development and testing are two sides of coin, without development testing can’t be possible and without testing development can’t be complete. As a developer what I feel is a developer should be good tester to deliver quality of product&lt;br /&gt;&lt;br /&gt;Following list of Questions are helpful for tester as well as developer so that developer can become good tester and tester can become very very good in testing to deliver quality of product.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;1. What is Software Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;2. What is the Purpose of Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;3. What types of testing do testers perform?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;4. What is the Outcome of Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;5. What kind of testing have you done?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;6. What is the need for testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;7. What are the entry criteria for Functionality and Performance testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;8. What is test metrics?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;9. Why do you go for White box testing, when Black box testing is available?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;10. What are the entry criteria for Automation testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;11. When to start and Stop Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;12. What is Quality?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;13. What is Baseline document, Can you say any two?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;14. What is verification?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;15. What is validation?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;16. What is quality assurance?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;17. What is quality control?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;18. What is SDLC and TDLC?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;19. What are the Qualities of a Tester?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;20. When to start and Stop Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;21. What are the various levels of testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;22. What are the types of testing you know and you experienced?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;23. What exactly is Heuristic checklist approach for unit testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;24. After completing testing, what would you deliver to the client?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;25. What is a Test Bed?26. What is a Data Guidelines?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;27. Why do you go for Test Bed?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;28. What is Severity and Priority and who will decide what?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;29. Can Automation testing replace manual testing? If it so, how?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;30. What is a test case?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;31. What is a test condition?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;32. What is the test script?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;33. What is the test data?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;34. What is an Inconsistent bug?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;35. What is the difference between Re-testing and Regression testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;36. What are the different types of testing techniques?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;37. What are the different types of test case techniques?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;38. What are the risks involved in testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;39. Differentiate Test bed and Test Environment?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;40. What ifs the difference between defect, error, bug, failure, fault?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;41. What is the difference between quality and testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;42. What is the difference between White &amp;amp; Black Box Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;43. What is the difference between Quality Assurance and Quality Control?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;44. What is the difference between Testing and debugging?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;45. What is the difference between bug and defect?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;46. What is the difference between verification and validation?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;47. What is the difference between functional spec. and Business requirement specification?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;48. What is the difference between unit testing and integration testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;49. What is the diff between Volume &amp;amp; Load?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;50. What is diff between Volume &amp;amp; Stress?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;51. What is the diff between Stress &amp;amp; Load Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;52. What is the Diff between Two Tier &amp;amp; Three tier Architecture?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;53. What is the diff between Client Server &amp;amp; Web Based Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;54. What is the diff between Integration &amp;amp; System Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;55. What is the Diff between Code Walkthrough &amp;amp; Code Review?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;56. What is the diff between walkthrough and inspection?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;57. What is the Diff between SIT &amp;amp; IST?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;58. What is the Diff between static and dynamic?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;59. What is the diff between alpha testing and beta testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;60. What are the Minimum requirements to start testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;61. What is Smoke Testing &amp;amp; when it will be done?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;62. What is Adhoc Testing? When it can be done?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;63. What is cookie testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;64. What is security testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;65. What is database testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;66. What is the relation ship between Quality &amp;amp; Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;67. How do you determine, what to be tested?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;68. How do you go about testing a project?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;69. What is the Initial Stage of testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;70. What is Web Based Application Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;71. What is Client Server Application Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;72. What is Two Tier &amp;amp; Three tier Architecture?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;73. What is the use of Functional Specification?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;74. Why do we prepare test condition, test cases, test script (Before Starting Testing)?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;75. Is it not waste of time in preparing the test condition, test case &amp;amp; Test Script?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;76. How do you go about testing of Web Application?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;77. How do you go about testing of Client Server Application?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;78. What is meant by Static Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;79. Can the static testing be done for both Web &amp;amp; Client Server Application?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;80. In the Static Testing, what all can be tested?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;81. Can test condition, test case &amp;amp; test script help you in performing the static testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;82. What is meant by dynamic testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;83. Is the dynamic testing a functional testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;84. Is the Static testing a functional testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;85. What are the functional testing you perform?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;86. What is meant by Alpha Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;87. What kind of Document you need for going for an Functional testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;88. What is meant by Beta Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;89. At what stage the unit testing has to be done?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;90 Who can perform the Unit Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;91. When will the Verification &amp;amp; Validation be done?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;92. What is meant by Code Walkthrough?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;93. What is meant Code Review?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;94. What is the testing that a tester performs at the end of Unit Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;95. What are the things, you prefer &amp;amp; Prepare before starting Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;96. What is Integration Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;97. What is Incremental Integration Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;98. What is meant by System Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;99. What is meant by SIT?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;100 .When do you go for Integration Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;101 Can the System testing be done at any stage?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;102. What are stubs &amp;amp; drivers?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;103. What is the Concept of Up-Down &amp;amp; Down-Up in Testing in integration testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;104. What is the final Stage of Integration Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;105. Where in the SDLC, the Testing Starts?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;106. What is the Outcome of Integration Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;107. What is meant by GUI Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;108. What is meant by Back-End Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;109. What are the features, you take care in Prototype testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;110. What is Mutation testing &amp;amp; when can it be done?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;111. What is Compatibility Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;112. What is Usability Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;113 What is the Importance of testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;114. What is meant by regression Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;115. When we prefer Regression &amp;amp; what are the stages where we go for Regression Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;116. What is performance testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;117. What is the Performance testing; those can be done Manually &amp;amp; Automatically?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;118 What is Volume, Stress &amp;amp; Load Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;119. What is a Bug?120. What is a Defect?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;121. What is the defect Life Cycle?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;122. What is the Priority in fixing the Bugs?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;123. Explain the Severity you rate for the bugs found?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;124. Diff between UAT &amp;amp; IST?125. What is meant by UAT?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;126. What all are the requirements needed for UAT?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;127. What are the docs required for Performance Testing?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;128. What is risk analysis?129. How to do risk management?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;130. What are test closure documents?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;131. What is traceability matrix?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;132. What ways you followed for defect management?&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-1294563656802160709?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/1294563656802160709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=1294563656802160709&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1294563656802160709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1294563656802160709'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/04/development-and-testing-are-two-sides.html' title='Developer and Testing/Tester'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-7276142766217940340</id><published>2008-03-25T11:52:00.000+05:30</published><updated>2008-04-17T15:27:03.856+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='static'/><category scheme='http://www.blogger.com/atom/ns#' term='Singletone'/><title type='text'>SINGLETON vs STATIC</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;The Singleton pattern is useful when the object itself needs to keep some state.If no such thing is needed, a static method can do the job as well. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;br /&gt;A purely static class can save state as well. Static variables can be used to store state.A static block can be used to initialize state. Static methods can be used to access or modify the state.AFAIK, the only think a purely static class cannot do is to force parameterization of the initialization of the class, since any method call can trigger the static initialization block. Such forced parameterization can be provided in the singleton by only providingan .instance() method with the desired arguments in the parameter list.&lt;br /&gt;&lt;br /&gt;the Singleton pattern in that a Singleton class is supposed to have one (and only one) *instance*, while a "static class" is never instanciated (or, at least, there is no point in instanciating it).&lt;br /&gt;a class full of static methods can't be polymorphic, but a singleton can.&lt;br /&gt;&lt;br /&gt;The Singleton pattern has several advantages over the "static class" pattern. First, a singleton can extend classes and implement interfaces, while a static class cannot (well, it can extend classes, but it does not inherit their instance members). A singleton can be initialized lazily or asynchronously whilea static class is generally initialized when it is first loaded. A sinlgeton class can be extended and it's methods overidden. Perhaps the most important advantage, though, is that singletons can be handled polymorphically without forcing their users to assume that there is only one instance. For instance, assume you have a Configuration class that holds some global configs. Methods that use this configuration information may be defined as:&lt;br /&gt;&lt;br /&gt;public void doSomething(Configuration config) {...}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-7276142766217940340?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/7276142766217940340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=7276142766217940340&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/7276142766217940340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/7276142766217940340'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/03/singleton-vs-static.html' title='SINGLETON vs STATIC'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-2459708622681473808</id><published>2008-03-23T11:22:00.000+05:30</published><updated>2008-04-17T15:28:07.768+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='jakarta struts'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache struts'/><title type='text'>What is the difference between Apache struts and jakarta struts?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Both apache struts and jakarta struts are one and the same.Struts was originally created by Craig McClanahan and donated to the Apache Foundation in May, 2000.However after gaining prominence in the J2EE community through its evolution as a Jakarta Project, in early 2004 it become an official Apache Project.Thus there is no difference between them.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-2459708622681473808?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/2459708622681473808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=2459708622681473808&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/2459708622681473808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/2459708622681473808'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/03/what-is-difference-between-apache.html' title='What is the difference between Apache struts and jakarta struts?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-3895903232882689125</id><published>2008-03-22T11:19:00.000+05:30</published><updated>2008-04-17T15:28:44.978+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Exception'/><category scheme='http://www.blogger.com/atom/ns#' term='exceptions'/><title type='text'>Why is it not advisable to catch type “Exception”?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Exception handling in Java is polymorphic in nature. For example if you catch type Exception in your code then it can catch or throw its descendent types like IOException as well. So if you catch the type Exception before the type IOException then the type Exception block will catch the entire exceptions and type IOException block is never reached. In order to catch the type IOException and handle it differently to type Exception, IOException should be caught first (remember that you can’t have a bigger basket above a smaller basket). The diagram below is an example for illustration only. In practice it is not recommended to catch type “Exception”. We should only catch specific subtypes of the Exception class. Having a bigger basket (i.e. Exception) will hide or cause problems. Since the RunTimeException is a subtype of Exception, catching the type Exception will catch all the run time exceptions (like NullpointerException, ArrayIndexOut-OfBounds-Exception) as well.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-3895903232882689125?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/3895903232882689125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=3895903232882689125&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/3895903232882689125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/3895903232882689125'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/03/why-is-it-not-advisable-to-catch-type.html' title='Why is it not advisable to catch type “Exception”?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-8291104439488399980</id><published>2008-03-14T12:33:00.000+05:30</published><updated>2008-04-17T15:29:07.473+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ioc'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><title type='text'>Spring IOC and its benefits</title><content type='html'>&lt;a href="http://www.developersbook.com/spring/interview-questions/spring-interview-questions-faqs.php"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;What are the different types of IOC (dependency injection) ? &lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;There are three types of dependency injection:&lt;br /&gt;Constructor Injection (e.g. Pico container, Spring etc): Dependencies are provided as constructor parameters.&lt;br /&gt;Setter Injection (e.g. Spring): Dependencies are assigned through JavaBeans properties (ex: setter methods).&lt;br /&gt;Interface Injection (e.g. Avalon): Injection is done through an interface.&lt;br /&gt;Note: Spring supports only Constructor and Setter Injection&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://www.developersbook.com/spring/interview-questions/spring-interview-questions-faqs.php"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;What are the benefits of IOC (Dependency Injection)?&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Benefits of IOC (Dependency Injection) are as follows:&lt;br /&gt;Minimizes the amount of code in your &lt;/span&gt;&lt;a href="http://www.developersbook.com/segap/spring/spring_interview_questions_faqs.htm" target="_top"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;application&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;. With IOC containers you do not care about how services are created and how you get references to the ones you need. You can also easily add additional services by adding a new constructor or a setter method with little or no extra configuration.&lt;br /&gt;Make your application more testable by not requiring any singletons or JNDI lookup mechanisms in your unit test cases. IOC containers make unit testing and switching implementations very easy by manually allowing you to inject your own objects into the object under test.&lt;br /&gt;Loose coupling is promoted with minimal effort and least intrusive mechanism. The factory &lt;/span&gt;&lt;a href="http://www.developersbook.com/segap/spring/spring_interview_questions_faqs.htm" target="_top"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;design pattern&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;font-size:85%;"&gt; is more intrusive because components or services need to be requested explicitly whereas in IOC the dependency is injected into requesting piece of code. Also some containers promote the design to interfaces not to implementations design concept by encouraging managed objects to implement a well-defined service interface of your own.&lt;br /&gt;IOC containers support eager instantiation and lazy loading of services. Containers also provide support for instantiation of managed objects, cyclical dependencies, life cycles management, and dependency resolution between managed objects etc.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-8291104439488399980?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/8291104439488399980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=8291104439488399980&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/8291104439488399980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/8291104439488399980'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/03/spring-ioc-and-its-benefits.html' title='Spring IOC and its benefits'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-2118372634021192247</id><published>2008-03-13T11:48:00.000+05:30</published><updated>2008-04-17T15:29:29.895+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java 1.5'/><title type='text'>What's New in Java 1.5?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Sun has recently "upgraded" the Java language to include many new features such as Generics, Type-Safe Enumerations, Automatic Boxing and Unboxing, Annotations, For/In loops, and Static Imports. How will this affect the way you teach APCS? Immediately, it will have a minimal effect, but as you need to expand the scope of your APCS course to encompass the new features it might be difficult to find time. I'm going to discuss the current effect 1.5 has on APCS as well as possible future implications it may have on your course. for more detail read..&lt;a href="http://www.cs.indiana.edu/classes/jett/sstamm/"&gt;http://www.cs.indiana.edu/classes/jett/sstamm/&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-2118372634021192247?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/2118372634021192247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=2118372634021192247&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/2118372634021192247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/2118372634021192247'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/03/whats-new-in-java-15.html' title='What&apos;s New in Java 1.5?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-6223216859938168399</id><published>2008-02-21T11:24:00.000+05:30</published><updated>2008-02-21T11:25:59.938+05:30</updated><title type='text'>transient,persistent or detached</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;After going through the life cycle, the question that comes into mind is that, how does hibernate know whether an object is transient,persistent or detached ?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;A range of options are available for that. Hibernate will assume that an instance is unsaved&lt;br /&gt;Transient instance if :&lt;br /&gt; a) The identifier property is null&lt;br /&gt; b) The version property (if exists) is null.&lt;br /&gt; c) You supply an unsaved-value attribute in &lt;class&gt; and the value of the identifier property&lt;br /&gt;      matches.&lt;br /&gt; d) You supply  Hibernate Interceptor and return Boolean.TRUE from Interceptor.isUnsaved()&lt;br /&gt;      after checking the instance in your code.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-6223216859938168399?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/6223216859938168399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=6223216859938168399&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/6223216859938168399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/6223216859938168399'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/02/transientpersistent-or-detached.html' title='transient,persistent or detached'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-197503315969161781</id><published>2008-01-11T12:45:00.000+05:30</published><updated>2008-04-17T15:32:06.730+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><title type='text'>What is Application Context in Spring?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;A bean factory is fine to simple applications, but to take advantage of the full power of the Spring framework, you may want to move up to Springs more advanced container, the application context. On the surface, an application context is same as a bean factory.Both load bean definitions, wire beans together, and dispense beans upon request. But it also provides: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;br /&gt;A means for resolving text messages, including support for internationalization.&lt;br /&gt;A generic way to load file resources.&lt;br /&gt;Events to beans that are registered as listeners. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-197503315969161781?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/197503315969161781/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=197503315969161781&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/197503315969161781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/197503315969161781'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/01/what-is-application-context-in-spring.html' title='What is Application Context in Spring?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-5789912531100324907</id><published>2008-01-02T12:24:00.000+05:30</published><updated>2008-04-17T15:31:39.653+05:30</updated><title type='text'>What are the types of Dependency Injection Spring supports?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;strong&gt;Setter Injection:&lt;/strong&gt;&lt;br /&gt;Setter-based DI is realized by calling setter methods on your beans after invoking a no-argument constructor or no-argument static factory method to instantiate your bean. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;strong&gt;Constructor Injection:&lt;/strong&gt;&lt;br /&gt;Constructor-based DI is realized by invoking a constructor with a number of arguments, each representing a collaborator.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-5789912531100324907?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/5789912531100324907/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=5789912531100324907&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/5789912531100324907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/5789912531100324907'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/01/what-are-types-of-dependency-injection.html' title='What are the types of Dependency Injection Spring supports?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-1374946286227198766</id><published>2007-12-02T12:54:00.000+05:30</published><updated>2008-04-17T15:33:40.218+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSF'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><title type='text'>What is Significance of JSF- Spring integration ?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Spring - JSF integration is useful when an event handler wishes to explicitly invoke the bean factory to create beans on demand, such as a bean that encapsulates the business logic to be performed when a submit button is pressed. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-1374946286227198766?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/1374946286227198766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=1374946286227198766&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1374946286227198766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1374946286227198766'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2008/12/what-is-significance-of-jsf-spring.html' title='What is Significance of JSF- Spring integration ?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-7251579905808835610</id><published>2007-11-27T12:13:00.000+05:30</published><updated>2007-11-27T12:24:37.724+05:30</updated><title type='text'>What Is Spring?</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:arial;"&gt;In the world of technology so may frame-works are coming and it’s a big question in front of us that which one is better.To solve this query I tried explaining frame-work in short. So, let’s start with Spring&lt;/span&gt;  frame-work&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Spring is an open-source framework, and to Put simply, Spring is a&lt;br /&gt;lightweight inversion of control and aspect-oriented container&lt;br /&gt;framework.&lt;br /&gt;Okay, that’s not so simple a description. But it does summarize&lt;br /&gt;what Spring does. To make more sense of Spring, let’s break this description down:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;■ &lt;strong&gt;Lightweight&lt;/strong&gt;—Spring is lightweight in terms of both size and overhead.&lt;br /&gt;The entire Spring framework can be distributed in a single JAR file that&lt;br /&gt;weighs in at just over 1 MB. And the processing overhead required by&lt;br /&gt;Spring is negligible. What’s more, Spring is nonintrusive: objects in a&lt;br /&gt;Spring-enabled application typically have no dependencies on Springspecific&lt;br /&gt;classes.&lt;br /&gt;&lt;br /&gt;■ &lt;strong&gt;Inversion of control&lt;/strong&gt;—Spring promotes loose coupling through a technique&lt;br /&gt;known as inversion of control (IoC). When IoC is applied, objects are passively&lt;br /&gt;given their dependencies instead of creating or looking for dependent&lt;br /&gt;objects for themselves. You can think of IoC as JNDI in reverse—&lt;br /&gt;instead of an object looking up dependencies from a container, the container&lt;br /&gt;gives the dependencies to the object at instantiation without waiting&lt;br /&gt;to be asked.&lt;br /&gt;&lt;br /&gt;■ &lt;strong&gt;Aspect-oriented&lt;/strong&gt;—Spring comes with rich support for aspect-oriented programming&lt;br /&gt;that enables cohesive development by separating application&lt;br /&gt;business logic from system services (such as auditing and transaction management).&lt;br /&gt;Application objects do what they’re supposed to do—perform&lt;br /&gt;business logic—and nothing more. They are not responsible for (or even&lt;br /&gt;aware of) other system concerns, such as logging or transactional support.&lt;br /&gt;&lt;br /&gt;■ &lt;strong&gt;Container&lt;/strong&gt;—Spring is a container in the sense that it contains and manages&lt;br /&gt;the life cycle and configuration of application objects. You can configure&lt;br /&gt;how your each of your beans should be created—either create one single&lt;br /&gt;instance of your bean or produce a new instance every time one is needed&lt;br /&gt;based on a configurable prototype—and how they should be associated&lt;br /&gt;with each other. Spring should not, however, be confused with traditionally&lt;br /&gt;heavyweight EJB containers, which are often large and cumbersome&lt;br /&gt;to work with.&lt;br /&gt;&lt;br /&gt;■ &lt;strong&gt;Framework&lt;/strong&gt;—Spring makes it possible to configure and compose complex&lt;br /&gt;applications from simpler components. In Spring, application objects are&lt;br /&gt;composed declaratively, typically in an XML file. Spring also provides&lt;br /&gt;much infrastructure functionality (transaction management, persistence&lt;br /&gt;framework integration, etc.), leaving the development of application logic&lt;br /&gt;to you.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;All of these attributes of Spring enable you to write code that is cleaner, more&lt;br /&gt;manageable, and easier to test. They also set the stage for a variety of subframeworks&lt;br /&gt;within the greater Spring framework.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-7251579905808835610?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/7251579905808835610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=7251579905808835610&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/7251579905808835610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/7251579905808835610'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/11/what-is-spring.html' title='What Is Spring?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-1417005677732664709</id><published>2007-11-20T20:53:00.000+05:30</published><updated>2007-12-06T20:55:48.282+05:30</updated><title type='text'>Features of Spring Framework:</title><content type='html'>&lt;span style="font-size:78%;"&gt;1 An Inversion of Control (IoC) container (Spring Core package) that supports Dependency Injection, a powerful technique pioneered by Spring for configuring POJO-based applications. Spring is the most popular and powerful of a number of frameworks in the IoC space.&lt;br /&gt;&lt;br /&gt;2 A pure Java AOP (Aspect-Oriented Programming) framework (the Spring AOP package) that enables crosscutting functionality to be applied to POJOs, which enables sophisticated support for declarative transaction management in a range of environments.&lt;br /&gt;&lt;br /&gt;3 A flexible web MVC framework. Spring also integrates out-of-the-box with popular web tier solutions such as Struts, WebWork, Tapestry, or JSF.&lt;br /&gt;&lt;br /&gt;4 A common approach to persistence (the Spring DAO package).&lt;br /&gt;&lt;br /&gt;5 Support for remoting, working with EJBs, JMS, and other important enterprise functionality (Spring Context package).&lt;br /&gt;&lt;br /&gt;6 Integration with numerous third-party products, including the Quartz scheduler and Velocity template engine.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-1417005677732664709?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/1417005677732664709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=1417005677732664709&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1417005677732664709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1417005677732664709'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/11/features-of-spring-framework.html' title='Features of Spring Framework:'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-3769347617418094074</id><published>2007-11-18T20:51:00.000+05:30</published><updated>2007-12-06T20:56:46.633+05:30</updated><title type='text'>Why Spring?</title><content type='html'>&lt;span style="font-size:78%;"&gt;&lt;span style="font-family:arial;"&gt;1 The "Struts" framework is no doubt a good framework to enhance the ability of the web tier, but the biggest drawback is the fact that it caters only to the web tier and leaves most of the Enterprise tier or middle tier to the fancy of the application architects. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;2 The Application architects need to provide an additional framework to deal with the enterprise tier and make sure that the new framework integrates well with the Struts framework. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;3 Spring tries to alleviate this problem by providing a comprehensive framework, which includes an MVC framework, an AOP integration framework, a JDBC integration framework, and an EJB integration framework. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;4 It also provides integration modules for major O/R mapping tools like Hibernate and JDO. Spring provides all these in a modular fashion without imposing any layer on to the user. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;5 Spring is not a take-it-or- leave-it kind of framework. It tries to seamlessly blend into the existing framework users have without hindrances. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;6 Spring also provides transaction management support using Java classes, email support packages using framework classes, web services support through proxies and many more features like the above. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;7 As mentioned earlier all these packages are optional and spring does not make any of them mandatory. Spring can seamlessly integrate with existing applications and provide specific functionality that you intend to provide with minimal demands for customization. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;8 A user can continue to use Struts for the web tier and top link O/R for the database and meanwhile hook spring to provide e-mail services and web services support. Spring is based on the Inversion of Control/Dependency Injection pattern that has been making rounds in message boards all over the Internet. &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-3769347617418094074?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/3769347617418094074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=3769347617418094074&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/3769347617418094074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/3769347617418094074'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/11/why-spring.html' title='Why Spring?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-5587421248420288461</id><published>2007-11-17T20:49:00.000+05:30</published><updated>2007-12-06T20:57:16.653+05:30</updated><title type='text'>Architectural benefits of Spring</title><content type='html'>&lt;span style="font-size:78%;"&gt;&lt;span style="font-family:arial;"&gt;Before we get down to specifics, let's look at some of the benefits Spring can bring to a project: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;1 Spring can effectively organize your middle tier objects, whether or not you choose to use EJB. Spring takes care of plumbing that would be left up to you if you use only Struts or other frameworks geared to particular J2EE APIs. And while it is perhaps most valuable in the middle tier, Spring's configuration management services can be used in any architectural layer, in whatever runtime environment. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;2 Spring can eliminate the proliferation of Singletons seen on many projects. In my experience, this is a major problem, reducing testability and object orientation. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;3 Spring can eliminate the need to use a variety of custom properties file formats, by handling configuration in a consistent way throughout applications and projects. Ever wondered what magic property keys or system properties a particular class looks for, and had to read the Javadoc or even source code? With Spring you simply look at the class's JavaBean properties or constructor arguments. The use of Inversion of Control and Dependency Injection (discussed below) helps achieve this simplification. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;4 Spring can facilitate good programming practice by reducing the cost of programming to interfaces, rather than classes, almost to zero. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;5 Spring is designed so that applications built with it depend on as few of its APIs as possible. Most business objects in Spring applications have no dependency on Spring. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;6 Applications built using Spring are very easy to unit test. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;7 Spring can make the use of EJB an implementation choice, rather than the determinant of application architecture. You can choose to implement business interfaces as POJOs or local EJBs without affecting calling code. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;8 Spring helps you solve many problems without using EJB. Spring can provide an alternative to EJB that's appropriate for many applications. For example, Spring can use AOP to deliver declarative transaction management without using an EJB container; even without a JTA implementation, if you only need to work with a single database. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;9 Spring provides a consistent framework for data access, whether using JDBC or an O/R mapping product such as TopLink, Hibernate or a JDO implementation. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;10 Spring provides a consistent, simple programming model in many areas, making it an ideal architectural "glue." You can see this consistency in the Spring approach to JDBC, JMS, JavaMail, JNDI and many other important APIs. &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-5587421248420288461?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/5587421248420288461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=5587421248420288461&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/5587421248420288461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/5587421248420288461'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/12/architectural-benefits-of-spring.html' title='Architectural benefits of Spring'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-4043384198257463224</id><published>2007-10-13T19:47:00.000+05:30</published><updated>2007-12-06T21:04:11.126+05:30</updated><title type='text'>What is Dependency Injection Pattern?</title><content type='html'>&lt;span style="font-size:78%;"&gt;&lt;span style="font-family:arial;"&gt;1 The idea behind dependency injection (a.k.a. Inversion of Control, IOC) is that each application component declares what type of service objects it requires (a.k.a its dependency).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;2 The container resolves the dependency between application components, instantiates service objects, and then injects service stubs into the application at runtime via automatic Java Bean setter calls or direct data field value assignment.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;3 Dependency Injection proposes separating the implementation of an object and the construction of objects that depend on them. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;4 The job of coordinating the implementation and construction is left to the Assembler code. The object that needs to be implemented does not need to instantiate the dependent objects and can rely on the assembler to do the job.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;5 The assembler will gather and instantiate, if necessary, all the dependent objects and make them available to the implemented object. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;6 Since the assembler does not depend on the code directly changes can be made to the assembler without any changes to the code. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;7 The assembler gathers the required classes through configuration files so a change in the assembler only needs changes to the configuration file. In this case the Assembler code would be the spring framework. &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-4043384198257463224?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/4043384198257463224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=4043384198257463224&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/4043384198257463224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/4043384198257463224'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/11/what-is-dependency-injection-pattern.html' title='What is Dependency Injection Pattern?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-1776376215133142437</id><published>2007-09-10T19:46:00.000+05:30</published><updated>2007-12-06T21:03:40.969+05:30</updated><title type='text'>Types of Dependency Injections.</title><content type='html'>&lt;span style="font-size:78%;"&gt;&lt;span style="font-family:arial;"&gt;1 Type 1 IOC also called Interface Injection &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;o In Type 1 IOC the injection is done though an interface. The interface will define the injection method and the implementation class has to implement this interface and provide concrete implementation for the injection method. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;2 Type 2 IOC also called Setter Injection &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;o In Type 2 IOC the injection is done via a setter method. Type 2 IOC uses setter methods to get the dependent classes it needs. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;3 Type 3 IOC also called Constructor Injection.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;o In Type 3 IOC implementing class defines a constructor to get all its dependents. The dependent classes are defined in the constructor arguments.&lt;br /&gt;&lt;br /&gt;Spring supports only Constructor based injection and setter based injection.&lt;br /&gt;&lt;br /&gt;Spring recommends setter-based injection over constructor-based injection as multiple constructors can make the bean huge and unmanageable.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-1776376215133142437?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/1776376215133142437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=1776376215133142437&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1776376215133142437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/1776376215133142437'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/11/types-of-dependency-injections.html' title='Types of Dependency Injections.'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-6335502315520150522</id><published>2007-09-08T19:44:00.000+05:30</published><updated>2007-12-06T21:03:11.918+05:30</updated><title type='text'>How does Spring Work?</title><content type='html'>&lt;span style="font-size:78%;"&gt;&lt;span style="font-family:arial;"&gt;The idea is that beans follow the Dependency Injection pattern. Beans have information on the classes dependent on them. Beans define their own attributes within bean descriptors and also define the beans they depend on in the same descriptors.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; The Bean does not need to locate and instantiate these classes using service locators or JNDI calls. The Assembler (Spring Framework in this case) takes care of finding these classes based on the information provided in the descriptor and makes them available to the calling class. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-family:arial;"&gt; The service locator pattern does almost the same job, so why do we need another pattern to do it?&lt;br /&gt;o The class that needs the dependent classes needs to tell the Service Locator as to which classes are required by it and moreover the responsibility of finding these classes and invoking them falls on the calling class. This makes the classes tightly coupled with each other making them difficult to unit test them separately.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; In the case of the Dependency Injection pattern the responsibility is shifted to the Assembler to load these classes. The assembler can make changes to the dependent classes by simply modifying the descriptor file. &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-6335502315520150522?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/6335502315520150522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=6335502315520150522&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/6335502315520150522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/6335502315520150522'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/11/how-does-spring-work.html' title='How does Spring Work?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-3827928366206703043</id><published>2007-08-06T19:42:00.000+05:30</published><updated>2007-12-06T21:02:26.746+05:30</updated><title type='text'>Inversion of control container</title><content type='html'>&lt;span style="font-size:78%;"&gt;&lt;span style="font-family:arial;"&gt;The core of Spring is the org.springframework.beans package, designed for working with JavaBeans. This package typically isn't used directly by users, but underpins much Spring functionality.&lt;br /&gt;The next higher layer of abstraction is the bean factory. A Spring bean factory is a generic factory that enables objects to be retrieved by name, and which can manage relationships between objects.&lt;br /&gt;Bean factories support two modes of object: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;1 Singleton: in this case, there's one shared instance of the object with a particular name, which will be retrieved on lookup. This is the default, and most often used, mode. It's ideal for stateless service objects. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-family:arial;"&gt;2 Prototype or non-singleton: in this case, each retrieval will result in the creation of an independent object. For example, this could be used to allow each caller to have its own distinct object reference.&lt;br /&gt;Because the Spring container manages relationships between objects, it can add value where necessary through services such as transparent pooling for managed POJOs, and support for hot swapping, where the container introduces a level of indirection that allows the target of a reference to be swapped at runtime without affecting callers and without loss of thread safety. One of the beauties of Dependency Injection (discussed shortly) is that all this is possible transparently, with no API involved. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;As org.springframework.beans.factory.BeanFactory is a simple interface, it can be implemented in different ways. The BeanDefinitionReader interface separates the metadata format from BeanFactory implementations themselves, so the generic BeanFactory implementations Spring provides can be used with different types of metadata. You could easily implement your own BeanFactory or BeanDefinitionReader, although few users find a need to. The most commonly used BeanFactory definitions are: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;1 XmlBeanFactory: This parses a simple, intuitive XML structure defining the classes and properties of named objects. We provide a DTD to make authoring easier. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;2 DefaultListableBeanFactory: This provides the ability to parse bean definitions in properties files, and create BeanFactories programmatically. &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-3827928366206703043?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/3827928366206703043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=3827928366206703043&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/3827928366206703043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/3827928366206703043'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/11/inversion-of-control-container.html' title='Inversion of control container'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-4593271533210610945</id><published>2007-07-03T19:38:00.000+05:30</published><updated>2007-12-06T21:01:49.893+05:30</updated><title type='text'>What is Inversion of Control container?</title><content type='html'>&lt;span style="font-size:78%;"&gt;&lt;span style="font-family:arial;"&gt;Spring is an Inversion of Control container.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;o IoC moves the responsibility for making things happen into the framework, and away from application code. Whereas your code calls a traditional class library, an IoC framework calls your code. Lifecycle callbacks in many APIs, such as the setSessionContext () method for session EJBs, demonstrate this approach.&lt;br /&gt;Dependency Injection is a form of IoC that removes explicit dependence on container APIs; ordinary Java methods are used to inject dependencies such as collaborating objects or configuration values into application object instances.&lt;br /&gt;&lt;br /&gt;o In traditional container architectures such as EJB, a component might call the container to say "where's object X, which I need to do my work",&lt;br /&gt;&lt;br /&gt;o With Dependency Injection the container figures out that the component needs an X object, and provides it to it at runtime. The container does this figuring out based on method signatures (usually JavaBean properties or constructors) and, possibly, configuration data such as XML.&lt;br /&gt;The two major flavors of Dependency Injection are Setter Injection (injection via JavaBean setters); and Constructor Injection (injection via constructor arguments). Spring provides sophisticated support for both, and even allows you to mix the two when configuring the one object.&lt;br /&gt;&lt;br /&gt;As well as supporting all forms of Dependency Injection, Spring also provides a range of callback events, and an API for traditional lookup where necessary. However, we recommend a pure Dependency Injection approach in general.&lt;br /&gt;Dependency Injection has several important benefits. For example:&lt;br /&gt;&lt;br /&gt;1 Because components don't need to look up collaborators at runtime, they're much simpler to write and maintain. In Spring's version of IoC, components express their dependency on other components via exposing JavaBean setter methods or through constructor arguments. The EJB equivalent would be a JNDI lookup, which requires the developer to write code that makes environmental assumptions.&lt;br /&gt;&lt;br /&gt;2 For the same reasons, application code is much easier to test. For example, JavaBean properties are simple, core Java and easy to test: simply write a self-contained JUnit test method that creates the object and sets the relevant properties.&lt;br /&gt;&lt;br /&gt;3 A good IoC implementation preserves strong typing. If you need to use a generic factory to look up collaborators, you have to cast the results to the desired type. This isn't a major problem, but it is inelegant. With IoC you express strongly typed dependencies in your code and the framework is responsible for type casts. This means that type mismatches will be raised as errors when the framework configures the application; you don't have to worry about class cast exceptions in your code.&lt;br /&gt;&lt;br /&gt;4 Dependencies are explicit. For example, if an application class tries to load a properties file or connect to a database on instantiation, the environmental assumptions may not be obvious without reading the code (complicating testing and reducing deployment flexibility). With a Dependency Injection approach, dependencies are explicit, and evident in constructor or JavaBean properties.&lt;br /&gt;&lt;br /&gt;5 Most business objects don't depend on IoC container APIs. This makes it easy to use legacy code, and easy to use objects either inside or outside the IoC container. For example, Spring users often configure the Jakarta Commons DBCP DataSource as a Spring bean: there's no need to write any custom code to do this. We say that an IoC container isn't invasive: using it won't invade your code with dependency on its APIs. Almost any POJO can become a component in a Spring bean factory. Existing JavaBeans or objects with multi-argument constructors work particularly well, but Spring also provides unique support for instantiating objects from static factory methods or even methods on other objects managed by the IoC container.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-4593271533210610945?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/4593271533210610945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=4593271533210610945&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/4593271533210610945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/4593271533210610945'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/11/what-is-inversion-of-control-container.html' title='What is Inversion of Control container?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-117043411274695295</id><published>2007-06-06T21:01:00.000+05:30</published><updated>2007-11-27T12:29:45.508+05:30</updated><title type='text'>What is the main difference between shallow cloning and deep cloning of objects?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;The default behaviour of an object’s clone() method automatically yields a shallow copy. So to achieve a deepcopy the classes must be edited or adjusted.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;br /&gt;&lt;strong&gt;Shallow copy&lt;/strong&gt;: If a shallow copy is performed on obj-1 as shown in fig-2 then it is copied but its contained objects&lt;br /&gt;are not. The contained objects Obj-1 and Obj-2 are affected by changes to cloned Obj-2. Java supports shallow&lt;br /&gt;cloning of objects by default when a class implements the java.lang.Cloneable interface.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Deep copy&lt;/strong&gt;: If a deep copy is performed on obj-1 as shown in fig-3 then not only obj-1 has been copied but the&lt;br /&gt;objects contained within it have been copied as well. Serialization can be used to achieve deep cloning. Deep&lt;br /&gt;cloning through serialization is faster to develop and easier to maintain but carries a performance overhead.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://photos1.blogger.com/x/blogger/7566/1856/320/520433/shallowcloaning.jpg" border="0" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-117043411274695295?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/117043411274695295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=117043411274695295&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/117043411274695295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/117043411274695295'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/02/what-is-main-difference-between.html' title='What is the main difference between shallow cloning and deep cloning of objects?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-319769151372014520</id><published>2007-05-19T12:48:00.000+05:30</published><updated>2007-05-19T12:50:33.083+05:30</updated><title type='text'>Web Servers vs. App Servers</title><content type='html'>These are two quite different pieces of software.There are few Web servers in common use: Apache takes the lion's share, while Microsoft Internet Information Server (IIS) and iPlanet Web Server are among the others. Application servers jumped into the limelight only about two years ago and there is a proliferation of products from companies such as BEA, iPlanet, Oracle, SilverStream, HP (Bluestone), and IBM.&lt;br /&gt;&lt;br /&gt;Speaking of functionality, in differentiating the two servers we have to say "in general" because there are customized versions of both Web and application servers that have crossover functionality. The Web server, in general, sends Web pages to browsers as its primary function. Most Web servers also process input from users, format data, provide security, and perform other tasks. The majority of a Web server's work is to execute HTML or scripting such as Perl, JavaScript, or VBScript.&lt;br /&gt;&lt;br /&gt;In general, an application server prepares material for the Web server -- for example, gathering data from databases, applying business rules, processing security clearances, or storing the state of a user's session. In some respects the term application server is misleading since the functionality isn't limited to applications. Its role is more as an aggregator and manager for data and processes used by anything running on a Web server.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-319769151372014520?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/319769151372014520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=319769151372014520&amp;isPopup=true' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/319769151372014520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/319769151372014520'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/05/web-servers-vs-app-servers.html' title='Web Servers vs. App Servers'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-5767279026678069516</id><published>2007-05-19T12:36:00.000+05:30</published><updated>2007-05-19T12:48:12.048+05:30</updated><title type='text'>Where and how can you use a private constructor?</title><content type='html'>Private constructor is used if you do not want other classes to instantiate the object. The instantiation is done by a public static method within the same class.&lt;br /&gt;1. Used in the singleton pattern. (Refer Q45 in Java section).&lt;br /&gt;2. Used in the factory method pattern (Refer Q46 in Java section).&lt;br /&gt;3. Used in utility classes e.g. StringUtils etc.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Why there are some interfaces with no defined methods (i.e. marker interfaces) in Java? &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The interfaces with no defined methods act like markers. They just tell the compiler that the objects of the classes implementing the interfaces with no defined methods need to be treated differently. Example Serializable, Cloneable etc&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The code in a finally clause will never fail to execute, right? &lt;/strong&gt;&lt;br /&gt;Well, hardly ever. But here's an example where the finally code will not execute, regardless of the value of the boolean choice:&lt;br /&gt;&lt;br /&gt;try {&lt;br /&gt;if (choice)&lt;br /&gt;{&lt;br /&gt;while (true) ;&lt;br /&gt;} else&lt;br /&gt;{&lt;br /&gt;System.exit(1);&lt;br /&gt;}&lt;br /&gt;} finally&lt;br /&gt;{code.to.cleanup();&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-5767279026678069516?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/5767279026678069516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=5767279026678069516&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/5767279026678069516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/5767279026678069516'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/05/where-and-how-can-you-use-private.html' title='Where and how can you use a private constructor?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-117043188338938431</id><published>2007-05-05T20:24:00.000+05:30</published><updated>2007-11-27T12:29:12.470+05:30</updated><title type='text'>What are the benefits of the Java collection framework?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Java Collection framework provides flexibility,&lt;br /&gt;performance, and robustness.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;1.Polymorphic algorithms – sorting, shuffling, reversing, binary search etc.&lt;br /&gt;2.Set algebra - such as finding subsets, intersections, and unions between objects.&lt;br /&gt;3.Performance - collections have much better performance compared to the older Vector and Hashtable&lt;br /&gt;classes with the elimination of synchronization overheads.&lt;br /&gt;4.Thread-safety - when synchronization is required, wrapper implementations are provided for temporarily&lt;br /&gt;synchronizing existing collection objects.&lt;br /&gt;5.Immutability - when immutability is required wrapper implementations are provided for making a collection&lt;br /&gt;immutable.&lt;br /&gt;6.Extensibility - interfaces and abstract classes provide an excellent starting point for adding functionality and&lt;br /&gt;features to create specialized object collections.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-117043188338938431?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/117043188338938431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=117043188338938431&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/117043188338938431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/117043188338938431'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/02/what-are-benefits-of-java-collection.html' title='What are the benefits of the Java collection framework?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-116751876168650336</id><published>2007-04-05T03:14:00.000+05:30</published><updated>2007-11-27T12:28:49.716+05:30</updated><title type='text'>What is the difference between Struts 1.0 and Struts</title><content type='html'>The main differences are&lt;br /&gt;1. In Action class Perform() method was replaced by execute() method.&lt;br /&gt;2. DynaActionForms are added.&lt;br /&gt;3. Tiles Concept is introduced.&lt;br /&gt;4. We can write our own Controller by Inheriting RequestProcessor class. i.e., nothing but we can override the process() method of the RequestProcessor class.&lt;br /&gt;Apart from these some updates in web.xml and Struts-Config.xml.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-116751876168650336?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/116751876168650336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=116751876168650336&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/116751876168650336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/116751876168650336'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/12/what-is-difference-between-struts-10.html' title='What is the difference between Struts 1.0 and Struts'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-117043430132820448</id><published>2007-03-03T22:07:00.000+05:30</published><updated>2007-11-27T12:28:18.845+05:30</updated><title type='text'>Where and how can you use a private constructor?</title><content type='html'>&lt;p&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Private constructor is used if you do not want other classes to instantiate the object. The instantiation is done by a&lt;br /&gt;public static method within the same class.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;br /&gt;1.Used in the singleton pattern..&lt;br /&gt;2.Used in the factory method pattern .&lt;br /&gt;3.Used in utility classes e.g. StringUtils etc.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-117043430132820448?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/117043430132820448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=117043430132820448&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/117043430132820448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/117043430132820448'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/02/where-and-how-can-you-use-private.html' title='Where and how can you use a private constructor?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-3598908198684040328</id><published>2007-02-22T06:55:00.000+05:30</published><updated>2007-02-22T06:58:58.396+05:30</updated><title type='text'>Ways to Improve The Performance of your java Program</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Following article has tips on ways to Improve the performance of your java Program&lt;br /&gt;I must say this is good article I ever gone through.Please have a look and please leave your comments for the same.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-3598908198684040328?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/3598908198684040328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=3598908198684040328&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/3598908198684040328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/3598908198684040328'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/02/following-article-has-tips-on-ways-to.html' title='Ways to Improve The Performance of your java Program'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-8787128481848905527</id><published>2007-02-21T06:30:00.000+05:30</published><updated>2007-02-21T06:39:05.871+05:30</updated><title type='text'>Garbage collection and memory management in Java applications</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;As a modern language, Java has an automatic memory management mechanism   called garbage collection, which makes it much easier for you to manage objects    created in the application code. When an object is created by new keyword,    it is placed into the Java heap of the Java Virtual Machine (JVM).    The JVM has a garbage collector, and when this object is no longer needed by any code,   the garbage collector removes it from the Java heap. Listing 1 is an example of a method   defined in a Java class &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;                  public void aMethod() {   &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;                      String example = new String("My Example"); // String is a Java class  &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;                                                 } &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;In above example, a new String object is allocated in the Java heap.     In Java , you don't need to write code to explicitly     delete the object from the heap after you're done with it. When the method     is called and returned, the only reference to this String object, s,    is set to null and removed from the thread stack. The JVM garbage collector detects that     the number of references to this String object is 0,     indicating no code may access or use the object any longer.     When the garbage collector has an opportunity to run,     it treats this String object as garbage, removes it from the Java heap, and frees the memory allocated for it.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;strong&gt;Java memory leaks&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;If a program holds a reference to a heap chunk that is not used during the rest of its life,   it is considered a memory leak because the memory could have been freed and reused.   GC won't reclaim it due to the reference being held by the program.    A Java program could run out of memory due to such leaks. Java memory leaks are mostly    a result of non-obvious programming errors.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;strong&gt;Finding Reason for memory leaks&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Usually, solving a memory leak problem is a two-step process:identifying which Java classes caused the memory leak, and then determining where in the application leak occurred. The goal of the first step is easy to achieve with the tools&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;The second step is more challenging, because tracking the relevant information in a profiling tool slows down performance. The profiler discussed in this article doesnot provide the detailed information needed to track down the source of memory leaks inthe code, partly because of performance considerations. Some tools may be configured to collect such information with significant adverse impact on performance, such as Hprof and other third party tools.Given the scale of J2EE applications and the J2EE environment associated with them, performance concerns often prevent developers from tracking sufficient information using those tools.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;To simplify the discussion of resolving the difficulty in the second step in this article, memory leaks are divided into two types.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;1. Rarely used object leak &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;2. Frequently used object leak &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;strong&gt;Preventing memory leaks&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;You can prevent memory leaks by watching for some common problems. Collection classes, &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;such as hashtables and vectors, are common places to find the cause of a memory leak.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;This is particularly true if the class has been declared static and exists for the life of the application.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Another common problem occurs when you registera class as an event listener without bothering to unregister when the class is no longer needed. Also, many times member variables of a class that point to other classes simply needto be set to null at the appropriate time.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-8787128481848905527?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/8787128481848905527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=8787128481848905527&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/8787128481848905527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/8787128481848905527'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/02/garbage-collection-and-memory.html' title='Garbage collection and memory management in Java applications'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-117043480418948186</id><published>2007-02-17T22:10:00.000+05:30</published><updated>2007-02-17T20:48:24.856+05:30</updated><title type='text'>How does Java allocate stack and heap memory? Explain re-entrant, recursive and idempotent</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Each time an object is created in Java it goes into the area of memory known as heap. The primitive variables like&lt;br /&gt;int and double are allocated in the stack, if they are local method variables and in the heap if they are member&lt;br /&gt;variables (i.e. fields of a class). In Java methods local variables are pushed into stack when a method is invoked&lt;br /&gt;and stack pointer is decremented when a method call is completed. In a multi-threaded application each thread&lt;br /&gt;will have its own stack but will share the same heap. This is why care should be taken in your code to avoid any&lt;br /&gt;concurrent access issues in the heap space. The stack is threadsafe (each thread will have its own stack) but the&lt;br /&gt;heap is not threadsafe unless guarded with synchronisation through your code.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;br /&gt;A method in stack is reentrant allowing multiple concurrent invocations that do not interfere with each other. A&lt;br /&gt;function is recursive if it calls itself. Given enough stack space, recursive method calls are perfectly valid in Java&lt;br /&gt;though it is tough to debug. Recursive functions are useful in removing iterations from many sorts of algorithms. All&lt;br /&gt;recursive functions are re-entrant but not all re-entrant functions are recursive. Idempotent methods are methods,&lt;br /&gt;which are written in such a way that repeated calls to the same method with the same arguments yield same&lt;br /&gt;results. For example clustered EJBs, which are written with idempotent methods, can automatically recover from a&lt;br /&gt;server failure as long as it can reach another server. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://photos1.blogger.com/blogger/7566/1856/320/javaheap.jpg" border="0" /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-117043480418948186?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/117043480418948186/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=117043480418948186&amp;isPopup=true' title='17 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/117043480418948186'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/117043480418948186'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/02/how-does-java-allocate-stack-and-heap.html' title='How does Java allocate stack and heap memory? Explain re-entrant, recursive and idempotent'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>17</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-117043384246971094</id><published>2007-02-11T21:57:00.000+05:30</published><updated>2007-02-11T21:00:35.333+05:30</updated><title type='text'>What is serialization? How would you exclude a field of a class from serialization?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Serialization is a process of reading or writing an object. It is a process of saving an object’s state to a sequence of&lt;br /&gt;bytes, as well as a process of rebuilding those bytes back into a live object at some future time. An object is&lt;br /&gt;marked serializable by implementing the java.io.Serializable interface, which is only a marker interface -- it simply&lt;br /&gt;allows the serialization mechanism to verify that the class can be persisted, typically to a file.&lt;/span&gt;&lt;br /&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 363px; CURSOR: hand; HEIGHT: 110px; TEXT-ALIGN: center" height="133" alt="" src="http://photos1.blogger.com/x/blogger/7566/1856/320/720591/serilization.jpg" width="378" border="0" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-117043384246971094?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/117043384246971094/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=117043384246971094&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/117043384246971094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/117043384246971094'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/02/what-is-serialization-how-would-you.html' title='What is serialization? How would you exclude a field of a class from serialization?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-117043322849408921</id><published>2007-02-02T21:30:00.000+05:30</published><updated>2007-02-02T21:55:08.876+05:30</updated><title type='text'>What are some of the best practices relating to Java collection?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Use ArrayLists, HashMap etc as opposed to Vector, Hashtable etc, where possible to avoid any&lt;br /&gt;synchronization overhead. Even better is to use just arrays where possible. If multiple threads concurrently&lt;br /&gt;access a collection and at least one of the threads either adds or deletes an entry into the collection,&lt;br /&gt;then the collection must be externally synchronized. This is achieved by:&lt;br /&gt;&lt;br /&gt;List myList = Collections.synchronizedList (myList);&lt;br /&gt;&lt;br /&gt;Map myMap = Collections.synchronizedMap (myMap);&lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Set the initial capacity of a collection appropriately (e.g. ArrayList, HashMap etc). This is because collection&lt;br /&gt;classes like ArrayList, HashMap etc must grow periodically to accommodate new elements. But if you have a very large array, and you know the size in advance then you can speed things up by setting the initial size&lt;br /&gt;appropriately.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;br /&gt;HashMaps/Hashtables need to be created with sufficiently large capacity to minimise&lt;br /&gt;rehashing (which happens every time the table grows). HashMap has two parameters initial capacity and&lt;br /&gt;load factor that affect its performance and space requirements. Higher load factor values (default load factor&lt;br /&gt;of 0.75 provides a good trade off between performance and space) will reduce the space cost but will&lt;br /&gt;increase the lookup cost of myMap.get(…) and myMap.put(…) methods. When the number of entries in the&lt;br /&gt;HashMap exceeds the current capacity * loadfactor then the capacity of the HasMap is roughly doubled by&lt;br /&gt;calling the rehash function. It is also very important not to set the initial capacity too high or load factor too&lt;br /&gt;low if iteration performance or reduction in space is important.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;strong&gt;Avoid where possible&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;The code below is hard to maintain and understand by&lt;br /&gt;others. Also gets more complicated as the requirements&lt;br /&gt;grow in the future because we are throwing different&lt;br /&gt;types of objects like Integer, String etc into a list just&lt;br /&gt;based on the indices and it is easy to make mistakes&lt;br /&gt;while casting the objects back during retrieval.&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;p&gt;List myOrder = new ArrayList()&lt;br /&gt;ResultSet rs = …&lt;br /&gt;While (rs.hasNext()) {&lt;br /&gt;List lineItem = new ArrayList();&lt;br /&gt;lineItem.add (new Integer(rs.getInt(“itemId”)));&lt;br /&gt;lineItem.add (rs.getString(“description”));&lt;br /&gt;….&lt;br /&gt;myOrder.add( lineItem);&lt;br /&gt;}&lt;br /&gt;return myOrder;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Example 2:&lt;br /&gt;&lt;/strong&gt;List myOrder = new ArrayList(10);&lt;br /&gt;//create an order&lt;br /&gt;OrderVO header = new OrderVO();&lt;br /&gt;header.setOrderId(1001);&lt;br /&gt;…&lt;br /&gt;//add all the line items&lt;br /&gt;LineItemVO line1 = new LineItemVO();&lt;br /&gt;line1.setLineItemId(1);&lt;br /&gt;LineItemVO line2 = new LineItemVO();&lt;br /&gt;Line2.setLineItemId(2);&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Better approach&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;p&gt;&lt;br /&gt;When storing items into a collection define value objects as shown&lt;br /&gt;below: &lt;/p&gt;&lt;p&gt;(VO is an acronym for Value Object).&lt;/p&gt;&lt;p&gt;&lt;br /&gt;public class LineItemVO {&lt;br /&gt;   private int itemId;&lt;br /&gt;   private String productName;&lt;br /&gt;   public int getLineItemId(){return accountId ;}&lt;br /&gt;   public int getAccountName(){return accountName;}&lt;br /&gt;   public void setLineItemId(int accountId ){&lt;br /&gt;   this.accountId = accountId&lt;br /&gt;}&lt;br /&gt;//implement other getter &amp; setter methods&lt;br /&gt;}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Now let’s define our base wrapper class, which represents an order:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;public abstract class Order {&lt;br /&gt;int orderId;&lt;br /&gt;List lineItems = null;&lt;br /&gt;public abstract int countLineItems();&lt;br /&gt;public abstract boolean add(LineItemVO itemToAdd);&lt;br /&gt;public abstract boolean remove(LineItemVO itemToAdd);&lt;br /&gt;public abstract Iterator getIterator();&lt;br /&gt;public int getOrderId(){return this.orderId; }&lt;br /&gt;}&lt;br /&gt;Now a specific implementation of our wrapper class:&lt;br /&gt;public class OverseasOrder extends Order {&lt;br /&gt;public OverseasOrder(int inOrderId) {&lt;br /&gt;this.lineItems = new ArrayList(10);&lt;br /&gt;this.orderId = inOrderId;&lt;br /&gt;}&lt;/p&gt;&lt;p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-117043322849408921?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/117043322849408921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=117043322849408921&amp;isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/117043322849408921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/117043322849408921'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/02/what-are-some-of-best-practices.html' title='What are some of the best practices relating to Java collection?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-116951104228161580</id><published>2007-01-23T05:31:00.000+05:30</published><updated>2007-01-23T05:40:42.283+05:30</updated><title type='text'>How can I customize the seralization process?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Yes 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. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;How does Java handle integer overflows and underflows?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;It uses those low order bytes of the result that can fit into the size of the type allowed by the operation. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Why do threads block on I/O?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Threads block on i/o (that is enters the waiting state) so that other threads may execute while the i/o Operation is performed.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-116951104228161580?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/116951104228161580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=116951104228161580&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/116951104228161580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/116951104228161580'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/01/how-can-i-customize-seralization.html' title='How can I customize the seralization process?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-116951043915498843</id><published>2007-01-23T05:25:00.000+05:30</published><updated>2007-01-23T05:30:39.156+05:30</updated><title type='text'>Does importing a package imports the subpackages as well? e.g. Does importing com.MyTest.* also import com.MyTest.UnitTests.*?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;No you will have to import the subpackages explicitly. Importing com.MyTest.* will import classes in the package MyTest only. It will not import any class in any of it's subpackage. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;What is the difference between declaring a variable and defining a variable?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;In declaration we just mention the type of the variable and it's name. We do not initialize it. But defining means declaration + initialization. e.g String s; is just a declaration while String s = new String ("abcd"); Or String s = "abcd"; are both definitions. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Can a level class be private or protected?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;No. A level class can not be private or protected. It can have either "public" or no modifier. If it does not have a modifier it is supposed to have a default access. If a level class is declared as private the compiler will complain that the "modifier private is not allowed here". This means that a level class can not be private. Same is the case with protected. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;What type of parameter passing does Java support?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;In Java the arguments are always passed by value .&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Primitive data types are passed by reference or pass by value?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Primitive data types are passed by value. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Objects are passed by value or by reference?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Java only supports pass by value. With objects, the object reference itself is passed by value and so both the original reference and parameter copy both refer to the same object .&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-116951043915498843?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/116951043915498843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=116951043915498843&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/116951043915498843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/116951043915498843'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2007/01/does-importing-package-imports.html' title='Does importing a package imports the subpackages as well? e.g. Does importing com.MyTest.* also import com.MyTest.UnitTests.*?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-116761526504838602</id><published>2007-01-01T07:03:00.000+05:30</published><updated>2007-01-01T07:05:22.836+05:30</updated><title type='text'>what are the differences between a Web container, Web server, servlet container and an application server?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Typically, a Web server refers to an execution infrastructure that handles HTTP requests and responses; a servlet container refers to a component that handles the lifecycle for servlets; an application server refers to a framework (servlet container, EJB container, JSP engine, MQ container, etc.) for handling Web applications. However, a Web container has a couple of meanings depending on the source. Most refer to a Web container as the part of an application server that manages servlets, JavaServer Pages (JSP) files, and other Web-tier components. Some refer to a Web container as the infrastructure for managing the lifecycle for Web services. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-116761526504838602?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/116761526504838602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=116761526504838602&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/116761526504838602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/116761526504838602'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/12/what-are-differences-between-web.html' title='what are the differences between a Web container, Web server, servlet container and an application server?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-116751905172497190</id><published>2006-12-31T04:18:00.000+05:30</published><updated>2007-01-23T05:24:53.096+05:30</updated><title type='text'>List of Java Versions</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;1995: Version 1.0 of the Java Development Kit (JDK) was released for free by Sun.&lt;br /&gt;8 packages with 212 classes&lt;br /&gt;Netscape 2.0-4.0 included Java 1.0.&lt;br /&gt;Microsoft and other companies licensed Java. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;1997: Version 1.1:&lt;br /&gt;23 packages - 504 classes&lt;br /&gt;Improvements include better event handling, inner classes, improved JVM.&lt;br /&gt;Microsoft developed its own 1.1. compatible Java Virtual Machine for the Internet Explorer.&lt;br /&gt;Many browsers in use are still compatible only with 1.1.&lt;br /&gt;Swing packages of greatly improved graphics became available during this time but not included with the core language.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;br /&gt;1999: Version 1.2, also called the Java 2 Platform&lt;br /&gt;59 packages - 1520 classes&lt;br /&gt;Code and tools distributed as The Software Development Kit (SDK)&lt;br /&gt;Java Foundation Classes (JFC), based on Swing, for improved graphics and user interfaces, now included with the core language.&lt;br /&gt;Collections API included support for various lists, sets, and hash maps.&lt;br /&gt;&lt;br /&gt;2000: Version 1.3:&lt;br /&gt;76 packages - 1842 classes&lt;br /&gt;Performance enhancements including the Hotspot virtual machine.&lt;br /&gt;&lt;br /&gt;2002: Version 1.4:&lt;br /&gt;135 packages - 2991 classes&lt;br /&gt;Improved IO, XML support, etc.&lt;br /&gt;&lt;br /&gt;2004: Version 5.0 (previously numbered 1.5):&lt;br /&gt;165 packages, over 3000 classes&lt;br /&gt;Faster startup and smaller memory footprint&lt;br /&gt;Metadata&lt;br /&gt;Formatted output&lt;br /&gt;Generics&lt;br /&gt;Improved multithreading features &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-116751905172497190?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/116751905172497190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=116751905172497190&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/116751905172497190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/116751905172497190'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/12/list-of-java-versions.html' title='List of Java Versions'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-115501536798454533</id><published>2006-11-27T12:04:00.000+05:30</published><updated>2006-11-27T06:26:24.466+05:30</updated><title type='text'>Web Application Security Cheat Sheet</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;This is a handy reference, but it is good to keep in mind that no book, or article about security is ever exaustive or conclusive. It is a good starting point, but you can't assume that it covers every possible security problem your web application could encounter.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://www.petefreitag.com/item/574.cfm"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;http://www.petefreitag.com/item/574.cfm&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;font-size:85%;"&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-115501536798454533?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/115501536798454533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=115501536798454533&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115501536798454533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115501536798454533'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/11/web-application-security-cheat-sheet.html' title='Web Application Security Cheat Sheet'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-115708933909669729</id><published>2006-09-01T11:11:00.000+05:30</published><updated>2006-09-08T18:58:34.233+05:30</updated><title type='text'>What is the JavaMail API?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;The JavaMail API is a set of abstract APIs that model a mail system. The API provides a platform independent and protocol independent framework to build Java technology based email client applications. The JavaMail API provides facilities for reading and sending email. Service providers implement particular protocols. Several service providers are included with the JavaMail API package; others are available separately. The JavaMail API is implemented as a Java optional package that can be used on JDK 1.4 and later on any operating system. The JavaMail API is also a required part of the &lt;/span&gt;&lt;a href="http://java.sun.com/javaee"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Java Platform, Enterprise Edition (Java EE)&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-115708933909669729?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/115708933909669729/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=115708933909669729&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115708933909669729'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115708933909669729'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/08/what-is-javamail-api.html' title='What is the JavaMail API?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-115471589751514333</id><published>2006-08-14T23:47:00.000+05:30</published><updated>2006-08-14T10:21:02.476+05:30</updated><title type='text'>Implementing High Performance Web Services Using JAX-WS 2.0</title><content type='html'>&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;By &lt;/span&gt;&lt;a href="http://java.sun.com/developer/technicalArticles/WebServices/high_performance/index.html#authors"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Bharath Mundlapudi&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;, August 2006 &lt;/span&gt;&lt;a href="#{link"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;E-mail&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;a href="#{link"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Download&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;a href="http://java.sun.com/developer/technicalArticles/"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Articles Index&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Service-oriented architecture (SOA) allows businesses to enable legacy systems and new software products as a service to a wider audience by way of the Internet. Web services technology is the cornerstone of SOA implementation, which involves complex business transactions between various business entities. XML processing, the core component of web services technology, involves SOAP processing, XML binding, and XML parsing. Understanding various traits of the Web Services Description Language (WSDL) is important for gaining better performance and scalability of web services.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;This article shows how to implement high performance web services using the &lt;/span&gt;&lt;a href="http://java.sun.com/webservices/jaxws/index.jsp"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Java API for XML Web Services (JAX-WS) 2.0&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;font-size:85%;"&gt; and provides feature and performance comparisons with the &lt;/span&gt;&lt;a href="http://java.sun.com/webservices/jaxrpc/index.jsp"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Java API for XML-Based RPC (JAX-RPC) 1.1&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;. The performance data in this article will help you design highly performant web services.&lt;/span&gt;&lt;a name="0"&gt;&lt;/a&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Web Services Stack Overview&lt;br /&gt;&lt;/strong&gt;Sun's initial implementation of web services was called JAX-RPC 1.1 (&lt;/span&gt;&lt;/span&gt;&lt;a href="http://jcp.org/en/jsr/detail?id=101" target="_blank"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;JSR 101&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;). This was a standards-based implementation, but the binding and parsing layers underneath it were proprietary. Additionally, JAX-RPC 1.1 does not completely cover schema specification.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;Sun's newer version of the web services stack, JAX-WS 2.0 (&lt;/span&gt;&lt;a href="http://jcp.org/en/jsr/detail?id=224" target="_blank"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;JSR 224&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;), is completely standards based. Even the binding layer, the Java Architecture for XML Binding (JAXB, &lt;/span&gt;&lt;a href="http://jcp.org/en/jsr/detail?id=222" target="_blank"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;JSR 222&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;), and the parsing layer, the Streaming API for XML (StAX, &lt;/span&gt;&lt;a href="http://jcp.org/en/jsr/detail?id=173" target="_blank"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;JSR 173&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;) are standards based and also support schema specification 100 percent.&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;a href="http://photos1.blogger.com/blogger/7566/1856/1600/JAX-RPC-WS.gif"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-115471589751514333?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://java.sun.com/developer/technicalArticles/WebServices/high_performance/' title='Implementing High Performance Web Services Using JAX-WS 2.0'/><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/115471589751514333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=115471589751514333&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115471589751514333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115471589751514333'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/08/implementing-high-performance-web.html' title='Implementing High Performance Web Services Using JAX-WS 2.0'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-115522666663012921</id><published>2006-08-10T21:45:00.000+05:30</published><updated>2006-08-10T21:47:46.643+05:30</updated><title type='text'>SCJA Mock Exams</title><content type='html'>&lt;a href="http://www.javacertificationexams.com/view.php?book=www.whizlabs.com/scja/scja.html&amp;t=Whizlabs+SCJA+Certification+Exam+Simulator+Trial+Version"&gt;Whizlabs SCJA Certification Exam Simulator Trial Version&lt;/a&gt;&lt;br /&gt;There are 2 free exams available in this trial version. Trial exam has 16 questions with answers and reports. Diagnostic exam has 51 questions without answers and reports.&lt;br /&gt; &lt;br /&gt;&lt;a href="http://www.javacertificationexams.com/view.php?book=www.sun.com/training/catalog/courses/WGS-PREX-10-QUEST.xml&amp;amp;t=Sun+ePractice+Sample+Questions+for+the+Sun+Certified+Associate+for+the+Java+Platform"&gt;Sun ePractice Sample Questions for the Sun Certified Associate for the Java Platform&lt;/a&gt;&lt;br /&gt;There are 10 free sample questions in this exam simulator by Sun Microsystems. Free registration is required to access this exam.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-115522666663012921?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/115522666663012921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=115522666663012921&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115522666663012921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115522666663012921'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/08/scja-mock-exams.html' title='SCJA Mock Exams'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-115471539211473177</id><published>2006-08-04T23:44:00.000+05:30</published><updated>2006-10-16T20:41:23.476+05:30</updated><title type='text'>Download Java API Secifications</title><content type='html'>&lt;a href="http://jcp.org/aboutJava/communityprocess/pfd/jsr224/index.html"&gt;&lt;span style="font-family:arial;"&gt;Java API for XML Web Services (JAX-WS)&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;These are the API specifications for the Java API for XML Web Services. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/webservices/jaxb/reference/api/index.html"&gt;&lt;span style="font-family:arial;"&gt;Java Architecture for XML Binding (JAXB)&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;These are the API specifications for Java Architecture for XML Binding(JAXB). &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/xml/downloads/jaxm.html"&gt;&lt;span style="font-family:arial;"&gt;Java API for XML Messaging (JAXM)&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;These are the API specifications for Java API for XML Messaging (JAXM). &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/xml/downloads/jaxp.html"&gt;&lt;span style="font-family:arial;"&gt;Java API for XML Processing (JAXP)&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;These are the API specifications for Java API for XML Processing (JAXP). &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/xml/downloads/jaxr.html"&gt;&lt;span style="font-family:arial;"&gt;Java API for XML Registries (JAXR)&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;These are the API specifications for Java API for XML Registries (JAXR). &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/webservices/jaxrpc/index.jsp"&gt;&lt;span style="font-family:arial;"&gt;Java API for XML-based RPC (JAX-RPC)&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;These are the API specifications for Java API for XML-based RPC (JAX-RPC). &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://java.sun.com/xml/downloads/saaj.html"&gt;&lt;span style="font-family:arial;"&gt;SOAP with Attachments API for Java (SAAJ)&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;These are the API specifications for SOAP with Attachments API for Java (SAAJ). &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://jcp.org/aboutJava/communityprocess/edr/jsr261/index.html"&gt;&lt;span style="font-family:arial;"&gt;Java API for XML Web Services Addressing (JAX-WSA)&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;These are the API specifications for the Java API for XML Web Services Addressing. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-115471539211473177?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://java.sun.com/webservices/reference/api/index.html#jaxrpc' title='Download Java API Secifications'/><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/115471539211473177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=115471539211473177&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115471539211473177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115471539211473177'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/08/download-java-api-secifications.html' title='Download Java API Secifications'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-115471519943440921</id><published>2006-08-04T23:39:00.000+05:30</published><updated>2006-08-04T23:43:19.446+05:30</updated><title type='text'>Java API for XML Web Services Addressing (JAX-WSA)</title><content type='html'>&lt;div align="justify"&gt;&lt;span style="font-family:arial;"&gt;The Java API for XML Web Services Addressing (JAX-WSA) is a new component in &lt;/span&gt;&lt;a href="https://glassfish.dev.java.net/"&gt;&lt;span style="font-family:arial;"&gt;Project GlassFish&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;. It provides an implementation of the &lt;/span&gt;&lt;a href="http://www.w3.org/2002/ws/addr/"&gt;&lt;span style="font-family:arial;"&gt;WS-Addressing&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt; specification, currently under development at the &lt;/span&gt;&lt;a href="http://www.w3.org/"&gt;&lt;span style="font-family:arial;"&gt;World Wide Web Consortium&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;. JAX-WSA is also a part of &lt;/span&gt;&lt;a href="https://wsit.dev.java.net/"&gt;&lt;span style="font-family:arial;"&gt;Project Tango&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;, Sun Microsystem's Web Services Interoperability Technology.&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The JAX-WSA component is an EA release designed to give Web services developers a first look at this new technology in the Java WSDP. It is experimental in that it relies on a somewhat different line of code for &lt;/span&gt;&lt;a href="http://java.sun.com/webservices/jaxws/index.jsp"&gt;&lt;span style="font-family:arial;"&gt;JAX-WS&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt; than is installed by default with the open-source Java EE 5-compliant application server in Project GlassFish.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;"&gt;Users should note that the JAX-WSA component is not installed by default but requires a custom installation. Please see the installation instructions below for more information.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;a href="http://java.sun.com/webservices/downloads/install-unix.html"&gt;&lt;span style="font-family:arial;"&gt;Installation Instructions for Solaris, Linux, UNIX&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://java.sun.com/webservices/downloads/install-windows.html"&gt;&lt;span style="font-family:arial;"&gt;Installation Instructions for Microsoft Windows&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;"&gt;JAX-WS is now an &lt;/span&gt;&lt;a href="https://jax-wsa.dev.java.net/"&gt;&lt;span style="font-family:arial;"&gt;open-source project at java.net&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;! Check it out, join in, and make your contribution to this vital technology.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-115471519943440921?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://java.sun.com/webservices/jaxwsa/index.jsp' title='Java API for XML Web Services Addressing (JAX-WSA)'/><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/115471519943440921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=115471519943440921&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115471519943440921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115471519943440921'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/08/java-api-for-xml-web-services.html' title='Java API for XML Web Services Addressing (JAX-WSA)'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-115444367185854393</id><published>2006-08-03T20:15:00.000+05:30</published><updated>2006-10-04T00:39:53.226+05:30</updated><title type='text'>why the Java Vector class is called a "Vector"?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;"Vector" is a common name for an array of one dimension.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;I think that it was designed to be accessed in only one direction - from start to end. Of course, you can write code to iterate backwards...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;But the enumeration it goes you don't have a getPrev() method, only a getNext():&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;for (Enumeration e = v.elements() ;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;e.hasMoreElements() {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;System.out.println(e.nextElement()); &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;So a Vector has dimension (number of elements) and direction (in terms of access). &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-115444367185854393?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/115444367185854393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=115444367185854393&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115444367185854393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115444367185854393'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/08/why-java-vector-class-is-called-vector.html' title='why the Java Vector class is called a &quot;Vector&quot;?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-115461480757886811</id><published>2006-08-03T19:42:00.000+05:30</published><updated>2006-08-03T19:50:07.720+05:30</updated><title type='text'>Is it possible to update the version of java automatically like antivirus?</title><content type='html'>&lt;span style="font-family:arial;"&gt;Yes, If u install latest version of java 1.4.2_01 and later. java updated is new features of  SDK/JRE.Its purpose is to provide the latest version of java in flexible way&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-115461480757886811?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/115461480757886811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=115461480757886811&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115461480757886811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115461480757886811'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/08/is-it-possible-to-update-version-of.html' title='Is it possible to update the version of java automatically like antivirus?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-115444167387607763</id><published>2006-08-01T19:39:00.000+05:30</published><updated>2006-10-04T00:43:04.470+05:30</updated><title type='text'>Why String class is immutable?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;JVM internally maintains the "String Pool". To achive the memoryefficiency, JVM will refer the String object from pool. It will notcreate the new String objects. So, whenevr you create a new stringliteral, JVM will check in the pool whether it already exists or not.If already present in the pool, just give the reference to the sameobject or create the new object in the pool. There will be manyreferences point to the same String objects, if someone changes thevalue, it will affect all the references. So, sun decided to make itimmutable.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-115444167387607763?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/115444167387607763/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=115444167387607763&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115444167387607763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115444167387607763'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/08/why-string-class-is-immutable.html' title='Why String class is immutable?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-115372814395256848</id><published>2006-07-24T13:31:00.000+05:30</published><updated>2006-07-24T13:32:23.963+05:30</updated><title type='text'>e-Books</title><content type='html'>&lt;a href="http://worldebookfair.com"&gt;http://worldebookfair.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-115372814395256848?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/115372814395256848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=115372814395256848&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115372814395256848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115372814395256848'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/07/e-books.html' title='e-Books'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-115336889165588904</id><published>2006-07-21T09:43:00.000+05:30</published><updated>2006-12-24T01:22:23.270+05:30</updated><title type='text'>What are some advantages and disadvantages of Java Sockets?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Some advantages of Java Sockets:&lt;br /&gt;Sockets are flexible and sufficient. Efficient socket based programming can be easily implemented for general communications. Sockets cause low network traffic. Unlike HTML forms and CGI scripts that generate and transfer whole web pages for each new request, Java applets can send only necessary updated information.&lt;br /&gt;&lt;br /&gt;Some disadvantages of Java Sockets:&lt;br /&gt;Security restrictions are sometimes overbearing because a Java applet running in a Web browser is only able to establish connections to the machine where it came from, and to nowhere else on the network Despite all of the useful and helpful Java features, Socket based communications allows only to send packets of raw data between applications. Both the client-side and server-side have to provide mechanisms to make the data useful in any way. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-115336889165588904?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/115336889165588904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=115336889165588904&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115336889165588904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115336889165588904'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/07/what-are-some-advantages-and.html' title='What are some advantages and disadvantages of Java Sockets?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-115198610898608547</id><published>2006-07-10T21:36:00.000+05:30</published><updated>2006-07-10T09:52:27.340+05:30</updated><title type='text'>. What happens if a try-catch-finally statement does not have a catch clause to handle an exception that is thrown within the body of the try statemen</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;The exception propagates up to the next higher level try-catch statement (if any) or results in the program's termination. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-115198610898608547?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/115198610898608547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=115198610898608547&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115198610898608547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115198610898608547'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/07/what-happens-if-try-catch-finally.html' title='. What happens if a try-catch-finally statement does not have a catch clause to handle an exception that is thrown within the body of the try statemen'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-115225873631990672</id><published>2006-07-07T13:20:00.000+05:30</published><updated>2006-07-07T13:23:32.266+05:30</updated><title type='text'>Types of Exceptions</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;Java provides support for both checked and unchecked exceptions. The main differences between these exceptions is summarised below.&lt;br /&gt;&lt;br /&gt;Checked Exception&lt;br /&gt;extends Exception&lt;br /&gt;caller must handle exception&lt;br /&gt;e.g. FileNotFoundException&lt;br /&gt;&lt;br /&gt;Unchecked Exception&lt;br /&gt;extends RuntimeException&lt;br /&gt;caller does not have to handle exception&lt;br /&gt;e.g. NullPointerException&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So, when should you use checked exceptions and when should you use unchecked exceptions?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A good guidline is to throw checked exceptions when the caller can reasonable handle a failure and can perform appropriate action. For example a client could easily perform some corrective action if a FileNotFound exception were to be thrown. If however the system throws a ClassCastException (which is an unchecked exception), there's not much that the caller could do about this. In this case, it may be better to throw a unchecked exception.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In J2EE containers, unchecked exceptions are caught by the container, and would, for example, cause an EJB transaction to be rolled back.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In Spring, unchecked exceptions are used extensively for data access code in the form of DataAccessExceptions. Typically if an error occurs in data access code, the client application cannot recover and a roll-back operation is performed. In this case unchecked exceptions (e.g. DataAccessException) are appropriate.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-115225873631990672?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/115225873631990672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=115225873631990672&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115225873631990672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115225873631990672'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/07/types-of-exceptions.html' title='Types of Exceptions'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-115198615859376061</id><published>2006-07-05T21:38:00.000+05:30</published><updated>2006-07-05T09:32:36.503+05:30</updated><title type='text'>If a class is located in a package, what do you need to change in the OS environment to be able to use it?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;You need to add a directory or a jar file that contains the package directories to the CLASSPATH environment variable. Let's say a class Employee belongs to a package com.xyz.hr; and is located in the file c:\dev\com\xyz\hr\Employee.java. In this case, you'd need to add c:\dev to the variable CLASSPATH. If this class contains the method main(), you could test it from a command prompt window as follows:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;c:\&gt;java com.xyz.hr.Employee&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-115198615859376061?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/115198615859376061/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=115198615859376061&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115198615859376061'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115198615859376061'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/07/if-class-is-located-in-package-what-do.html' title='If a class is located in a package, what do you need to change in the OS environment to be able to use it?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-115198590281394697</id><published>2006-07-05T09:39:00.000+05:30</published><updated>2006-07-04T09:35:02.826+05:30</updated><title type='text'>What is a task's priority and how is it used in scheduling?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;A task's priority is an integer value that identifies the relative order in which it should be executed with respect to other tasks. The scheduler attempts to schedule higher priority tasks before lower priority tasks. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-115198590281394697?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/115198590281394697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=115198590281394697&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115198590281394697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115198590281394697'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/07/what-is-tasks-priority-and-how-is-it.html' title='What is a task&apos;s priority and how is it used in scheduling?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-115164028731784264</id><published>2006-06-30T09:29:00.000+05:30</published><updated>2006-06-30T09:34:47.326+05:30</updated><title type='text'>Does it matter in what order catch statements for FileNotFoundException and IOExceptipon are written?</title><content type='html'>Yes, it does. The FileNoFoundException is inherited from the IOException. Exception's subclasses have to be caught first.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-115164028731784264?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/115164028731784264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=115164028731784264&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115164028731784264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115164028731784264'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/06/does-it-matter-in-what-order-catch.html' title='Does it matter in what order catch statements for FileNotFoundException and IOExceptipon are written?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-115146583570831922</id><published>2006-06-28T09:07:00.000+05:30</published><updated>2006-06-28T09:07:15.716+05:30</updated><title type='text'>Can we use the constructor, instead of init(), to initialize servlet?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&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;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-115146583570831922?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/115146583570831922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=115146583570831922&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115146583570831922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115146583570831922'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/06/can-we-use-constructor-instead-of-init.html' title='Can we use the constructor, instead of init(), to initialize servlet?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-114076110832292266</id><published>2006-06-27T20:30:00.000+05:30</published><updated>2006-06-27T17:11:38.836+05:30</updated><title type='text'>EJB Interview Questions Part-1</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;What is the need of Remote and Home interface. Why cant it be in one?&lt;br /&gt;The main reason is because there is a clear division of roles and responsabilities between the two interfaces. The home interface is your way to communicate with the container, that is who is responsable of creating, locating even removing one or more beans. The remote interface is your link to the bean, that will allow you to remotely access to all its methods and members. As you can see there are two distinct elements (the container and the beans) and you need two different interfaces for accessing to both of them.&lt;br /&gt;&lt;br /&gt;Can I develop an Entity Bean without implementing the create() method in the home interface?&lt;br /&gt;As per the specifications, there can be 'ZERO' or 'MORE' create() methods defined in an Entity Bean. In cases where create() method is not provided, the only way to access the bean is by knowing its primary key, and by acquiring a handle to it by using its corresponding finder method. In those cases, you can create an instance of a bean based on the data present in the table. All one needs to know is the primary key of that table. i.e. a set a columns that uniquely identify a single row in that table. Once this is known, one can use the 'getPrimaryKey()' to get a remote reference to that bean, which can further be used to invoke business methods.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What is the difference between Context, InitialContext and Session Context? How they are used?&lt;br /&gt;javax.naming.Context is an interface that provides methods for binding a name to an object. It's much like the RMI Naming.bind() method.&lt;br /&gt;&lt;br /&gt;javax.naming.InitialContext is a Context and provides implementation for methods available in the Context interface.&lt;br /&gt;&lt;br /&gt;Where as SessionContext is an EJBContext object that is provided by the EJB container to a SessionBean in order for the SessionBean to access the information and/or services or the container.&lt;br /&gt;&lt;br /&gt;There is EntityContext too which is also and EJBContext object that'll be provided to an EntityBean for the purpose of the EntityBean accessing the container details. In general, the EJBContext (SessionContext and EntityContext), AppletContext and ServletContext help the corresponding Java objects in knowing about its 'context' [environment in which they run], and to access particular information and/or service. Whereas, the javax.naming.Context is for the purpose of 'NAMING' [by the way of referring to] an object.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-114076110832292266?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/114076110832292266/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=114076110832292266&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/114076110832292266'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/114076110832292266'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/06/ejb-interview-questions-part-1.html' title='EJB Interview Questions Part-1'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-115105838755813289</id><published>2006-06-23T15:50:00.000+05:30</published><updated>2006-06-23T16:01:09.550+05:30</updated><title type='text'>java e-Books</title><content type='html'>&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.sap-img.com/java/java-books.htm"&gt;http://www.sap-img.com/java/java-books.htm&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-115105838755813289?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/115105838755813289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=115105838755813289&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115105838755813289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115105838755813289'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/06/java-e-books.html' title='java e-Books'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-18870537.post-115105687244405745</id><published>2006-06-23T15:28:00.001+05:30</published><updated>2006-06-23T15:31:12.456+05:30</updated><title type='text'>How many Design Patterns are there in Java ?</title><content type='html'>&lt;span style="font-family:arial;font-size:85%;"&gt;In j2ee they have 15 Design Pattern:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Presentation Tier:&lt;br /&gt;&lt;/strong&gt;1.Intercepting Filter&lt;br /&gt;2. Front Controller&lt;br /&gt;3. View Helper&lt;br /&gt;4. Composite View&lt;br /&gt;5. Service to Worker&lt;br /&gt;6. Dispatcher View&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Business Tier:&lt;br /&gt;&lt;/strong&gt;7. Business Delegate&lt;br /&gt;8. Transfer Object&lt;br /&gt;9. Session Facade&lt;br /&gt;10. Service Locator&lt;br /&gt;11. Transfer Object&lt;br /&gt;12. Value List Handler&lt;br /&gt;13. Composite Entity&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Integration Tier:&lt;/strong&gt;&lt;br /&gt;14.Service Activator&lt;br /&gt;15 Data Access Object &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/18870537-115105687244405745?l=javapeople.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://master-in-java.blogspot.com/' title='How many Design Patterns are there in Java ?'/><link rel='replies' type='application/atom+xml' href='http://javapeople.blogspot.com/feeds/115105687244405745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=18870537&amp;postID=115105687244405745&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115105687244405745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/18870537/posts/default/115105687244405745'/><link rel='alternate' type='text/html' href='http://javapeople.blogspot.com/2006/06/how-many-design-patterns-are-there-in_23.html' title='How many Design Patterns are there in Java ?'/><author><name>javapeople</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
