<?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:blogger='http://schemas.google.com/blogger/2008' 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-2154917220162051650</id><updated>2024-10-24T04:40:05.369-07:00</updated><category term="J2EE Technologies"/><category term="Java Books"/><category term="Core Java Concepts"/><category term="Java FAQ&#39;s"/><category term="Java Interview Questions"/><category term="Application Server"/><category term="EJB"/><category term="Java Coding Examples"/><category term="Java Coding Samples"/><category term="Core Java"/><category term="Java Server Pages"/><category term="Spring"/><category term="Spring Framework"/><category term="Struts"/><category term="WebLogic Application Server"/><category term="Hibernate"/><category term="JSP"/><category term="Java Programming"/><category term="Java Servlets"/><category term="Java Coding"/><category term="JDBC"/><category term="Ajax"/><category term="Java 1.5"/><category term="Java RMI"/><category term="Java Updates"/><category term="Java Versions"/><category term="MVC Pattern"/><category term="WebServer"/><category term="Internationalization"/><category term="JMS"/><category term="Java History"/><category term="Java Server Faces (JSF)"/><category term="Java Web Services"/><title type='text'>Java J2EE Technologies Articles Concepts Spring Hibernate</title><subtitle type='html'>Java J2EE Technologies Articles on Core Java Concepts, Java eBooks, Java Database Connectivity (JDBC) , Java Servlets , Java server Pages (JSP) , Java Versions, Struts Framework, Hibernate , WebLogic Application Server, Swings, Spring Framework , AJAX , JMS , Enterprise Java Beans (EJB) , Java Script. Also get Java faqs, Interview Questions.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>121</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-2877164054346954513</id><published>2012-03-12T23:34:00.001-07:00</published><updated>2012-03-12T23:34:17.884-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Core Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Core Java Concepts"/><category scheme="http://www.blogger.com/atom/ns#" term="Java FAQ&#39;s"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Interview Questions"/><title type='text'>Java Synchronization</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;color: #0c343d; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;i&gt;&lt;b&gt;Synchronization in Java:&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0c343d; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0c343d; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
Java Synchronization is a process of controlling the access of shared resources by the multiple threads in such a manner where only one thread can access one resource at a time. In non synchronized multithreaded application, it is possible for one thread to modify a shared object, while another thread is in the process of using or updating the object&#39;s value.&lt;br /&gt;&lt;br /&gt;Synchronization prevents such type of data corruption. Synchronization is best use with the Multi-Threading in Java. Synchronization can be done at two levels:&lt;/div&gt;
&lt;ul style=&quot;color: #0c343d; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: left;&quot;&gt;
&lt;li&gt;Synchronizing a function&lt;/li&gt;
&lt;li&gt;Synchronizing a block of code&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;color: #0c343d; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: left;&quot;&gt;
Please find the sample code below&lt;br /&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;Synchronizing a function&lt;/i&gt;&lt;/b&gt;:&amp;nbsp;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;color: #0c343d; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
public synchronized void&amp;nbsp; Display()&amp;nbsp;&lt;/blockquote&gt;
&lt;blockquote style=&quot;color: #0c343d;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; // related code&lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;}&lt;/span&gt;&lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/blockquote&gt;
&lt;div style=&quot;color: #0c343d; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;i&gt;&lt;b&gt;Synchronizing a block of code inside a function:&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;color: #0c343d; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&amp;nbsp;public myFunction ()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; synchronized (this)&lt;br /&gt;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; // Synchronized code&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/blockquote&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/2877164054346954513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2012/03/java-synchronization.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/2877164054346954513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/2877164054346954513'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2012/03/java-synchronization.html' title='Java Synchronization'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-6887068187149022050</id><published>2012-02-09T22:44:00.000-08:00</published><updated>2012-02-09T22:44:58.737-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Application Server"/><category scheme="http://www.blogger.com/atom/ns#" term="WebLogic Application Server"/><title type='text'>Oracle Weblogic Server CLASSPATH</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;color: #e69138; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;fullpost&quot;&gt;Setting up CLASSPATH in Weblogic Server:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;span class=&quot;fullpost&quot;&gt;&lt;i&gt;Oracle WebLogic Server&lt;/i&gt; installs the following script that you can use to set the classpath that a server requires&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;li&gt;&lt;span class=&quot;fullpost&quot;&gt;WL_HOME/server\bin/setWLSEnv.cmd (on Windows)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;fullpost&quot;&gt;WL_HOME/server/bin/setWLSEnv.sh (on UNIX)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span class=&quot;fullpost&quot; style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;In addition, &lt;i&gt;&lt;b&gt;WebLogic &lt;/b&gt;&lt;/i&gt;distribution server includes shell scripts that you can use to start the server. These scripts, which are located in the domain directories under the config directory of your WebLogic Server distribution, automatically set up the CLASSPATH variable in the shell before starting the server.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/6887068187149022050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2012/02/oracle-weblogic-server-classpath-setup.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/6887068187149022050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/6887068187149022050'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2012/02/oracle-weblogic-server-classpath-setup.html' title='Oracle Weblogic Server CLASSPATH'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-3802562518524205859</id><published>2012-01-24T03:27:00.000-08:00</published><updated>2012-01-24T03:27:36.151-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="J2EE Technologies"/><category scheme="http://www.blogger.com/atom/ns#" term="Java FAQ&#39;s"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Interview Questions"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring Framework"/><title type='text'>Java Spring Framework Dependency Injection Variants</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;i&gt;&lt;b&gt;Variants in &lt;/b&gt;&lt;/i&gt;&lt;i&gt;&lt;b&gt;Java Spring Framework Dependency Injection&lt;/b&gt;&lt;/i&gt;:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Constructor dependency Injection&lt;/i&gt;: Dependencies are provided through the constructors of the component&lt;i&gt;.&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;i&gt; &lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
Setter dependency injection: Dependencies are provided through the JavaBeanstyle setter methods of the component and are more popular than Constructor dependency injection.&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;u&gt;&lt;i&gt;Constructor Dependency Injection Syntax&lt;/i&gt;&lt;/u&gt;:&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;public class ConstructorInjection &lt;/span&gt;&lt;br style=&quot;color: #e69138;&quot; /&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;color: #e69138;&quot; /&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;private Dependency dep;&lt;/span&gt;&lt;br style=&quot;color: #e69138;&quot; /&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;public ConstructorInjection(Dependency dep) &lt;/span&gt;&lt;br style=&quot;color: #e69138;&quot; /&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;color: #e69138;&quot; /&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;this.dep = dep;&lt;/span&gt;&lt;br style=&quot;color: #e69138;&quot; /&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;}&lt;/span&gt;&lt;br style=&quot;color: #e69138;&quot; /&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;}&lt;/span&gt;&lt;/blockquote&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;u&gt;&lt;i&gt;Setter Dependency Injection Syntax&lt;/i&gt;&lt;/u&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;public class SetterInjection &lt;/span&gt;&lt;br style=&quot;color: #e69138;&quot; /&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;color: #e69138;&quot; /&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;private Dependency dep;&lt;/span&gt;&lt;br style=&quot;color: #e69138;&quot; /&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;public void setMyDependency(Dependency dep) &lt;/span&gt;&lt;br style=&quot;color: #e69138;&quot; /&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;color: #e69138;&quot; /&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;this.dep = dep;&lt;/span&gt;&lt;br style=&quot;color: #e69138;&quot; /&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;}&lt;/span&gt;&lt;br style=&quot;color: #e69138;&quot; /&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;}&lt;/span&gt;&lt;/blockquote&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/3802562518524205859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2012/01/java-spring-framework-dependency.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/3802562518524205859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/3802562518524205859'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2012/01/java-spring-framework-dependency.html' title='Java Spring Framework Dependency Injection Variants'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-5223660401352315506</id><published>2012-01-20T23:50:00.000-08:00</published><updated>2012-01-20T23:50:24.479-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Core Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Core Java Concepts"/><category scheme="http://www.blogger.com/atom/ns#" term="Java FAQ&#39;s"/><title type='text'>Java Stack and Heap Memory</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;color: #e69138; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span class=&quot;fullpost&quot;&gt;Java Stack and Heap Memory:&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;span class=&quot;fullpost&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;span class=&quot;fullpost&quot;&gt;Each time an object is created in Java it goes into the area of memory known as &lt;i&gt;heap&lt;/i&gt;. The primitive variables like int and double are allocated in the stack, if they are local method variables and in the heap if they are member variables (i.e. fields of a class). In Java methods local variables are pushed into &lt;i&gt;stack &lt;/i&gt;when a method is invoked and stack pointer is decremented when a method call is completed. In a multi-threaded application each thread will have its own stack but will share the same heap. This is why care should be taken in your code to avoid any concurrent access issues in the heap space. The stack is threadsafe (each thread will have its own stack) but the heap is not threadsafe unless guarded with synchronization through your code.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;fullpost&quot;&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;A method in stack is re-entrant allowing multiple concurrent invocations that do not interfere with each other. A function is recursive if it calls itself. Given enough stack space, recursive method calls are perfectly valid in Java though it is tough to debug. Recursive functions are useful in removing iterations from many sorts of algorithms. All recursive functions are re-entrant but not all re-entrant functions are recursive. Idempotent methods are methods, which are written in such a way that repeated calls to the same method with the same arguments yield same results. For example clustered EJBs, which are written with idempotent methods, can automatically recover from a server failure as long as it can reach another server.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/5223660401352315506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2012/01/java-stack-and-heap-memory.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/5223660401352315506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/5223660401352315506'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2012/01/java-stack-and-heap-memory.html' title='Java Stack and Heap Memory'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-7611252456139239197</id><published>2012-01-10T02:27:00.000-08:00</published><updated>2012-01-10T02:27:49.362-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="J2EE Technologies"/><category scheme="http://www.blogger.com/atom/ns#" term="Java FAQ&#39;s"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Interview Questions"/><category scheme="http://www.blogger.com/atom/ns#" term="Struts"/><title type='text'>STRUTS 2 Interceptors</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;color: #e69138; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;i&gt;&lt;b&gt;&lt;span class=&quot;fullpost&quot;&gt;Interceptors in STRUTS 2&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Many of the features provided in the &lt;b&gt;Struts2&lt;/b&gt; framework are implemented using interceptors; examples include exception handling, file uploading, lifecycle callbacks and validation. Interceptors are conceptually the same as servlet filters or the JDKs Proxy class. They provide a way to supply pre-processing and post-processing around the action. Similar to servlet filters,interceptors can be layered and ordered. They have access to the action being executed, as well as all environmental variables and execution&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;properties. (Reference: Ian Roughley - Starting Struts 2 Book)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Below are the implementing interceptors mentioned:&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Spring Framework&amp;nbsp; the &lt;i&gt;&lt;b&gt;ActionAutowiringInterceptor&lt;/b&gt;&lt;/i&gt; interceptor.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Request String and Form Values&amp;nbsp; the &lt;i&gt;&lt;b&gt;ParametersInterceptor&lt;/b&gt;&lt;/i&gt; interceptor.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Servlet-based objects&amp;nbsp; the &lt;i&gt;&lt;b&gt;ServletConfigInterceptor&lt;/b&gt;&lt;/i&gt; interceptor.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;The first two interceptors work independently, with no requirements from the action, but the last interceptor &lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;ServletConfigInterceptor &lt;/i&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;is different.It works with the assistance of the following interfaces:&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;SessionAware&lt;/b&gt; to provide access to all the session attributes via a Map&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;ServletRequestAware&lt;/b&gt; to provide access to the HttpServletRequest object&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;RequestAware&lt;/b&gt; to provide access to all the request attributes via a Map&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;ApplicationAware&lt;/b&gt; to provide access to all the application attributes via a Map&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;ServletResponseAware&lt;/b&gt; to provide access to the HttpServletResponse object&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;ParameterAware&lt;/b&gt; to provide access to all the request string and form values attributes via a Map&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;PrincipalAware&lt;/b&gt; to provide access to the PrincipleProxy object; this object implements the principle and role methods of the HttpServletRequest object in implementation, but by providing a proxy,allows for implementation independence in the action&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;ServletContextAware&lt;/b&gt; to provide access to the ServletContext object&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/7611252456139239197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2012/01/struts-2-interceptors.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/7611252456139239197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/7611252456139239197'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2012/01/struts-2-interceptors.html' title='STRUTS 2 Interceptors'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-491839802139509252</id><published>2012-01-01T22:37:00.000-08:00</published><updated>2012-01-01T22:37:49.736-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Core Java"/><category scheme="http://www.blogger.com/atom/ns#" term="J2EE Technologies"/><title type='text'>Java Mail API</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;fullpost&quot;&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;b&gt;Java Mail API&lt;/b&gt; is used to send and receive emails between applications. To send and receive the emails&amp;nbsp; SMPT, POP and IMAP protocols are used. The message sending and receiving is done by creating a framework using set of abstract classes in the API. This framework allows the application to create customized cross-platform mail application by having basic knowledge of e-mail. There are methods and classes that are used to access mail folders, message downloading and sending messages along with attachments feature.&lt;/span&gt;&lt;br style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;&lt;br style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;i&gt;Java Mail API&lt;/i&gt; is used to create personal mail filter, simple mailing lists and personal mail applications. Java mail also includes the capabilities to add the emailing process to an enterprise application or even to create a full-fledged e-mail client. Many companies in the industry have written new e-mail clients using Java Mail. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;text-align: justify;&quot;&gt;
&lt;li&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;JavaMail is a set of abstract classes that create a framework for sending, receiving and handling e-mail.&lt;/span&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;The package that Sun provides contains implementations of IMAP and SMTP, which allow sending and receiving mail.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;The framework eases the creation of cross-platform mail application without an in-depth knowledge of e-mail.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;There are methods and classes that allow access to mail folders, download messages, send messages with attachments and filter mail.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/491839802139509252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2012/01/java-mail-api.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/491839802139509252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/491839802139509252'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2012/01/java-mail-api.html' title='Java Mail API'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-3774729674682120511</id><published>2011-12-28T23:48:00.000-08:00</published><updated>2011-12-28T23:50:26.997-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Application Server"/><title type='text'>WebSphere Application Server Node Agents</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;color: #e69138; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;i&gt;&lt;b&gt;&lt;span class=&quot;fullpost&quot;&gt;Node Agents in WebSphere Application Server&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;fullpost&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;span class=&quot;fullpost&quot; style=&quot;font-size: small;&quot;&gt;A Websphere Node is a logical grouping of server processes managed by WebSphere and that share common configuration and operation control. A node is a grouping of managed or unmanaged servers. A node usually corresponds to a logical or physical computer system with a distinct IP host address. Nodes cannot span multiple computers. Node names usually are identical to the host name for the computer.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;span class=&quot;fullpost&quot; style=&quot;font-size: small;&quot;&gt;Nodes in the network deployment topology can be managed or unmanaged. A managed node has a node agent process that manages its configuration and servers. Unmanaged nodes do not have a node agent.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;span class=&quot;fullpost&quot; style=&quot;font-size: small;&quot;&gt;A node corresponds to a physical computer system with a distinct IP host address. The node name is usually the same as the host name for the computer. The following table lists the nodes in this cell. You can add new nodes into the cell by clicking on &quot;Add Node&quot; and specifying a remote, running &lt;b&gt;&lt;i&gt;WebSphere &lt;/i&gt;&lt;/b&gt;Application Server instance.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;span class=&quot;fullpost&quot; style=&quot;font-size: small;&quot;&gt;The &lt;/span&gt;&lt;span class=&quot;fullpost&quot; style=&quot;font-size: small;&quot;&gt;Websphere &lt;/span&gt;&lt;span class=&quot;fullpost&quot; style=&quot;font-size: small;&quot;&gt;Node Agent represents the node in the management cell and keeps the configuration up to date. Node agents are administrative agents that represent a node to your system and manage the servers on that node. Node agents monitor application servers on a host system and route administrative requests to servers.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;span class=&quot;fullpost&quot; style=&quot;font-size: small;&quot;&gt;A &lt;/span&gt;&lt;span class=&quot;fullpost&quot; style=&quot;font-size: small;&quot;&gt;Websphere &lt;/span&gt;&lt;span class=&quot;fullpost&quot; style=&quot;font-size: small;&quot;&gt;Node Group is a new concept introduced with &lt;i&gt;WebSphere &lt;/i&gt;Application Server V6. A node group is a grouping of nodes within a cell that have similar capabilities. A node group is a collection of managed nodes.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/3774729674682120511/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2011/12/websphere-application-server-node.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/3774729674682120511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/3774729674682120511'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2011/12/websphere-application-server-node.html' title='WebSphere Application Server Node Agents'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-7886487236227777211</id><published>2011-12-21T23:23:00.000-08:00</published><updated>2011-12-21T23:23:55.212-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Application Server"/><category scheme="http://www.blogger.com/atom/ns#" term="WebLogic Application Server"/><title type='text'>WebLogic Server Load Balancing</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;color: #e69138; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;span class=&quot;fullpost&quot; style=&quot;font-size: small;&quot;&gt;&lt;i&gt;&lt;b&gt;Load Balancing in WebLogic Server&lt;/b&gt;&lt;/i&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;span class=&quot;fullpost&quot; style=&quot;font-size: small;&quot;&gt;Load balancing is about distributing work across multiple servers within a cluster. Ideally you want this work to be distributed evenly, to the capabilities and load on each server within the cluster. &lt;i&gt;WebLogic &lt;/i&gt;is able to load-balance requests to members within a cluster when certain conditions are satisfied.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;span class=&quot;fullpost&quot; style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: justify;&quot;&gt;
&lt;span class=&quot;fullpost&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;First, WebLogic requires that (most) components be deployed homogeneously to each server in the cluster. In the multi-tier application setup, the web application is targeted to all servers that belong to the presentation tier cluster. Because of this, incoming requests can be distributed evenly across the different members of the presentation tier. Similarly, the EJB components are available on all members of the object tier cluster. Because of this, incoming EJB calls from the presentation tier (or any external client) can be distributed across the different servers in the object tier.&lt;br /&gt;&lt;br /&gt;When a component is deployed to a cluster, multiple copies of the component will be sitting on the different servers comprising the cluster. WebLogic uses the cluster-wide JNDI tree to record the availability of these replicas in the object tier, whereas a proxy plug-in typically holds the information about the availability of servers hosting the servlets and JSP pages.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;WebLogic &lt;/b&gt;also must be aware of the status of the components that have been deployed to the cluster. This information forms the basis on which a load balancer can decide which server instances should be used when a request is made to the cluster. WebLogic uses a variety of methods to determine the health status of servers, including multicast heartbeats. By knowing when a server instance is under heavy load while the others aren&#39;t, a load balancer is able to direct new requests to the other members of the cluster. Hardware load balancers often have this capability&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/7886487236227777211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2011/12/weblogic-server-load-balancing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/7886487236227777211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/7886487236227777211'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2011/12/weblogic-server-load-balancing.html' title='WebLogic Server Load Balancing'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-8525583574689446031</id><published>2011-12-18T22:59:00.000-08:00</published><updated>2011-12-18T22:59:05.259-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="J2EE Technologies"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring Framework"/><title type='text'>Accessing the Java Spring Container</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;color: #0b5394;&quot;&gt;&lt;u&gt;&lt;b&gt;How to access the java Spring Container:&lt;/b&gt;&lt;/u&gt;&lt;/div&gt;&lt;div style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #0b5394;&quot;&gt;Java Spring is an open source, lightweight, application framework that is intended to help structure entire applications in a consistent manner, pulling together best of breed single-tier frameworks in&lt;br /&gt;
a coherent architecture. &lt;/div&gt;&lt;div style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #0b5394;&quot;&gt;&lt;i&gt;&lt;b&gt;From Stand-alone&lt;/b&gt;&lt;/i&gt;:&lt;/div&gt;&lt;blockquote style=&quot;color: #0b5394;&quot;&gt;ApplicationContext context = new&lt;br /&gt;
ClassPathXmlApplicationContext(APP_CONTEXT_CLASSPATH);&lt;br /&gt;
(APP_CONTEXT_CLASSPATH is spring/pam-contact-loader-spring-context.xml)&lt;/blockquote&gt;&lt;div style=&quot;color: #0b5394;&quot;&gt;&lt;i&gt;&lt;b&gt;From Web Application&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;blockquote class=&quot;tr_bq&quot; style=&quot;color: #0b5394;&quot;&gt;ApplicationContext context =&lt;br /&gt;
WebApplicationContextUtils.getWebApplicationContext(&lt;br /&gt;
pRequest.getSession().getServletContext());&lt;/blockquote&gt;&lt;div style=&quot;color: #0b5394;&quot;&gt;&lt;i&gt;&lt;b&gt;web.xml modification &lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;blockquote style=&quot;color: #0b5394;&quot;&gt;&amp;lt;ltcontext-param&amp;gt;&lt;br /&gt;
&amp;lt;param-name&amp;gt;contextConfigLocation&amp;lt;/param-name&amp;gt;&lt;br /&gt;
&amp;lt;param-value&amp;gt;/WEB-INF/classes/spring/pam-spring-context.xml&amp;lt;/param-value&amp;gt;&lt;br /&gt;
&amp;lt;/context-param&amp;gt;&lt;br /&gt;
&amp;lt;listener&amp;gt;&lt;br /&gt;
&amp;lt;listener-class&amp;gt;org.springframework.web.context.ContextLoaderListener&amp;lt;/listenerclass&amp;gt;&lt;br /&gt;
&amp;lt;/listener&amp;gt;&lt;/blockquote&gt;&lt;div style=&quot;color: #0b5394;&quot;&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/8525583574689446031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2011/12/accessing-java-spring-container.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/8525583574689446031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/8525583574689446031'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2011/12/accessing-java-spring-container.html' title='Accessing the Java Spring Container'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-513077693396245196</id><published>2011-12-15T23:25:00.000-08:00</published><updated>2011-12-15T23:25:48.973-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Application Server"/><category scheme="http://www.blogger.com/atom/ns#" term="WebLogic Application Server"/><title type='text'>WebLogic Clustering</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;color: #38761d; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Clustering&amp;nbsp; in &lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;WebLogic&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;A WebLogic domain can be composed of a number of WebLogic instances, and several of these servers may be grouped into clusters. The Domain is the parent of a Cluster. It contains typically one Admin and one or more Managed servers. Now the Cluster is a grouping of some or all of these managed servers within the domain.For instance, you could set up a cluster of WebLogic servers, all of which host your web application and related resources. This cluster of servers could be fronted by a load balancer that distributes requests evenly across all the members of the cluster. The load balancer could itself be another WebLogic instance. All server instances must belong to the same &lt;i&gt;WebLogic&lt;/i&gt; domain.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;Thus, a &lt;/span&gt;&lt;i style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;b&gt;WebLogic cluster&lt;/b&gt;&lt;/i&gt;&lt;span style=&quot;color: #0b5394; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt; is a group of servers working together with services, such as clustered JNDI, to provide support for failover and load balancing. A domain may in turn have a number of WebLogic instances, several groups of which can be placed into different clusters.&lt;/span&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/513077693396245196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2011/12/weblogic-clustering.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/513077693396245196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/513077693396245196'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2011/12/weblogic-clustering.html' title='WebLogic Clustering'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-1222767741495488476</id><published>2011-12-14T20:34:00.000-08:00</published><updated>2011-12-14T20:45:24.129-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Application Server"/><category scheme="http://www.blogger.com/atom/ns#" term="WebServer"/><title type='text'>Difference between Web Server and Application Server</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;color: #20124d; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Webserver &lt;/b&gt;A &lt;i&gt;Web server&lt;/i&gt; handles the HTTP protocol. When the Web server receives an HTTP request, it responds with an HTTP response, such as sending back an HTML page. To process a request, a Web server may respond with a static HTML page or image, send a redirect, or delegate the dynamic response generation to some other program such as CGI scripts, JSPs (JavaServer Pages), servlets, ASPs (Active Server Pages), server-side JavaScripts, or some other server-side technology. Whatever their purpose, such server-side programs generate a response, most often in HTML, for viewing in a Web browser.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #20124d; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #20124d; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;Web servers&lt;/i&gt; are technology designed to create and deploy Web site, serving up content more so than applications. They both use Web interfaces, but Web servers are more about the interface than the back-end logic. In other words, Web servers serve up content. As time moves on Web servers are looking more like application server, as they adopt their functionality. &lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #20124d; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #20124d; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Application Server&lt;/b&gt; As for the &lt;i&gt;application server&lt;/i&gt;, according to our definition, an application server exposes business logic to client applications through various protocols, possibly including HTTP. While a Web server mainly deals with sending HTML for display in a Web browser, an application server provides access to business logic for use by client application programs. The application program can use this logic just as it would call a method on an object.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #20124d; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #20124d; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;An &lt;i&gt;application server&lt;/i&gt; is technology where developers can create, test, and execute application components. Application servers are typically J2EE-based, running EJBs or other Java components. Application servers are designed to create true applications with complex business logic, and have scalability features such as load balancing, fail-over, and process distribution. In other words, it&#39;s primarily a development environment.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/1222767741495488476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2011/12/diiference-between-web-server-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/1222767741495488476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/1222767741495488476'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2011/12/diiference-between-web-server-and.html' title='Difference between Web Server and Application Server'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-7636470389669182879</id><published>2011-09-13T20:44:00.000-07:00</published><updated>2011-09-13T20:44:10.716-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Core Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Java FAQ&#39;s"/><title type='text'>Difference between JRE/JVM/JDK</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span style=&quot;color: #20124d; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;JDK is the Java Development Kit i.e. JDK is bundle of software that you can use to develop Java based software. JRE is the Java Runtime Environment i.e. JRE is an implementation of the Java Virtual Machine which actually executes Java programs. Typically, each JDK contains one (or more) JRE’s along with the various development tools like the Java source compilers, bundling and deployment tools, debuggers,development libraries, etc. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;fullpost&quot;&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/7636470389669182879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2011/09/difference-between-jrejvmjdk.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/7636470389669182879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/7636470389669182879'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2011/09/difference-between-jrejvmjdk.html' title='Difference between JRE/JVM/JDK'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-8808617443067057909</id><published>2010-03-03T06:40:00.000-08:00</published><updated>2010-03-03T06:46:34.253-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="J2EE Technologies"/><category scheme="http://www.blogger.com/atom/ns#" term="Struts"/><title type='text'>Struts ActionForm &amp; DynaActionForm</title><content type='html'>&lt;span class=&quot;fullpost&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#006600;&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;Difference between ActionForm and DynaActionForm&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#006600;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#006600;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;An ActionForm represents an HTML form that the user interacts with over one or more pages. You will provide properties to hold the state of the form with getters and setters to access them. Whereas, using DynaActionForm there is no need of providing properties to hold the state. Instead these properties and their type are declared in the struts-config.xml&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#006600;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#006600;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;The DynaActionForm bloats up the Struts config file with the xml based definition. This gets annoying as the Struts Config file grow larger.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#006600;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#006600;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;The DynaActionForm is not strongly typed as the ActionForm. This means there is no compile time checking for the form fields. Detecting them at runtime is painful and makes you go through redeployment.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#006600;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#006600;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;ActionForm can be cleanly organized in packages as against the flat organization in the Struts Config file.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#006600;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#006600;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;ActionForm were designed to act as a Firewall between HTTP and the Action classes, i.e. isolate and encapsulate the HTTP request parameters from direct use in Actions. With DynaActionForm, the property access is no different than using request.getParameter( .. ).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#006600;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#006600;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;trebuchet ms&#39;;&quot;&gt;DynaActionForm construction at runtime requires a lot of Java Reflection (Introspection) machinery that can be avoided.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/8808617443067057909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2010/03/struts-actionform-and-dynaactionform.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/8808617443067057909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/8808617443067057909'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2010/03/struts-actionform-and-dynaactionform.html' title='Struts ActionForm &amp; DynaActionForm'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-1605468594420617206</id><published>2010-02-21T18:47:00.000-08:00</published><updated>2010-02-21T18:52:02.018-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hibernate"/><category scheme="http://www.blogger.com/atom/ns#" term="J2EE Technologies"/><title type='text'>Hibernate proxy</title><content type='html'>&lt;span style=&quot;color: rgb(102, 51, 51); font-weight: bold;font-family:trebuchet ms;&quot; &gt;Hibernate proxy&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);font-family:trebuchet ms;&quot; &gt;&lt;br /&gt;&lt;br /&gt;Proxies are created dynamically by subclassing your object at runtime. The subclass has all the methods of the parent, and when any of the methods are accessed, the proxy loads up the real object from the DB and calls the method for you. Very nice in simple cases with no object hierarchy. Typecasting and instanceof work perfectly on the proxy in this case since it is a direct subclass. By default Hibernate creates a proxy for each of the class you map in mapping file. This class contain the code to invoke JDBC. This class is created by hibernate using CGLIB.&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);font-family:trebuchet ms;&quot; &gt;&lt;br /&gt;&lt;br /&gt;Proxies are the mechanism that allows Hibernate to break up the interconnected cloud of objects in the database into smaller chunks, that can easily fit in memory. Proxies are created dynamically by subclassing your object at runtime. The subclass has all the methods of the parent, and when any of the methods are accessed, the proxy loads up the real object from the DB and calls the method for you. &lt;/span&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;A class can be mapped to a proxy instead to a table. When you actually call load on session it returns you proxy. This proxy may contain actual method to load the data. Object proxies can be defined in one of two ways. First, you can add a proxy attribute to the class element. You can either specify a different class or use the persistent class as the proxy. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;For example:&lt;/span&gt;&lt;blockquote&gt;&lt;span style=&quot;color: rgb(153, 51, 0);&quot;&gt;&amp;lt;class name=&quot;Loc&quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(153, 51, 0);&quot;&gt;&lt;br /&gt;proxy=&quot;com.ch01.Loc&quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(153, 51, 0);&quot;&gt;&lt;br /&gt;lt;/class&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;The second method is to use the lazy attribute. Setting lazy=&quot;true&quot;is a shorthand way of defining the persistent class as the proxy.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/1605468594420617206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2010/02/hibernate-proxy-proxies-are-created.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/1605468594420617206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/1605468594420617206'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2010/02/hibernate-proxy-proxies-are-created.html' title='Hibernate proxy'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-4496770802175603432</id><published>2010-02-07T09:47:00.000-08:00</published><updated>2010-02-07T09:50:28.309-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java Server Pages"/><category scheme="http://www.blogger.com/atom/ns#" term="JSP"/><title type='text'>JSP Program to Delete a Cookie Values</title><content type='html'>&lt;span style=&quot;color: rgb(51, 0, 153);&quot;&gt;&lt;span style=&quot;font-weight: bold; font-style: italic;&quot;&gt;JSP&lt;/span&gt; is a dynamic scripting capability for web pages that allows Java as well as a few special tags to be embedded into a web file (HTML/XML, etc). The suffix traditionally ends with .jsp to indicate to the web server that the file is a JSP files. JSP is a server side technology - you can’t do any client side validation with it. The &lt;span style=&quot;font-weight: bold;&quot;&gt;JSP&lt;/span&gt; assists in making the HTML more functional.  Servlets on the other hand allow outputting of HTML but it is a tedious process. It is easy to make a change and then let the JSP capability of the web server you are using deal with&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 0, 153);&quot;&gt;compiling it into a servlet and running it.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 0, 153);&quot;&gt;Sample JSP Program to Delete a Cookie Value:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;lt;%&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&lt;br /&gt;Cookie killCookie = new Cookie(“Ck”, null);&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&lt;br /&gt;KillCookie.setPath(“/”);&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&lt;br /&gt;killCookie.setMaxAge(0);&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&lt;br /&gt;response.addCookie(killCookie);&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&lt;br /&gt;%&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style=&quot;color: rgb(51, 0, 153);&quot;&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;JSP&lt;/span&gt; pages are focused around HTML (or XML) with Java codes and JSP tags inside them. When a web server that has JSP support is asked for a JSP page, it checks to see if it has already compiled the page into a servlet. Thus, JSP pages become servlets and are transformed into pure Java and then compiled, loaded into the server and executed.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/4496770802175603432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2010/02/jsp-program-to-delete-cookie-values.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/4496770802175603432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/4496770802175603432'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2010/02/jsp-program-to-delete-cookie-values.html' title='JSP Program to Delete a Cookie Values'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-5104346047986940904</id><published>2010-02-04T07:14:00.000-08:00</published><updated>2010-02-04T07:17:14.125-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Core Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Core Java Concepts"/><title type='text'>STRING OBJECTS in JAVA</title><content type='html'>&lt;span style=&quot;color: rgb(0, 51, 51);&quot;&gt;The Java String class (java.lang.String) is a class of object that represents a character array of arbitrary length. While this external class can be used to handle string objects, Java integrates internal, built-in strings into the language.&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 51);&quot;&gt;&lt;br /&gt;&lt;br /&gt;An important attribute of the String class is that once a string object is constructed, its value cannot change (note that it is the value of an object that cannot change, not that of a string variable, which is just a reference to a string object). All String data members are private, and no string method modifies the string’s value.&lt;/span&gt;&lt;span style=&quot;font-weight: bold; font-style: italic; color: rgb(0, 102, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;CONVERTING OBJECTS TO STRINGS&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 51);&quot;&gt;&lt;br /&gt;&lt;br /&gt;The String + operator accepts a non-string operand, provided the other operand is a string. The action of the + operator on non-string operands is to convert the non-string to a string, then to do the concatenation. Operands of native types are converted to string by formatting their values. Operands of class types are converted to a string by the method toString()&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 51, 51);&quot;&gt;that is defined for all classes. Any object or value can be converted to a string by explicitly using one of the static &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 102, 0); font-style: italic;&quot;&gt;valueOf()&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 51);&quot;&gt; methods defined in class String:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;String str = String.valueOf (obj);&lt;/span&gt;&lt;/blockquote&gt;&lt;span style=&quot;color: rgb(0, 51, 51);&quot;&gt;If the argument to valueOf() is of class type, then valueOf() calls that object’s toString() method. Any class can define its own toString() method, or just rely on the default. The output produced by toString() is suitable for debugging and diagnostics. It is not meant to be an elaborate text representation of the object, nor is it meant to be parsed.&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 51);&quot;&gt; These conversion rules also apply to the right-hand side of the String += operator.&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0); font-weight: bold; font-style: italic;&quot;&gt;&lt;br /&gt;&lt;br /&gt;CONVERTING STRINGS TO NUMBERS&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 51);&quot;&gt;&lt;br /&gt;&lt;br /&gt;Methods from the various wrapper classes, such as Integer and Double, can be used to convert numerical strings to numbers. This is often necessary for command line arguments where the parameter list is available to the&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 51);&quot;&gt; main () method as a string array. The wrapper classes contain static methods ( such as &lt;span style=&quot;font-weight: bold; font-style: italic; color: rgb(0, 102, 0);&quot;&gt;parseInt()&lt;/span&gt; )&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 51);&quot;&gt; which convert a string to its own internal data type.&lt;br /&gt;&lt;br /&gt;These can be used with class names rather than creating a separate object. Be aware that these particular conversion methods throw a NumberFormatException and must be used in the context of a try and catch block combination.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/5104346047986940904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2010/02/string-objects-in-java.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/5104346047986940904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/5104346047986940904'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2010/02/string-objects-in-java.html' title='STRING OBJECTS in JAVA'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-6108228756498066606</id><published>2010-01-28T07:43:00.000-08:00</published><updated>2010-01-28T07:51:11.240-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java Coding"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Coding Examples"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Coding Samples"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="JDBC"/><title type='text'>JDBC Java Program Using JDBC TYPE 3 Driver</title><content type='html'>&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;A Sample Java Program Using JDBC TYPE 3 Driver. This driver is called as Network Protocol Pure Java Driver. This driver would only be the option when DB vendor supplied Type II &amp;amp; IV drivers are not available.&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;Software: www.idssoftware.com&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 0, 102); font-style: italic; font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;br /&gt;Server:&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;a) Install IDSServer software&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;b) d:\IDSServer\IDSS.exe&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;(The above said .exe runs as system startup service. IDSS.exe is a server socket program which runs on port number 12.)&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;c) Notice one more dir called&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;d:\IDSServer\classes&gt;&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;jdk11drv.jar, jdk13drv.jar, jdk14drv.jar&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 0, 102); font-weight: bold; font-style: italic;&quot;&gt;&lt;br /&gt;&lt;br /&gt;Client:&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;a) Client must demand server to download jdk14drv.jar file into client system and the same must be updated in&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt; CLASSPATH&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;[Note: Software installation is not required]&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;PATH: (only server)&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;d:\IDSServer&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;CLASSPATH (server &amp;amp; client)&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;d:\IDSServer\classes\jdk14drv.jar&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 0, 102); font-weight: bold; font-style: italic;&quot;&gt;&lt;br /&gt;&lt;br /&gt;Arch:&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;Driver: ids.driver.IDSDriver&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;URL: jdbc:ids://abc:12/conn?dsn=&#39;oracleSysDSN&#39;&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 0, 102); font-weight: bold; font-style: italic;&quot;&gt;&lt;br /&gt;&lt;br /&gt;Procedure creation&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;c:&gt; sqlplus scott/tiger&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; cle scr&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;sql&gt; create or replace procedure emp_sal_proc(eno IN number, sal1 OUT number) IS&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;BEGIN&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;SELECT sal INTO sal1 FROM emp WHERE empno=eno;&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;END;&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 0, 102); font-weight: bold; font-style: italic;&quot;&gt;&lt;br /&gt;&lt;br /&gt;// Java&lt;/span&gt;&lt;span style=&quot;font-weight: bold; font-style: italic; color: rgb(0, 0, 102);&quot;&gt; Program&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;// ProcExecTest.java&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;import java.sql.*;&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;public class ProcExecTest&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;{&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;public static void main(String rags[]) throws Exception&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;{&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;Class.forName(&quot;ids.driver.IDSDriver&quot;);&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;Connection&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt; con=DriverManager.getConnection&lt;br /&gt;(&quot;jdbc:ids://abc:12/conn?dsn&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;=&#39;oracleSysDSN&#39;&quot;, &quot;scott&quot;, &quot;tiger&quot;);&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;CallableStatement cstmt=con.prepareCall(&quot;{call emp_sal_proc(?,?)}&quot;);&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;cstmt.setInt(1, Integer.parseInt(rags[0]));&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;cstmt.registerOutParameter(2, Types.DOUBLE);&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;cstmt.execute();&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;System.out.println(cstmt.getDouble(2));&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;cstmt.close();&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;con.close();&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;}// main()&lt;/span&gt;&lt;span style=&quot;font-family: trebuchet ms; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;}// class&lt;/span&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/6108228756498066606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2010/01/jdbc-java-program-using-jdbc-type-3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/6108228756498066606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/6108228756498066606'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2010/01/jdbc-java-program-using-jdbc-type-3.html' title='JDBC Java Program Using JDBC TYPE 3 Driver'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-5831376964140010384</id><published>2010-01-27T05:42:00.000-08:00</published><updated>2010-01-27T05:53:48.918-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hibernate"/><category scheme="http://www.blogger.com/atom/ns#" term="J2EE Technologies"/><title type='text'>Hibernate Meta Model</title><content type='html'>&lt;span style=&quot;color: rgb(0, 0, 102);font-family:trebuchet ms;&quot; &gt;The meta model is the model used by Hibernate core to perform its object relational mapping. The model includes information about tables, columns, classes, properties, components, values, collections etc. The API is in org.hibernate.mapping and its main entry point is the Configuration class, the same class that is used to build a session factory.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 102);font-family:trebuchet ms;&quot; &gt;The model represented by the Configuration class can be build in many ways. The following list the currently supported ones in Hibernate Tools.&lt;/span&gt;&lt;br /&gt;&lt;ul style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;li style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 102);font-family:trebuchet ms;&quot; &gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;A Core configuration uses Hibernate Core and supports reading hbm.xml files, requires a hibernate.cfg.xml. Named core in Eclipse and &amp;lt;configuration&amp;gt; in ant.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;A Annotation configuration uses Hibernate Annotations and supports hbm.xml and annotated classes, requires a hibernate.cfg.xml. Named annotations in Eclipse and &amp;lt;annotationconfiguration&amp;gt; in ant.&lt;/li&gt;&lt;li&gt;A JPA configuration uses a Hibernate EntityManager and supports hbm.xml and annotated classes requires that the project has a META-INF/persistence.xml in its classpath. Named JPA in Eclipse and &amp;lt;jpaconfiguration&amp;gt; in ant.&lt;/li&gt;&lt;li&gt;A JDBC configuration uses Hibernate Tools reverse engineering and reads its mappings via JDBC metadata + additional reverse engineering files (reveng.xml). Automatically used in Eclipse when doing reverse engineering from JDBC and named &amp;lt;jdbcconfiguration&amp;gt; in ant.&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;color: rgb(0, 0, 102);font-family:trebuchet ms;&quot; &gt;In most projects you will normally use only one of the Core, Annotation or JPA configuration and possibly the JDBC configuration if you are using the reverse engineering facilities of Hibernate Tools. The important thing to note is that no matter which Hibnerate Configuration type you are using Hibernate Tools supports them.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 102);font-family:trebuchet ms;&quot; &gt;The code generation is done based on the Configuration model no matter which type of configuration have been used to create the meta model, and thus the code generation is independent on the source of the meta model and represented via Exporters.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/5831376964140010384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2010/01/hibernate-meta-model.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/5831376964140010384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/5831376964140010384'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2010/01/hibernate-meta-model.html' title='Hibernate Meta Model'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-6213293793562287099</id><published>2009-11-09T06:48:00.000-08:00</published><updated>2009-11-09T06:59:30.708-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java Coding Examples"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Coding Samples"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Servlets"/><title type='text'>Servlet HttpSession Management</title><content type='html'>&lt;span style=&quot;font-weight: bold; font-style: italic; color: rgb(0, 0, 102);&quot;&gt;Session tracking&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 102);&quot;&gt; is a mechanism that is used to maintain state about a series of requests from the same user. Java Servlet technology provides an API for managing sessions and allows several mechanisms for tracking sessions. One of the best approach is by using &lt;span style=&quot;font-weight: bold;&quot;&gt;HttpSession&lt;/span&gt; object. HttpSession interface is defined in &quot;javax.servlet.http&quot; package and is used for the purpose of session tracking while working with servlets.  &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;br /&gt;&lt;br /&gt;we can access a session by calling the &lt;span style=&quot;font-weight: bold; font-style: italic;&quot;&gt;HttpServletRequest.getSession()&lt;/span&gt; or HttpServletRequest.getSession(boolean) method of a request object. This method will return the current session associated with this request or if the request does not have any session, it will create a new one.&lt;/span&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;A sample Program demonstrating the usage of &lt;span style=&quot;font-weight: bold;&quot;&gt;HttpSession &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;import java.io.*;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;import java.util.*;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;import javax.servlet.*;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;import javax.servlet.http.*;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;class HttpSessionEx extends HttpServlet {&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt; public void doGet(HttpServletRequest request, &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt; HttpServletResponse response)&lt;br /&gt; throws &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt; IOException, ServletException {&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;response.setContentType(&quot;text/html&quot;);&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;PrintWriter out = response.getWriter();&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;out.println( &quot;&amp;lt;HTML&amp;gt;&amp;lt;BODY&amp;gt;&quot; );&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;HttpSession &lt;span style=&quot;font-weight: bold;&quot;&gt;sess&lt;/span&gt; = request.getSession(true);&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;// &lt;span style=&quot;font-style: italic;&quot;&gt;HttpSession Methods&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;Date cd = new Date(sess.getCreationTime());&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;Date acd = new Date(sess.getLastAccessedTime());&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;out.println(&quot;Session ID &quot; + sess.getId());&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;out.println(&quot;Session was Created at: &quot; + cd);&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;out.println(&quot;Session was Last Accessed at: &quot; + acd);&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt; // getting the session item&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;Object &lt;span style=&quot;font-weight: bold;&quot;&gt;sessobj&lt;/span&gt; = sess.getAttribute( &quot;power&quot; );&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;out.println( &quot;&amp;lt;BR&amp;gt;&quot; + sessobj );&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt; // getting the contents of the session&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;Enumeration data = sess.getAttributeNames();&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;while( data.hasMoreElements() ) {&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;String value = (String) data.nextElement();&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;sessobj = sess.getAttribute(value);&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;out.println( &quot;&amp;lt;BR&amp;gt;&quot; + value + &quot; = &quot; + sessobj );&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;out.println( &quot;&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt;&quot; );&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&lt;br /&gt;        }&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/6213293793562287099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/11/servlet-httpsession-management.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/6213293793562287099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/6213293793562287099'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/11/servlet-httpsession-management.html' title='Servlet HttpSession Management'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-8100472950581129508</id><published>2009-11-06T06:22:00.000-08:00</published><updated>2009-11-06T06:30:11.775-08:00</updated><title type='text'>Hibernate Lazy Initialization</title><content type='html'>&lt;span style=&quot;font-weight: bold; font-style: italic; color: rgb(0, 51, 0);font-family:trebuchet ms;&quot; &gt;Lazy Initialization in Hibernate&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 102);font-family:trebuchet ms;&quot; &gt;&lt;br /&gt;&lt;br /&gt;Hibernate supports the feature of lazy initilasation for both entities and collections, which actually means is, the Hibernate engine loads only those objects that we are querying for and doesn&#39;t try to fetch other entities (that are associated with the entity we are querying) or collections.&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 102);font-family:trebuchet ms;&quot; &gt;&lt;br /&gt;&lt;br /&gt;Lazy initialization load the child objects while loading parent object. To getting this set the lazy false in mapping file or class.lazy false in class file and hibernate will load the child when parent is loaded from the database. by default lazy is true. Lazy loading means that any foreign key references that you have in your table will be loaded only when referred to by the application. Eager loading means everything will be loaded at once.&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 102);font-family:trebuchet ms;&quot; &gt;&lt;br /&gt;&lt;br /&gt;An attribute &#39;&lt;span style=&quot;font-weight: bold;&quot;&gt;lazy&lt;/span&gt;&#39; can be used to let Hibernate know if the associated entity or collection has to be lazily loaded or prefetched.&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 102);font-family:trebuchet ms;&quot; &gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 51, 0);&quot;&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 51, 0);&quot;&gt;&amp;lt;set name=&quot;Child&quot; lazy=&quot;false&quot; inverse=&quot;true&quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&amp;lt;key column=&quot;FOREIGN_KEY_COL&quot;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&amp;lt;one-to-many class=&quot;Parent&quot;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 51, 0);&quot;&gt;&lt;br /&gt;&amp;lt;/set&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 51, 0);&quot;&gt;&lt;/span&gt;This causes the collection to be eagerly fetched rather than doing a lazy fetch. If on the other hand, the attribute value of lazy is set to true, then hibernate will not make an attempt to fire the query for fetchingthe collection object until the request is made by the user. &lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/8100472950581129508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/11/hibernate-lazy-initialization.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/8100472950581129508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/8100472950581129508'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/11/hibernate-lazy-initialization.html' title='Hibernate Lazy Initialization'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-4935850359103761625</id><published>2009-11-04T06:33:00.000-08:00</published><updated>2009-11-04T06:40:55.333-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Core Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Coding Examples"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Coding Samples"/><title type='text'>Java Program to list the Contents of a Zip File</title><content type='html'>&lt;span style=&quot;font-family: trebuchet ms;font-size:100%;&quot; &gt;&lt;span style=&quot;font-weight: bold; font-style: italic; color: rgb(0, 51, 0);&quot;&gt;Java Sample program to list the contents of a zip file&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;br /&gt;&lt;br /&gt;In this program we need to get the entries of the zip file, since each file in a zip file is represented by an entry. In this program assume that the filename of the zip file is &#39;Test.zip&#39;. By calling the entries method of the ZipFile object we get an Enumeration back that can be used to loop through the entries of the file. We have to cast each element in the Enumeration to a ZipEntry.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;/span&gt;&lt;blockquote style=&quot;color: rgb(0, 51, 0);&quot;&gt;import java.util.zip.ZipFile;&lt;br /&gt;import java.util.zip.ZipEntry;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.util.Enumeration;&lt;br /&gt;&lt;br /&gt;public class ListZipFiles&lt;br /&gt; { &lt;br /&gt;    public void doListFiles()&lt;br /&gt;  {   &lt;br /&gt;        try&lt;br /&gt;   {&lt;br /&gt;            ZipFile zipFile = new ZipFile(&quot;Test.zip&quot;);&lt;br /&gt;            Enumeration zipEntries = zipFile.entries();&lt;br /&gt;&lt;br /&gt;            while (zipEntries.hasMoreElements())&lt;br /&gt;                   {&lt;br /&gt;            //Process the name, here we just print it out&lt;br /&gt;            System.out.println(((ZipEntry)zipEntries.nextElement()).getName());&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;            catch (IOException ex) {&lt;br /&gt;            ex.printStackTrace();&lt;br /&gt;        }  &lt;br /&gt;   }&lt;br /&gt;        // Command line arguments&lt;br /&gt;        public static void main(String[] args) {&lt;br /&gt;&lt;br /&gt;        new Main().doListFiles();   &lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/4935850359103761625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/11/java-program-to-list-contents-of-zip.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/4935850359103761625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/4935850359103761625'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/11/java-program-to-list-contents-of-zip.html' title='Java Program to list the Contents of a Zip File'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-2226631220814315881</id><published>2009-08-09T05:14:00.000-07:00</published><updated>2009-08-09T05:17:14.613-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="EJB"/><category scheme="http://www.blogger.com/atom/ns#" term="J2EE Technologies"/><title type='text'>EJB Home Interface &amp; Remote Interface</title><content type='html'>&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000066;&quot;&gt;&lt;b&gt;&lt;i&gt;EJB Home Interface&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102); &quot;&gt;The EJBHome object must implement the home interface.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102); &quot;&gt;This interface contains the methods used by the clients to create and remove the instances of the EJB.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102); &quot;&gt;The home interface is the client’s initial point of contact with your EJB components.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102); &quot;&gt;For the client to access the EJB , an instance of the EJB is created from one or more create() methods of the Home interface.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102); &quot;&gt;The ejbCreate() methods defined in the EJB must also be declared with matching signatures in the Home interface.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102); &quot;&gt;Returns a reference to a EJB by creating or finding it.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102); &quot;&gt;&lt;b&gt;&lt;i&gt;EJB Remote Interface&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102); &quot;&gt;The EJBObject class must implement the remote interface.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102); &quot;&gt;Once the client has used the home interface to gain access to EJB ,it uses this interface to invoke the business methods defined in the EJB class.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102); &quot;&gt;Clients can never get a reference to the EJBs class , only the EJBObject class.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102); &quot;&gt;The EJB container uses the remote interface for your bean to generate both the client-side stub and server-side proxy object that passes client calls to your EJB object.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/2226631220814315881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/08/ejb-home-interface-remote-interface.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/2226631220814315881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/2226631220814315881'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/08/ejb-home-interface-remote-interface.html' title='EJB Home Interface &amp; Remote Interface'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-1534434190203080573</id><published>2009-08-05T09:32:00.000-07:00</published><updated>2009-08-05T09:39:29.856-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="EJB"/><category scheme="http://www.blogger.com/atom/ns#" term="J2EE Technologies"/><title type='text'>Java Deployment Descriptor</title><content type='html'>&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102); &quot;&gt;The deployment descriptor objects are used to establish the runtime service settings for an enterprise bean&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102); &quot;&gt;This object defines the enviromental properties , along with the enterprise bean class name, the &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102); &quot;&gt;JNDI namespace,the home and remote interface name&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102); &quot;&gt;It has two types depending on the requirements,Session descriptor and entity descriptor&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102); &quot;&gt;The &lt;i&gt;deployment descripto&lt;/i&gt;r also contains detailed inforamtion about how the bean should execute regarding transaction and security&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102); &quot;&gt;The deployment descriptor provides the full description of all files in the ejb jar&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102); &quot;&gt;&lt;b&gt;Deployment descriptor&lt;/b&gt; is defined in a XML based format having some standard tags and attributes&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/1534434190203080573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/08/ejb-deployment-descriptor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/1534434190203080573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/1534434190203080573'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/08/ejb-deployment-descriptor.html' title='Java Deployment Descriptor'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-2430523997493800269</id><published>2009-07-28T11:39:00.000-07:00</published><updated>2009-07-28T11:40:55.911-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="EJB"/><category scheme="http://www.blogger.com/atom/ns#" term="J2EE Technologies"/><title type='text'>Entity Bean&#39;s Ready State &amp; Pooled State</title><content type='html'>&lt;span style=&quot;color: rgb(0, 0, 102); font-family: georgia;font-size:100%;&quot; &gt;The idea of the “Pooled State” is to allow a container to maintain a pool of entity beans that has been created, but has not been yet “synchronized” or assigned to an EJBObject. This mean that the instances do represent entity beans, but they can be used only for serving Home methods (create or findBy), since those methods do not relay on the specific values of the bean.&lt;br /&gt;&lt;br /&gt;All these instances are, in fact, exactly the same, so, they do not have meaningful state.  It can be looked at it this way&lt;br /&gt;&lt;br /&gt;If no client is using an entity bean of a particular type there is no need for caching it (the data is persisted in the database). Therefore, in such cases, the container will, after some time, move the entity bean from the “Ready State” to the “Pooled state” to save memory. Then, to save additional memory, the container may begin moving entity beans from the “Pooled State” to the “Does Not Exist State&quot;, because even though the bean’s cache has been cleared, the bean still takes up some memory just being in the “Pooled State&quot;.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/2430523997493800269/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/07/entity-beans-ready-state-pooled-state.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/2430523997493800269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/2430523997493800269'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/07/entity-beans-ready-state-pooled-state.html' title='Entity Bean&#39;s Ready State &amp; Pooled State'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-6599896161623295937</id><published>2009-07-26T21:37:00.000-07:00</published><updated>2009-07-28T09:33:16.758-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="J2EE Technologies"/><category scheme="http://www.blogger.com/atom/ns#" term="Struts"/><title type='text'>Struts 2</title><content type='html'>&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;Programming the abstract classes instead of interfaces is one of design problem of struts1 framework that has been resolved in the struts 2 framework&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;Most of the Struts 2 classes are based on interfaces and most of its core interfaces are HTTP independent&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;Unlike ActionForwards, Struts 2 Results provide flexibility to create multiple type of&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;outputs&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;In Struts 2 any java class with execute() method can be used as an Action class&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;ActionForms feature is no more known to the Struts 2 framework. Simple JavaBean flavored actions are used to put properties directly&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;Struts 2 Actions are HTTP independent and framework neutral. This enables to test struts applications very easily without resorting to mock objects&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;Java 5 annotations can be used as an alternative to XML and Java properties configuration&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;Struts 2 lets to customize the request handling per action, if desired. Struts 1 lets to customize the request processor per module&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;Struts 2 Actions are Spring-aware.Just need to add Spring beans&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 102);&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:medium;&quot;&gt;AJAX client side validation&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/6599896161623295937/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/07/struts2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/6599896161623295937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/6599896161623295937'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/07/struts2.html' title='Struts 2'/><author><name>Ashu</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>