<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-2154917220162051650</id><updated>2010-01-04T05:34:26.650-08:00</updated><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?orderby=updated'/><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;orderby=updated'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>103</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><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 Servlets'/><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'>Servlet HttpSession Management</title><content type='html'>&lt;span style="font-weight: bold; font-style: italic; color: rgb(0, 0, 102);"&gt;Session tracking&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);"&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="font-weight: bold;"&gt;HttpSession&lt;/span&gt; object. HttpSession interface is defined in "javax.servlet.http" package and is used for the purpose of session tracking while working with servlets.  &lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;&lt;br /&gt;&lt;br /&gt;we can access a session by calling the &lt;span style="font-weight: bold; font-style: italic;"&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="font-style: italic; color: rgb(0, 51, 0);"&gt;&lt;br /&gt;&lt;br /&gt;A sample Program demonstrating the usage of &lt;span style="font-weight: bold;"&gt;HttpSession &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;import java.io.*;&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;import java.util.*;&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;import javax.servlet.*;&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;import javax.servlet.http.*;&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;&lt;br /&gt;class HttpSessionEx extends HttpServlet {&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;&lt;br /&gt; public void doGet(HttpServletRequest request, &lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt; HttpServletResponse response)&lt;br /&gt; throws &lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt; IOException, ServletException {&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;response.setContentType("text/html");&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;PrintWriter out = response.getWriter();&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;out.println( "&amp;lt;HTML&amp;gt;&amp;lt;BODY&amp;gt;" );&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;&lt;br /&gt;HttpSession &lt;span style="font-weight: bold;"&gt;sess&lt;/span&gt; = request.getSession(true);&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;&lt;br /&gt;// &lt;span style="font-style: italic;"&gt;HttpSession Methods&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;&lt;br /&gt;Date cd = new Date(sess.getCreationTime());&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;Date acd = new Date(sess.getLastAccessedTime());&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;out.println("Session ID " + sess.getId());&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;out.println("Session was Created at: " + cd);&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;out.println("Session was Last Accessed at: " + acd);&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;&lt;br /&gt; // getting the session item&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;&lt;br /&gt;Object &lt;span style="font-weight: bold;"&gt;sessobj&lt;/span&gt; = sess.getAttribute( "power" );&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;out.println( "&amp;lt;BR&amp;gt;" + sessobj );&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;&lt;br /&gt; // getting the contents of the session&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;&lt;br /&gt;Enumeration data = sess.getAttributeNames();&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;&lt;br /&gt;while( data.hasMoreElements() ) {&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;&lt;br /&gt;String value = (String) data.nextElement();&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;sessobj = sess.getAttribute(value);&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;out.println( "&amp;lt;BR&amp;gt;" + value + " = " + sessobj );&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;out.println( "&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt;" );&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;&lt;br /&gt;        }&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-6213293793562287099?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&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='0 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>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</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="font-weight: bold; font-style: italic; color: rgb(0, 51, 0);font-family:trebuchet ms;" &gt;Lazy Initialization in Hibernate&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);font-family:trebuchet ms;" &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't try to fetch other entities (that are associated with the entity we are querying) or collections.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);font-family:trebuchet ms;" &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="color: rgb(0, 0, 102);font-family:trebuchet ms;" &gt;&lt;br /&gt;&lt;br /&gt;An attribute '&lt;span style="font-weight: bold;"&gt;lazy&lt;/span&gt;' 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="color: rgb(0, 0, 102);font-family:trebuchet ms;" &gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 51, 0);"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-weight: bold; color: rgb(0, 51, 0);"&gt;&amp;lt;set name="Child" lazy="false" inverse="true"&amp;gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 51, 0);"&gt;&lt;br /&gt;&amp;lt;key column="FOREIGN_KEY_COL"/&amp;gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 51, 0);"&gt;&lt;br /&gt;&amp;lt;one-to-many class="Parent"/&amp;gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 51, 0);"&gt;&lt;br /&gt;&amp;lt;/set&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-weight: bold; color: rgb(0, 51, 0);"&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;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-8100472950581129508?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&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>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>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="font-family: trebuchet ms;font-size:100%;" &gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(0, 51, 0);"&gt;Java Sample program to list the contents of a zip file&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);"&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 'Test.zip'. 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="color: rgb(0, 0, 102);"&gt;&lt;/span&gt;&lt;blockquote style="color: rgb(0, 51, 0);"&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("Test.zip");&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;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-4935850359103761625?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&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>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>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="Apple-style-span"  style="color:#000066;"&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="Apple-style-span" style="color: rgb(0, 0, 102); "&gt;The EJBHome object must implement the home interface.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102); "&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="Apple-style-span" style="color: rgb(0, 0, 102); "&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="Apple-style-span" style="color: rgb(0, 0, 102); "&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="Apple-style-span" style="color: rgb(0, 0, 102); "&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="Apple-style-span" style="color: rgb(0, 0, 102); "&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="Apple-style-span" style="color: rgb(0, 0, 102); "&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="Apple-style-span" style="color: rgb(0, 0, 102); "&gt;The EJBObject class must implement the remote interface.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102); "&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="Apple-style-span" style="color: rgb(0, 0, 102); "&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="Apple-style-span" style="color: rgb(0, 0, 102); "&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;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-2226631220814315881?l=java-j2ee-technologies.blogspot.com' alt='' /&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>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>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="Apple-style-span" style="color: rgb(0, 0, 102); "&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="Apple-style-span" style="color: rgb(0, 0, 102); "&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="Apple-style-span" style="color: rgb(0, 0, 102); "&gt;JNDI namespace,the home and remote interface name&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102); "&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="Apple-style-span" style="color: rgb(0, 0, 102); "&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="Apple-style-span" style="color: rgb(0, 0, 102); "&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="Apple-style-span" style="color: rgb(0, 0, 102); "&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;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-1534434190203080573?l=java-j2ee-technologies.blogspot.com' alt='' /&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>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>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's Ready State &amp; Pooled State</title><content type='html'>&lt;span style="color: rgb(0, 0, 102); font-family: georgia;font-size:100%;" &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", because even though the bean’s cache has been cleared, the bean still takes up some memory just being in the “Pooled State".&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-2430523997493800269?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&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&apos;s Ready State &amp; Pooled State'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>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="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&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="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&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="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&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="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;outputs&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&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="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&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="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&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="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&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="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&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="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&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="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;AJAX client side validation&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-6599896161623295937?l=java-j2ee-technologies.blogspot.com' alt='' /&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>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-6874819347486725263</id><published>2009-05-12T22:09:00.000-07:00</published><updated>2009-07-23T01:07:54.781-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><title type='text'>Ajax For Dummies eBook</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_xr15C8EyRxM/SgpXBk4uv3I/AAAAAAAAAEo/X_z3QgFa8aE/s1600-h/Ajax+For+Dummies.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 256px; height: 320px;" src="http://1.bp.blogspot.com/_xr15C8EyRxM/SgpXBk4uv3I/AAAAAAAAAEo/X_z3QgFa8aE/s320/Ajax+For+Dummies.gif" alt="" id="BLOGGER_PHOTO_ID_5335172393166880626" border="0" /&gt;&lt;/a&gt;&lt;span style="color: rgb(0, 0, 102); font-family: georgia;font-size:100%;" &gt;Ajax is short for "Asynchronous JavaScript" Even if you weren't intimidated before, that tidbit is probably enough to make you reach for the Excedrin. Just reach for Ajax For Dummies instead. With screen shots, actual code and explanations, and live Web sites where you can see Ajax applications doing their thing, it will have you using Ajax to create Web applications that look an act like desktop applications in no time. With Ajax, you can speed up and clean up your Web applications. Shoppers at your online store can fill their carts without waiting for multiple page refreshes. Searchers on your sites can get instant results on the same page.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102); font-family: georgia;font-size:100%;" &gt;Major Web players are already using Ajax to create a new generation of Web applications, including Google (Ajax is behind Google Maps, Google Suggest, and Google Groups), Amazon, and Yahoo.  Topics covered include creating JavaScript effects, styling with CSS, using the XMLHttpRequest object to fetch data, working with Ajax design patterns, harnessing Ajax toolkits, and server-side scripting with PHP and JSP.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;&lt;span style="font-family: georgia;font-size:100%;" &gt;Author: Steve, Ph.D. Holzner&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;&lt;/span&gt;&lt;b&gt;&lt;a href="http://www.ziddu.com/download.php?uid=aLOalpWraa6el5mtY%2FiblJStXqqgkZSmZQ%3D%3D1" target="_blank"&gt;&lt;b&gt;Download Ajax For Dummies&lt;/b&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-6874819347486725263?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/6874819347486725263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/05/ajax-for-dummies-ebook.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/6874819347486725263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/6874819347486725263'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/05/ajax-for-dummies-ebook.html' title='Ajax For Dummies eBook'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_xr15C8EyRxM/SgpXBk4uv3I/AAAAAAAAAEo/X_z3QgFa8aE/s72-c/Ajax+For+Dummies.gif' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-6412059097592324175</id><published>2009-07-08T21:48:00.000-07:00</published><updated>2009-07-23T01:07:54.780-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><title type='text'>Pragmatic Ajax: A Web 2.0 Primer</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xr15C8EyRxM/SlV23z1xrqI/AAAAAAAAAFs/-VTXJSt0JQ4/s1600-h/ajax.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 266px; height: 320px;" src="http://4.bp.blogspot.com/_xr15C8EyRxM/SlV23z1xrqI/AAAAAAAAAFs/-VTXJSt0JQ4/s320/ajax.jpg" alt="" id="BLOGGER_PHOTO_ID_5356318033007718050" border="0" /&gt;&lt;/a&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(0, 51, 0);"&gt;Pragmatic Ajax: A Web 2.0 Primer eBook&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Ajax turns static web pages into interactive applications. Now you can deploy rich-client applications to clients without sacrificing the easy deployment of web applications. But to many folks, Ajax seems difficult. That’s why we produced this book. As a Pragmatic guide, it strips away the mystery and shows you the easy way to make Ajax work for you.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Writing dynamic applications isn’t that hard. Folks are awed by Google Maps, but it isn’t rocket science (apart from the satellite pictures). As a special bonus, see how to implement your own Google Maps-like application using DHTML.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;We cover the the basics of DHTML, JavaScript, and the infamous XmlHttpRequest call. You’ll see how to add Ajax to existing programs, and design new applications to exploit the power of Web 2.0. Learn the three layers of Ajax framework, and when (and how) to use each. See how to create rich clients, use visual effects, add client-side validation, and handle forms. Write applications that degrade gracefully if clients don’t support JavaScript. And see how to integrate your Ajaxified clients into Java, .NET, and Ruby on Rails server frameworks.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Authors: &lt;span style="font-style: italic;"&gt;Justin Gehtland, Ben Galbraith, Dion Almaer&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold; color: rgb(0, 51, 0); font-style: italic;font-size:100%;" &gt;&lt;span class="Apple-style-span" style="border-collapse: separate; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:'Times New Roman';" &gt;&lt;span class="Apple-style-span" style="line-height: 19px;font-family:Arial;" &gt;&lt;a href="http://insa.pp.ru/bookz/Pragmatic%20Ajax%20-%20A%20Web%202.0%20Primer.pdf.gz" style="text-decoration: underline;"&gt;Download Pragmatic Ajax: A Web 2.0 Primer eBook&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-6412059097592324175?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/6412059097592324175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/07/pragmatic-ajax-web-20-primer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/6412059097592324175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/6412059097592324175'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/07/pragmatic-ajax-web-20-primer.html' title='Pragmatic Ajax: A Web 2.0 Primer'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_xr15C8EyRxM/SlV23z1xrqI/AAAAAAAAAFs/-VTXJSt0JQ4/s72-c/ajax.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-804212696204154456</id><published>2009-07-23T01:00:00.000-07:00</published><updated>2009-07-23T01:03:36.542-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='J2EE Technologies'/><category scheme='http://www.blogger.com/atom/ns#' term='Hibernate'/><title type='text'>Hibernate 3 Features</title><content type='html'>&lt;span style="color: rgb(0, 0, 102);"&gt;Hibernate 3’s “Hibernate for the Enterprise” focus has built on the success of Hibernate 2 and extended it with enterprise class functionality includes following additional features&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul style="color: rgb(0, 0, 102);"&gt;&lt;li&gt;Support for EJB 3.0 Annotations, Entity Manager, and Java Persistence API&lt;/li&gt;&lt;li&gt;ORM improvements that support virtualized filtering for temporal, historical, regional, and permissioned data&lt;/li&gt;&lt;li&gt;Single object to multi-table mapping, bulk update and delete by query, and the ability to override generated SQL with hand-written SQL&lt;/li&gt;&lt;li&gt;JMX-enabled statistics reporting and monitoring through any JMX console&lt;/li&gt;&lt;li&gt;XML binding that enables data to be represented as XML and Java objects interchangeably&lt;/li&gt;&lt;li&gt;Event-driven design that enables custom event objects to be created and registered to handle auditing scenarios or cascaded behavior semantics&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-804212696204154456?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/804212696204154456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/07/hibernate-3-features.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/804212696204154456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/804212696204154456'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/07/hibernate-3-features.html' title='Hibernate 3 Features'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-5815794068885385070</id><published>2009-07-07T20:25:00.000-07:00</published><updated>2009-07-07T20:29:06.778-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 Framework Tag Libraries</title><content type='html'>&lt;span style="color: rgb(0, 0, 102);font-size:100%;" &gt;The Struts framework includes custom JSP tag libraries that you can use to create JSP pages that work with the rest of the Struts framework objects in your web application&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(0, 51, 0);"&gt;Struts HTML Tags&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Used to create Struts input forms, as well as other tags generally useful in the creation of HTML-based user interfaces.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(0, 51, 0);"&gt;Struts Bean Tags&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Useful in accessing beans and their properties, as well as defining new beans (based on these accesses) that are accessible to the remainder of the page via scripting variables and page scope attributes. Convenient mechanisms to create new beans based on the value of request cookies, headers, and parameters are also provided.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(0, 51, 0);"&gt;Struts Logic tag&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Useful in managing conditional generation of output text, looping over object collections for repetitive generation of output text, and application flow management.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(0, 51, 0);"&gt;Struts Nested&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Brings a nested context to the functionality of the Struts custom tag library. The purpose of this tag library is to enable the tags to be aware of the tags which surround them so they can correctly provide the nesting property reference to the Struts system.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0); font-weight: bold; font-style: italic;"&gt;Struts Tiles Tags&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Provides tiles tags. Tiles were previously called Components.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0); font-weight: bold; font-style: italic;"&gt;Struts Templates&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Three tags: put, get, and insert. A put tag moves content into request scope, which is retrieved by a get tag in a different JSP page. That template is included with the insert tag. Tags from the various Struts custom JSP tag libraries appear in JDeveloper on the Component Palette.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-5815794068885385070?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/5815794068885385070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/07/struts-framework-tag-libraries.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/5815794068885385070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/5815794068885385070'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/07/struts-framework-tag-libraries.html' title='Struts Framework Tag Libraries'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-4739973736114991975</id><published>2009-07-06T11:19:00.000-07:00</published><updated>2009-07-06T11:23:23.864-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 Method Types</title><content type='html'>&lt;span style="color: rgb(0, 0, 102);"&gt;&lt;span style="font-style: italic;"&gt;Entity bean&lt;/span&gt; is used to represent data in the database. It provides an object-oriented interface to data that would normally be accessed by the JDBC or some other back-end API. More than that, entity beans provide a component model that allows bean developers to focus their attention on the business logic of the bean, while the container takes care of managing persistence, transactions, and access control.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;An entity bean consists of 4 types of methods&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0); font-style: italic; font-weight: bold;"&gt;create() methods&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;To create a new instance of a CMP entity bean, and therefore insert data into the database, the create() method on the bean's home interface must be invoked. They look like this: EntityBeanClass ejbCreateXXX(parameters), where EntityBeanClass is an Entity Bean you are trying to instantiate, ejbCreateXXX(parameters) methods are used for creating Entity Bean instances according to the parameters specified and to some programmer-defined conditions. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;A bean's home interface may declare zero or more create() methods, each of which must have corresponding ejbCreate() and ejbPostCreate() methods in the bean class. These creation methods are linked at run time, so that when a create() method is invoked on the home interface, the container delegates the invocation to the corresponding ejbCreate() and ejbPostCreate() methods on the bean class. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0); font-weight: bold; font-style: italic;"&gt;finder() methods&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;The methods in the home interface that begin with "find" are called the find methods. These are used to query the EJB server for specific entity beans, based on the name of the method and arguments passed. Unfortunately, there is no standard query language defined for find methods, so each vendor will implement the find method differently. In CMP entity beans, the find methods are not implemented with matching methods in the bean class containers implement them when the bean is deployed in a vendor specific manner.&lt;br /&gt;&lt;br /&gt;The deployer will use vendor specific tools to tell the container how a particular find method should behave. Some vendors will use object-relational mapping tools to define the behavior of a find method while others will simply require the deployer to enter the appropriate SQL command.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;There are two basic kinds of find methods: single-entity and multi-entity. Single-entity find methods return a remote reference to the one specific entity bean that matches the find request. If no entity beans are found, the method throws an ObjectNotFoundException . Every entity bean must define the single-entity find method with the method name findByPrimaryKey(), which takes the bean's primary key type as an argument. The multi-entity find methods return a collection ( Enumeration or Collection type) of entities that match the find request. If no entities are found, the multi-entity find returns an empty collection.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0); font-weight: bold; font-style: italic;"&gt;remove() methods&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;These methods (you may have up to 2 remove methods, or don't have them at all) allow the client to physically remove Entity beans by specifying either Handle or a Primary Key for the Entity Bean. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0); font-weight: bold; font-style: italic;"&gt;home() methods&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;These methods are designed and implemented by a developer, and EJB specification doesn't have any requirements for them except the need to throw a RemoteException is each home method.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-4739973736114991975?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/4739973736114991975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/07/entity-bean-method-types.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/4739973736114991975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/4739973736114991975'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/07/entity-bean-method-types.html' title='Entity Bean Method Types'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-8313053645054698233</id><published>2009-07-05T19:12:00.000-07:00</published><updated>2009-07-05T19:16:52.912-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSP'/><category scheme='http://www.blogger.com/atom/ns#' term='Java Server Pages'/><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 and JSP</title><content type='html'>&lt;span style="color: rgb(0, 0, 102);"&gt;&lt;span style="font-weight: bold;"&gt;Struts&lt;/span&gt; makes it possible for &lt;span style="font-weight: bold;"&gt;JSP&lt;/span&gt; pages to externalize flow control, rather than specify physical links to various JSP pages within the JSP file, the JSP file contains a Struts-defined logical URI. The Struts URI defines a logical page request mapped&lt;/span&gt; &lt;span style="color: rgb(0, 0, 102);"&gt;to actions that may return different physical JSP pages depending on the context of the HTTP request.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Struts simplifies the development of the actual JSP file content by limiting it to user interface generation only. Java that would otherwise appear inside the JSP files appears in separate servlet action classes that the JSP page invokes at runtime.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Struts&lt;/span&gt; helps to separate the development roles into user interface designer (HTML or tag library user) and &lt;span style="font-style: italic;"&gt;JSP&lt;/span&gt; action-handler developer. For example, one person can write JSP page using only HTML or suitable tag libraries, while another person&lt;/span&gt; &lt;span style="color: rgb(0, 0, 102);"&gt;works independently to create the page action handling classes in Java.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;&lt;span style="font-style: italic;"&gt;Struts&lt;/span&gt; externalizes JSP actions that would otherwise appear inside all the JSP pages of your project into a single configuration file. This greatly simplifies debugging and promotes reuse. Struts consolidates String resources that would otherwise appear inside all the JSP pages of your project into a single file. This simplifies the task of localizing JSP applications.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-8313053645054698233?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/8313053645054698233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/07/struts-and-jsp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/8313053645054698233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/8313053645054698233'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/07/struts-and-jsp.html' title='Struts and JSP'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-503946814645213841</id><published>2009-07-01T19:28:00.000-07:00</published><updated>2009-07-01T19:47:37.852-07:00</updated><title type='text'>Storing Images into Database using JDBC</title><content type='html'>&lt;span style="color: rgb(0, 0, 102);"&gt;We can store images into database using BLOB data type and also managing SQL 92 data types (BLOB, CLOB and Ref) &lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;&lt;br /&gt;&lt;br /&gt;BLOB (Binary Large OBject)&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Used to store binary informations like images, audio files etc&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;For each byte one byte of memory will be allocated&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Size can vary up to 4GB for each entry&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;CLOB (Character LOB)&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Used to store character information like plain, word documents&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;For each character two bytes of memory is allocated&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Size up to 4GB&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(255, 102, 0); font-style: italic; font-weight: bold;"&gt;StoreImage.java&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;import java.sql.*;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;import java.io.*;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;public class StoreImage&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;{&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;br /&gt;public static void main(String rags[]) throws Exception&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;  {&lt;br /&gt;Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;Connection con=DriverManager.getConnection("jdbc:odbc:yourdsn","scott", "tiger");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;PreparedStatement pstmt=con.prepareStatement&lt;br /&gt;("insert into ImgStore values(?,?)");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;File f=new File("pic.jpg");&lt;br /&gt;FileInputStream fis=new FileInputStream(f);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;pstmt.setInt(1, 1);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;pstmt.setBinaryStream(2, fis, (int)f.length());&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;int i=pstmt.executeUpdate();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;System.out.println(i+" record inserted");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;pstmt.close();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;con.close();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;  }&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;sqlplus scott/tiger&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;cle scr&lt;/span&gt;&lt;br /&gt;--&lt;span style="color: rgb(0, 0, 102);"&gt;create table ImgStore (id number, image BLOB);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0); font-weight: bold; font-style: italic;"&gt;ImageRestore.java&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;import java.io.*;&lt;br /&gt;import java.sql.*;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;public class RestoreImage&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;public static void main(String rags[]) throws Exception&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;  {&lt;br /&gt;Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;Connection con=DriverManager.getConnection("jdbc:odbc:yourdsn","scott", "tiger");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;Statement stmt=con.createStatement();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;ResultSet rs=stmt.executeQuery("select * from temp");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;if(rs.next())&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;    {&lt;br /&gt;System.out.println(rs.getInt(1));&lt;br /&gt;InputStream in=rs.getBinaryStream(2);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;FileOutputStream fos=new FileOutputStream("pic1.jpg");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;int i=in.read();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;while(i!=-1)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;      {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;fos.write(i);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;i=in.read();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;       }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;fos.close();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;in.close();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;    }&lt;br /&gt;rs.close();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;stmt.close();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;con.close();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-503946814645213841?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/503946814645213841/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/07/storing-images-into-database-using-jdbc.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/503946814645213841'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/503946814645213841'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/07/storing-images-into-database-using-jdbc.html' title='Storing Images into Database using JDBC'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-5854658708501115075</id><published>2009-06-30T11:28:00.000-07:00</published><updated>2009-06-30T11:33:28.187-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 Action Classes</title><content type='html'>&lt;span style="font-family: georgia; color: rgb(0, 0, 102);"&gt;An Action Class performs a role of an adapter between the contents of an incoming HTTP request and the corresponding business logic that should be executed to process this request. Different kinds of actions in Struts are:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: georgia; color: rgb(0, 0, 102);"&gt;ForwardAction&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia; color: rgb(0, 0, 102);"&gt;IncludeAction&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia; color: rgb(0, 0, 102);"&gt;DispatchAction&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia; color: rgb(0, 0, 102);"&gt;LookupDispatchAction&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: georgia; color: rgb(0, 0, 102);"&gt;SwitchAction&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family: georgia; color: rgb(0, 51, 0); font-weight: bold; font-style: italic;"&gt;DispatchAction in Struts&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia; color: rgb(0, 0, 102);"&gt;The DispatchAction class is used to group related actions into one class. Using this class, We can have a method for each logical action compared than a single execute method. The DispatchAction dispatches to one of the logical actions represented by the methods. It picks a method to invoke based on an incoming request parameter. The value of the incoming parameter is the name of the method that the DispatchAction will invoke.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia; color: rgb(0, 51, 0); font-weight: bold; font-style: italic;"&gt;Struts ForwardAction&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia; color: rgb(0, 0, 102);"&gt;The ForwardAction class is useful when you’re trying to integrate Struts into an existing application that uses Servlets to perform business logic functions. You can use this class to take advantage of the Struts controller and its functionality, without having to rewrite the existing Servlets. Use ForwardAction to forward a request to another resource in your application, such as a Servlet that already does business logic processing or even another JSP page. By using this predefined action, you don’t have to write your own Action class. You just have to set up the struts-configfile properly to use ForwardAction.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia; color: rgb(0, 51, 0); font-weight: bold; font-style: italic;"&gt;IncludeAction in Struts&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia; color: rgb(0, 0, 102);"&gt;The IncludeAction class is useful when you want to integrate Struts into an application that uses Servlets. Use the &lt;/span&gt;&lt;span style="font-family: georgia; color: rgb(0, 0, 102);"&gt;IncludeAction class to include another resource in the response to the request being processed.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: georgia; color: rgb(0, 51, 0); font-weight: bold; font-style: italic;"&gt;Struts LookupDispatchAction&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia; color: rgb(0, 0, 102);"&gt;The LookupDispatchAction is a subclass of DispatchAction. It does a reverse lookup on the resource bundle to get the key and then gets the method whose name is associated with the key into the Resource Bundle. LookupDispatchAction is useful if the method name in the Action is not driven by its name in the front end, but by the Locale independent key into the resource bundle. Since the key is always the same, the LookupDispatchAction shields your application from the side effects of I18N.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia; color: rgb(0, 51, 0); font-weight: bold; font-style: italic;"&gt;SwitchAction in Struts&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia; color: rgb(0, 0, 102);"&gt;The SwitchAction class provides a means to switch from a resource in one module to another resource in a different module. SwitchAction is useful only if you have multiple modules in your Struts application. The SwitchAction class can be used as is, without extending.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-5854658708501115075?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/5854658708501115075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/struts-action-classes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/5854658708501115075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/5854658708501115075'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/struts-action-classes.html' title='Struts Action Classes'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-8875103971401753182</id><published>2009-06-25T01:21:00.000-07:00</published><updated>2009-06-25T01:28:34.657-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) Entity Beans in brief</title><content type='html'>&lt;span style="color: rgb(0, 51, 0); font-weight: bold;"&gt;What is an Entity Bean? &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;An &lt;span style="font-style: italic;"&gt;Entity bean&lt;/span&gt; represents a business object in a persistent storage mechanism. An entity bean typically represents a table in a relational database and each instance represents a row in the table. Entity bean differs from session bean by persistence, shared access, relationship and primary key. &lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;There are two types of entity beans available.&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Container Managed Persistence (CMP) &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Bean Managed Persistence (BMP)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0); font-weight: bold; font-style: italic;"&gt;CMP / Container Managed Persistence&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;A  The term container-managed persistence means that the &lt;span style="font-weight: bold;"&gt;EJB&lt;/span&gt; container handles all database access required by the entity bean. The bean's code contains no database access (SQL) calls. As a result, the bean's code is not tied to a specific persistent storage mechanism (database). Because of this flexibility, even if you redeploy the same entity bean on different J2EE servers that use different databases, you won't need to modify or recompile the bean's code. So, your entity beans are more portable. &lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0); font-weight: bold; font-style: italic;"&gt;BMP / Bean Managed Persistence&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;A  Bean managed persistence (&lt;span style="font-weight: bold;"&gt;BMP&lt;/span&gt;)  occurs when the bean manages its persistence. Here the bean will handle all the database access. So the bean's code contains the necessary SQLs calls. So it is not much portable compared to &lt;span style="font-weight: bold;"&gt;CMP&lt;/span&gt;. Because when we are changing the database we need to rewrite the SQL for supporting the new database.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-8875103971401753182?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/8875103971401753182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/ejb-entity-beans-in-brief.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/8875103971401753182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/8875103971401753182'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/ejb-entity-beans-in-brief.html' title='(EJB) Entity Beans in brief'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-8756076108567059446</id><published>2009-06-23T20:47:00.000-07:00</published><updated>2009-06-23T20:50:27.380-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'>Stateless Session Beans</title><content type='html'>&lt;span style="color: rgb(0, 0, 102);"&gt;A  &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 102);"&gt;Stateless session beans&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);"&gt; are of equal value for all instances of the bean. Session bean will execute a client request and return a result without saving any client specific state. This means the container can assign any bean to any client, making it very scalable. Stateless session beans  does not retain client specific state from one method invocation to the next.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Bean instance can be reassigned to serve a method invocation from another client once current method invocation is done. Value of instance variables of a bean instance is not preserved between calls. Container transparently reuses bean instances to serve different clients. Load-balancing &amp;amp; Failover is easier since no state needs to be preserved. High scalability since a client call can be Served by any EJB server in a clustered architecture. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;A stateless session bean is an enterprise bean that provides a stateless service to the client. Conceptually, the business methods on a stateless session bean are similar to procedural applications or static methods; there is no instance state, so all the data needed to execute the method is provided by the method arguments. The stateless session bean is an EJB component that implements the&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(0, 0, 102);"&gt; javax.ejb.SessionBean&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);"&gt; interface and is deployed with the declarative attribute "stateless". &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 0, 102);"&gt;&lt;br /&gt;Stateless session beans&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);"&gt; are called "stateless" because they do not maintain conversational state specific to a client session. In other words, the instance fields in a stateless session bean do not maintain data relative to a client session. This makes stateless session beans very lightweight and fast, but also limits their behavior. Typically an application requires less number of stateless beans compared to stateful beans.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-8756076108567059446?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/8756076108567059446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/stateless-session-beans.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/8756076108567059446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/8756076108567059446'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/stateless-session-beans.html' title='Stateless Session Beans'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-3113592342577921582</id><published>2009-06-22T21:00:00.000-07:00</published><updated>2009-06-22T21:34:27.197-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'>Stateful Session Beans</title><content type='html'>&lt;span class="Apple-style-span"  style=" ;font-family:'Times New Roman';"&gt;&lt;div style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; width: auto; font: normal normal normal 100%/normal Georgia, serif; text-align: left; "&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;A  &lt;/span&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Stateful session bean&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; maintain the state of the conversation between the client and itself. When the client invokes a method on the bean the instance variables of the bean may contain a state but only for the duration of the invocation. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Stateful session bean&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; will retain client specific state (session state) from one method invocation to the next,  her bean instances are to be maintained for each client. A stateful session bean is an enterprise bean (EJB component) that acts as a server-side extension of the client that uses it. The stateful session bean is created by a client and will work for only that client until the client connection is dropped or the bean is explicitly removed. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;A stateful session bean is an enterprise bean (EJB component) that acts as a server-side extension of the client that uses it. The stateful session bean is created by a client and will work for only that client until the client connection is dropped or the bean is explicitly removed. Stateful session beans are usually developed to act as agents for the client, managing the interaction of other beans and performing work on behalf of the client application. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;The &lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;stateful session bean&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; is EJB component that implements the javax.ejb.SessionBean interface and is deployed with the declarative attribute "stateful". Stateful session beans are called "stateful" because they maintain a conversational state with the client. In other words, they have state or instance fields that can be initialized and changed by the client with each method invocation. The bean can use the conversational state as it process business methods invoked by the client.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-3113592342577921582?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/3113592342577921582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/stateful-session-beans.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/3113592342577921582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/3113592342577921582'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/stateful-session-beans.html' title='Stateful Session Beans'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-6857007453631494331</id><published>2009-06-21T20:05:00.000-07:00</published><updated>2009-06-21T20:11:10.128-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'/><title type='text'>Java Garbage Collection</title><content type='html'>&lt;span style="color: rgb(0, 0, 102);font-size:100%;" &gt;&lt;span style="font-family: georgia;"&gt;&lt;span style="font-style: italic; font-weight: bold; color: rgb(0, 51, 0);"&gt;Garbage Collection in Java&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Java has built-in facility to re-claim unwanted memory, this is known as &lt;span style="font-style: italic;"&gt;garbage collection&lt;/span&gt;. Garbage collector plays its role if there is any memory defficiency. Usually an object no longer referenced, for example when you assign with null, it could be ready for garbage collection. In java all objects are created in heap memory, whereas primitive type and object reference are placed in stack memory. Object class has defined finalize() method that is called by the garbage collector on an object when garbage collection determines that there are no more references to the object. &lt;/span&gt;&lt;span style="font-family: georgia;"&gt;&lt;br /&gt;&lt;br /&gt;The purpose of &lt;span style="font-weight: bold;"&gt;Java Garbage Collection&lt;/span&gt; is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused. A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used. Garbage collection is also called automatic memory management as JVM automatically removes the unused variables/objects (value is null) from the memory. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;Every class inherits finalize() method from java.lang.Object, the finalize() method is called by garbage collector when it determines no more references to the object exists. In Java, it is good idea to explicitly assign null into a variable when no more in use. In Java on calling System.gc() and Runtime.gc(), JVM tries to recycle the unused objects, but there is no guarantee when all the objects will garbage collected. &lt;span style="font-style: italic;"&gt;Java Garbage collection&lt;/span&gt; is an automatic process and can't be forced. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102); font-style: italic;font-size:100%;" &gt;&lt;span style="font-family: georgia;"&gt;Java Garbage Collection &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);font-size:100%;" &gt;&lt;span style="font-family: georgia;"&gt;&lt;span style="font-style: italic;"&gt;program &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;blockquote style="color: rgb(102, 0, 0);"&gt;&lt;span style="font-family: georgia;"&gt;class GC&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;    public static void main(String args[]){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;        MyObj obj = new MyObj();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;        obj=null;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;        System.gc();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;class MyObj&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;    public MyOb(){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;        System.out.println("Object created");&lt;/span&gt;&lt;span style="font-family: georgia;"&gt;&lt;br /&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;    protected void finalize()&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;        System.out.println("Garbage collector in action");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: georgia;"&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-family: georgia;"&gt;&lt;/span&gt;&lt;span style="font-family: georgia;"&gt;Garbage collection will start immediately upon request of System.gc(). Garbage collection does not guarantee that a program will not run out of memory. It is possible for programs to use up memory resources faster than they are garbage collected. It is also possible for programs to create objects that are not subject to garbage collection.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-6857007453631494331?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/6857007453631494331/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/java-garbage-collection.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/6857007453631494331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/6857007453631494331'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/java-garbage-collection.html' title='Java Garbage Collection'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-8046723253096063876</id><published>2009-06-19T18:50:00.000-07:00</published><updated>2009-06-19T19:03:40.573-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='J2EE Technologies'/><category scheme='http://www.blogger.com/atom/ns#' term='Internationalization'/><category scheme='http://www.blogger.com/atom/ns#' term='Java Coding Samples'/><title type='text'>Java Internationalization (II8N)</title><content type='html'>&lt;span style="color: rgb(0, 51, 0); font-weight: bold; font-style: italic;"&gt;Internationalization (I18N) in Java&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Java Internationalization (I18N) is the process of designing an application so that it can be adapted to different languages and regions, without requiring engineering changes. This model is to support many languages but only two of them, English (ASCII)&lt;/span&gt; &lt;span style="color: rgb(0, 0, 102);"&gt;and another one, at the same time. One have to specify the 'another' language,usually by LANG environmental variable. The above I18N-L10N model can be regarded as a part of this I18N model. gettextization is categorized into I18N model.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;&lt;span style="font-weight: bold;"&gt;I18N&lt;/span&gt; is needed in the following places.&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Displaying characters for the end users' native languages.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Inputing characters for the end users' native languages.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Handling files written in popular encodings [1] that are used for the end users' native languages.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Using characters from the end users' native languages for file names and other items.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Printing out characters from the end users' native languages.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Displaying messages by the program in the end users' native languages.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Formatting input and output of numbers, dates, money, etc., in a way that obeys customs of the end users' native cultures.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Classifying and sorting characters, in a way that obey customs of the end users' native cultures.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Using typesetting and hyphenation rules appropriate for the end users' native languages.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Java Internationalization&lt;/span&gt; (I18N) can be done with some handy modifications in our existing application. We have to know the two Internationalization (I18N) components that are packaged with the Struts Framework. The first of these components, which is managed by the application Controller, is a Message class that references a resource bundle containing Locale-dependent strings.&lt;br /&gt;&lt;br /&gt;The second Internationalization (I18N) component is a JSP custom tag, &amp;lt;bean:message /&amp;gt; , Which is used in the View layer to present the actual strings managed by the Controller.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;&lt;span style="font-style: italic;"&gt;Java Internationalization &lt;/span&gt;(I18N) is a set of simple Java properties files. Each file contains a key/value pair for each message that you expect your application to present, in the language appropriate for the requesting client.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Locale objects are only identifiers. After defining a Locale, you pass it to other objects that perform useful tasks,&lt;/span&gt; &lt;span style="color: rgb(0, 0, 102);"&gt;such as formatting dates and numbers. These objects are called locale-sensitive, because their behavior varies according&lt;/span&gt; &lt;span style="color: rgb(0, 0, 102);"&gt;to Locale.&lt;/span&gt; &lt;span style="color: rgb(0, 0, 102);"&gt;A ResourceBundle is an example of a locale-sensitive object.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102); font-style: italic;"&gt;Internationalization Sample Program&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0);"&gt;&lt;/span&gt;&lt;blockquote style="color: rgb(0, 51, 0);"&gt;import java.util.*&lt;br /&gt;&lt;br /&gt;public class I18NCode&lt;br /&gt;{&lt;br /&gt; public static void main(String args{})&lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;    String language;&lt;br /&gt;    String country;&lt;br /&gt;&lt;br /&gt;    if (args.length != 2)&lt;br /&gt;   {&lt;br /&gt;&lt;br /&gt;    language = new String("en");  &lt;br /&gt;    country  = new String("US");&lt;br /&gt;&lt;br /&gt;    }else{  &lt;br /&gt;&lt;br /&gt;    language = new String(args[0]);  &lt;br /&gt;   country  = new String(ars[1]);  &lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    Locale currentLocale;&lt;br /&gt;    ResourseBundle messages;&lt;br /&gt;&lt;br /&gt;    currentLocale = new Locale(language, country);&lt;br /&gt;    messages = ResourseBundle.getBundle("MessagesBundle", currentLocale);&lt;br /&gt;&lt;br /&gt;    System.out.println(messages.getString("Hai");&lt;br /&gt;    System.out.println(messages.getString("How are");&lt;br /&gt;    System.out.println(messages.getString("You");&lt;br /&gt;&lt;br /&gt;}&lt;/blockquote&gt;&lt;span style="color: rgb(0, 0, 102); font-style: italic;"&gt;run this program in the following way:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;java I18NCode en US&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;&lt;br /&gt;(or) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;java I18NCode fr FR&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-8046723253096063876?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/8046723253096063876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/java-internationalization-ii8n.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/8046723253096063876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/8046723253096063876'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/java-internationalization-ii8n.html' title='Java Internationalization (II8N)'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-7796364613023448969</id><published>2009-06-18T05:21:00.000-07:00</published><updated>2009-06-18T05:45:53.717-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSP'/><category scheme='http://www.blogger.com/atom/ns#' term='Java Server Pages'/><title type='text'>JSP Tags</title><content type='html'>&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;&lt;span style="font-weight: bold; color: rgb(0, 51, 0); font-style: italic;"&gt;Tags in JSP&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;JSP&lt;/span&gt; is a serverside technology to make content generation a simple appear. A Java Server Page can contain Java program fragments that instantiate and execute Java classes, but these occur inside an HTML template file and are primarily used to generate dynamic content. &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt; Some of the &lt;span style="font-weight: bold;"&gt;JSP&lt;/span&gt; functionality can be achieved on the client, using JavaScript. The power of JSP is that it is server-based and provides a framework for Web application development.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;JSP contains the following tags&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul style="color: rgb(0, 51, 0); font-weight: bold;"&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:georgia;"&gt;Declaration tag&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:georgia;"&gt;Expression tag&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:georgia;"&gt;Directive Tag&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:georgia;"&gt;Scriptlet tag&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(0, 51, 0); font-weight: bold;font-family:georgia;" &gt;Declaration tag  ( &amp;lt;%! %&amp;gt; )&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;A &lt;span style="font-style: italic;"&gt;declaration tag&lt;/span&gt; declares one or more variables or methods for use later in the JSP source file. A declaration tag must contain at least one complete declarative statement. You can declare any number of variables or methods within one declaration tag, as long as they are separated by semicolons. The declaration tag must be valid in the scripting language used in the JSP file.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;This tag allows the developer to declare variables or methods. Before the declaration you must have&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;&amp;lt;%! At the end of the declaration, the developer must have %&amp;gt; Code placed in this tag must end in a semicolon ( ; ). Declarations do not generate output so are used with JSP expressions or scriptlets.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;blockquote style="color: rgb(0, 51, 0);"&gt;&lt;span style="font-family:georgia;"&gt;&amp;lt;%!&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;    private int counter = 0 ;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;    private String get Account ( int accountNo) ;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;    %&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0); font-weight: bold;font-family:georgia;" &gt;Expression tag ( &amp;lt;%= %&amp;gt;)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;An&lt;span style="font-style: italic;"&gt; expression tag &lt;/span&gt;contains a scripting language expression that is evaluated, converted to a String, and inserted where the expression appears in the JSP file. Because the value of an expression is converted to a String, you can use an expression within text in a JSP file.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;This tag allows the developer to embed any Java expression and is short for out.println(). A semicolon ( ; ) does not appear at the end of the code inside the tag. Example to show the current date and time&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;&lt;br /&gt;&lt;blockquote style="color: rgb(0, 51, 0);"&gt;Date : &amp;lt;%= new java.util.Date() %&amp;gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 51, 0); font-weight: bold;font-family:georgia;" &gt;Directive tag ( &amp;lt;%@ directive … %&amp;gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;A &lt;span style="font-style: italic;"&gt;JSP directive tag&lt;/span&gt; gives special information about the page to the JSP Engine.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;There are three main types of directives:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;page – processing information for this page.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;Include – files to be included.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;Tag library – tag library to be used in this page.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;Directives do not produce any visible output when the page is requested but change the way the JSP Engine processes the page.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 51, 0); font-weight: bold;font-family:georgia;" &gt;Scriptlet tag ( &amp;lt;% … %&amp;gt; )&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;A &lt;span style="font-style: italic;"&gt;scriptlet tag&lt;/span&gt; can contain any number of language statements, variable or method declarations, or expressions that are valid in the page scripting language. We can declare variables or methods to use later in the file. Write expressions valid in the page scripting language. Use any of the JSP implicit objects or any object declared with a tag. You must write plain text, HTML-encoded text, or other JSP tags outside the scriptlet. Scriptlets are executed at request time, when the JSP engine processes the client request.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;If the scriptlet produces output, the output is stored in the out object, from which you can display it. Between &amp;lt;% and %&amp;gt; tags, any valid Java code is called a Scriptlet. This code can access any variable or bean declared. &lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;For example, to print a variable.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;blockquote style="color: rgb(0, 51, 0);"&gt;&lt;span style="font-family:georgia;"&gt;&amp;lt;%&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;    String username = “visualbuilder” ;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;    out.println ( username ) ;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;    %&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="color: rgb(0, 0, 102);font-family:georgia;" &gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-7796364613023448969?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/7796364613023448969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/jsp-tags.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/7796364613023448969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/7796364613023448969'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/jsp-tags.html' title='JSP Tags'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-7094486833257522379</id><published>2009-06-17T10:41:00.000-07:00</published><updated>2009-06-17T10:48:32.244-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JDBC'/><title type='text'>JDBC Drivers Types</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;b&gt;&lt;i&gt;JDBC Drivers&lt;/i&gt;&lt;/b&gt; are set of classes and interfaces which implements JDBC specification. There are mainly four type of JDBC drivers registered under SUN.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);font-size:100%;" &gt;&lt;span class="Apple-style-span"  style="font-size:13;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 51, 0); font-style: italic; font-weight: bold;"&gt;Type 1 - JDBC-ODBC Bridge Driver &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 51, 0);font-size:100%;" &gt;&lt;span class="Apple-style-span"  style="font-size:13;"&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 51, 0); font-style: italic; font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102); font-style: normal; font-weight: normal;"&gt;Driver which converts &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102); font-weight: normal;"&gt;JDBC &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102); font-style: normal; font-weight: normal;"&gt;calls into ODBC calls and interact with the ODBC driver is called as DBC-ODBC Bridge Driver. A JDBC-ODBC bridge provides JDBC API access via one or more ODBC drivers, in many cases native database client code must be loaded on each client machine which uses this type of driver. Hence, this kind of driver is generally most appropriate when automatic installation and downloading of a Java technology application is not important. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);font-size:100%;" &gt;&lt;span class="Apple-style-span"  style="font-size:13;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 51, 0);"&gt;Type 2 - Native API Partly Java Driver&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 51, 0);font-size:100%;" &gt;&lt;span class="Apple-style-span"  style="font-size:13;"&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 51, 0);"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102); font-style: normal; font-weight: normal;"&gt;Driver which converts JDBC call into database specific native call is called as type 2 driver. A native-API partly Java technology-enabled driver converts JDBC calls into calls on the client API for Oracle, Sybase, Informix, DB2, or other DBMS. Note that, like the bridge driver, this style of driver requires that some binary code be loaded on each client machine. &lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);font-size:100%;" &gt;&lt;span class="Apple-style-span"  style="font-size:13;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 51, 0);"&gt;Type 3 - Network protocol Pure Java Driver&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 51, 0);font-size:100%;" &gt;&lt;span class="Apple-style-span"  style="font-size:13;"&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 51, 0);"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102); font-style: normal; font-weight: normal;"&gt;Driver which converts &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102); font-style: normal;"&gt;JDBC &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102); font-style: normal; font-weight: normal;"&gt;call into server specific newtwork call and interacts with the server driver is called as Network protocol Driver. A net-protocol fully Java technology-enabled driver translates JDBC API calls into a DBMS-independent net protocol which is then translated to a DBMS protocol by a server. This net server middleware is able to connect all of its Java technology-based clients to many different databases. The specific protocol used depends on the vendor. &lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);font-size:100%;" &gt;&lt;span class="Apple-style-span"  style="font-size:13;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;In general, this is the most flexible JDBC API alternative. It is likely that all vendors of this solution will provide products suitable for Intranet use. In order for these products to also support Internet access they must handle the additional requirements for security, access through firewalls, etc., that the Web imposes. Several vendors are adding JDBC technology-based drivers to their existing database middleware products. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);font-size:100%;" &gt;&lt;span class="Apple-style-span"  style="font-size:13;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 51, 0); font-style: italic; font-weight: bold;"&gt;Type 4 - Native Protocol pure Java Driver&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 51, 0);font-size:100%;" &gt;&lt;span class="Apple-style-span"  style="font-size:13;"&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102);"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 51, 0); font-style: italic; font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 102); font-style: normal; font-weight: normal;"&gt;Driver which converts JDBC call into database specific native call is called as type 4 driver. A native-protocol fully Java technology-enabled driver converts JDBC technology calls into the network protocol used by DBMS directly. This allows a direct call from the client machine to the DBMS server and is a practical solution for Intranet access. Since many of these protocols are proprietary the database vendors themselves will be the primary source for this style of driver. Several database vendors have these in progress.  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-7094486833257522379?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/7094486833257522379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/jdbc-drivers-types.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/7094486833257522379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/7094486833257522379'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/jdbc-drivers-types.html' title='JDBC Drivers Types'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-824048291048329976</id><published>2009-06-16T05:06:00.000-07:00</published><updated>2009-06-16T05:11:08.707-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 Session Beans</title><content type='html'>&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="color:#006600;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Session Beans in EJB&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;b&gt; &lt;span class="Apple-style-span"  style="color:#000066;"&gt;Session beans&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt; are Java components that run in either stand-alone EJB containers or EJB containers that are part of standard  Java Platform, Enterprise Edition (Java EE) application servers. A  &lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;Session bean&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt; represents a single client inside the J2EE server. To access the application deployed in the server the client invokes methods on the session bean. The session bean performs the task shielding the client from the complexity of the business logic. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;These Java components are typically used to model a particular user task or use case, such as entering customer information or implementing a process that maintains a conversation state with a client application. Session beans can hold the business logic for many types of applications, such as human resources, order entry, and expense reporting applications.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;Session bean components implement the javax.ejb.SessionBean interface. Session beans can act as agents modeling workflow or provide access to special transient business services. Session beans do not normally represent persistent business concepts. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;i&gt;Types of Session Beans:&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;There are two types of session beans, namely: Stateful and Stateless session beans.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;i&gt;&lt;b&gt;Stateful session beans&lt;/b&gt;&lt;/i&gt; maintain conversational state when used by a client. Conversational state is not written to a database, it’s state that is kept in memory while a client uses a session.Maintaining conversational state allows a client to carry on a conversation with an enterprise bean. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;b&gt;&lt;i&gt;Stateless session beans &lt;/i&gt;&lt;/b&gt;do not maintain any conversational state. Each method is completely independent and uses only data passed in its parameters.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:100%;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: 13px; "&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;A session bean corresponds to a client server session. The&lt;/span&gt;&lt;b&gt;&lt;i&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt; session bean&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt; is created when a client requests some query on the database and exists as long as the client server session exists.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-824048291048329976?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/824048291048329976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/ejb-session-beans.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/824048291048329976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/824048291048329976'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/ejb-session-beans.html' title='EJB Session Beans'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-725696266853303296</id><published>2009-06-15T07:05:00.000-07:00</published><updated>2009-06-15T07:22:53.646-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSP'/><title type='text'>Hybrid Server Pages beyond JSP</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span" style="white-space: pre; "&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;i&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#006600;"&gt;Hybrid Server Pages&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;i&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#006600;"&gt; beyond the Java Server Pages&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;JSP combined HTML and Java in one source text but did not go far enough. Hybrid Java Language (HJL) is the next step in the same direction. HJL supports code reuse in the form of widgets written in same Hybrid Java Pages. Generated Java code gets built into a natural pages and components framework wrapped around Servlet API.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Hybrid Java Language incorporates Java and HTML operators into a single formal grammar.We may consider the language as consisting of three parts – subset of Java, subset of HTML and all the rest. The latter serves for code factorization and reuse as well as for ‘gluing’ Java and HTML. Widgets are the units of code reuse.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;The Hybrid Java Pages code of an application is provided as a set of .page files (one per Web page) and a set of .widget files. A widget may define named attributes and/or named slots (or one anonymous slot). A slot is somewhat similar to the position between opening and closing a ‘library tag’. The code inHybrid Java Pages slots has Java context of the point of call of the widget, so widgets are transparent for Java context (same as HTML elements are by the way).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;The rest of the .widget file is just ARBITRARY Hybrid Java Pages code – no other programming support or configuration is necessary to define a widget.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Technology suggests a very natural framework that includes application, page and widget data persistent in the scope of HTTP session. Developer defines such data as members of ‘code-behind’ classes, which may contain handlers of those states called by the framework with a proper dispatching in case of widgets.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Compiler resolves the identifiers used in widgets and pages against Java definitions in Java blocks, definitions of widget attributes, in instances of widgets and page state classes. Widgets may send signals to parent and page.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: arial; border-collapse: collapse; "&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Source: &lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.hybridserverpages.com/" target="_blank"&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;http://www.hybridserverpages.&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#000066;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;wbr&gt;com/&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-725696266853303296?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/725696266853303296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/hybrid-java-language-beyond-jsp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/725696266853303296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/725696266853303296'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/hybrid-java-language-beyond-jsp.html' title='Hybrid Server Pages beyond JSP'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2154917220162051650.post-8795341580511618933</id><published>2009-06-14T10:23:00.000-07:00</published><updated>2009-06-14T10:30:35.299-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='J2EE Technologies'/><category scheme='http://www.blogger.com/atom/ns#' term='MVC Pattern'/><category scheme='http://www.blogger.com/atom/ns#' term='Struts'/><title type='text'>Struts Framework in Brief</title><content type='html'>&lt;span style="color: rgb(0, 0, 102);font-family:georgia;font-size:100%;"  &gt;&lt;span style="font-style: italic;"&gt;Jakarta Struts&lt;/span&gt; is open source implementation of MVC 2 (Model-View-Controller) pattern for the development of web based applications. Jakarta Struts is robust architecture and can be used for the development of application of any size.  &lt;span style="font-weight: bold;"&gt;Struts framework&lt;/span&gt; makes it much easier to design scalable, reliable Web applications with Java. Struts is a Web-based user interface framework also an open source framework. It is a matured and proven framework, which has been used in many J2EE projects.&lt;br /&gt;&lt;br /&gt;Struts framework was created by Craig R. McClanahan and donated to the Apache Software Foundation in 2000. The Project now has several committers, and many developers are contributing to overall to the framework.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Struts&lt;/span&gt; is a open source framework which make building of the web applications easier based on the java Servlet and JavaServer pages technologies. The core of the Struts framework is a flexible control layer based on standard technologies like Java Servlets, JavaBeans, ResourceBundles, and XML, as well as various Jakarta Commons packages. Struts encourages application architectures based on the Model 2 approach (MVC 2), a variation of the classic &lt;span style="font-weight: bold; font-style: italic;"&gt;Model-View-Controller&lt;/span&gt; (MVC) design paradigm.&lt;br /&gt;&lt;br /&gt;Struts frames work is based on three components.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(0, 102, 0);"&gt;Model:&lt;/span&gt; A model represents an application’s data and contains the busuiness logic for accessing and manipulating that data. Any data that is part of the persistent state of the application should reside in the model objects. The business objects update the application state. ActionForm bean represents the Model state at a session or request level, and not at a persistent level. Model services are accessed by the controller for either querying or effecting a change in the model state. The model notifies the view when a state change occurs in the model. The JSP file reads information from the ActionForm bean using JSP tags. Components like business logic /business processes and data are the part of model.&lt;br /&gt;&lt;br /&gt;The business logic updates the state of the model and helps control the flow of the application. With Struts this is done with an Action class as a thin wrapper to the actual business logic.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(0, 102, 0);"&gt;View:&lt;/span&gt; The view is responsible for rendering the state of the model. The presentation semantics are encapsulated within the view, therefore model data can be adapted for several different kinds of clients.The view modifies itself when a change in the model is communicated to the view. A view forwards user input to the controller.The view is simply a JSP file. There is no flow logic, no business logic, and no model information just tags. Tags are one of the things that make Struts unique compared to other frameworks like Velocity. HTML, JSP are the view components.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(0, 102, 0);"&gt;Controller:&lt;/span&gt; The controller is responsible for intercepting and translating user input into actions to be performed by the model. The controller is responsible for selecting the next view based on user input and the outcome of model operations.The Controller receives the request from the browser, and makes the decision where to send the request. With Struts, the Controller is a command design pattern implemented as a servlet. The struts-config.xml file configures the Controller. Action Servlet of Struts is part of Controller components which works as front controller to handle all the requests.&lt;br /&gt;&lt;br /&gt;Struts provides its own Controller component and integrates with other technologies to provide the Model and the View. For the Model, Struts can interact with standard data access technologies, like JDBC and EJB, as well as most any third-party packages, like Hibernate, iBATIS, or Object Relational Bridge. For the View, Struts works well with JavaServer Pages, including JSTL and JSF, as well as Velocity Templates, XSLT, and other presentation systems.&lt;br /&gt;&lt;br /&gt;Struts is a set of cooperating classes, servlets, and JSP tags that make up a reusable MVC 2 design. This definition implies that Struts is a framework, rather than a library, but Struts also contains an extensive tag library and utility classes that work independently of the framework.&lt;br /&gt;&lt;br /&gt;Developing web application using struts frame work is fairly complex, but it eases things after it is setup. It encourages software development following the MVC design pattern. Many web applications are JSP-only or Servlets-only. With JSP and Servlets, Java code is embedded in the HTML code and the Java code calls println methods to generate the HTML code respectively. Both approaches have their advantages and drawbacks. Struts gathers their strengths to get the best of their association.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2154917220162051650-8795341580511618933?l=java-j2ee-technologies.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-j2ee-technologies.blogspot.com/feeds/8795341580511618933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/struts-framework-in-brief.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/8795341580511618933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2154917220162051650/posts/default/8795341580511618933'/><link rel='alternate' type='text/html' href='http://java-j2ee-technologies.blogspot.com/2009/06/struts-framework-in-brief.html' title='Struts Framework in Brief'/><author><name>Venkat</name><uri>http://www.blogger.com/profile/17060631417979405452</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='01468785294173125198'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>