<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="weebly" -->
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" >

<channel><title><![CDATA[J2EE World - Spring]]></title><link><![CDATA[http://j2eeworld.weebly.com/spring.html]]></link><description><![CDATA[Spring]]></description><pubDate>Wed, 18 Mar 2009 04:11:31 +0700</pubDate><generator>Weebly</generator><item><title><![CDATA[Spring-8]]></title><link><![CDATA[http://j2eeworld.weebly.com/3/post/2008/05/spring-8.html]]></link><comments><![CDATA[http://j2eeworld.weebly.com/3/post/2008/05/spring-8.html#comments]]></comments><pubDate>Thu, 15 May 2008 11:56:51 +0700</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">http://j2eeworld.weebly.com/3/post/2008/05/spring-8.html</guid><description><![CDATA[google_ad_client = "pub-2183173385114771";/* 468x15, created 5/15/08 */google_ad_slot = "3201537227";google_ad_width = 468;google_ad_height = 15;  What are the different points where weavi [...] ]]></description><content:encoded><![CDATA[<div ><div id="760214826012755" align="left" style="width: 100%; overflow-y: hidden;"><script type="text/javascript">google_ad_client = "pub-2183173385114771";/* 468x15, created 5/15/08 */google_ad_slot = "3201537227";google_ad_width = 468;google_ad_height = 15;</script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div></div><p  style=" text-align: left; ">  <strong style="color: rgb(230, 20, 20);">What are the different points where weaving can be applied? </strong><br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>Compile Time <br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>Classload Time <br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>Runtime <br /><br />  &nbsp;<br /><br />  <strong style="color: rgb(230, 20, 20);">What are the different advice types in spring? </strong><br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><strong>Around : </strong>Intercepts the calls to the target method <br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><strong>Before : </strong>This is called before the target method is invoked <br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><strong>After : </strong>This is called after the target method is returned <br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><strong>Throws : </strong>This is called when the target method throws and exception <br /><br />  &nbsp;<br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>Around : org.aopalliance.intercept.MethodInterceptor <br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>Before : org.springframework.aop.BeforeAdvice <br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>After : org.springframework.aop.AfterReturningAdvice <br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>Throws : org.springframework.aop.ThrowsAdvice <br /><br />  &nbsp;<br /><br />  <strong style="color: rgb(230, 20, 20);">What are the different types of AutoProxying? </strong><br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>BeanNameAutoProxyCreator <br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>DefaultAdvisorAutoProxyCreator <br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>Metadata autoproxying <br /><br />  &nbsp;<br />  <strong style="color: rgb(230, 23, 23);">What is the Exception class related to all the exceptions that are thrown in spring applications? </strong><br /><br />  <strong><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;;">DataAccessException</span></strong><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;;"> - org.springframework.dao.DataAccessException</span></p>]]></content:encoded></item><item><title><![CDATA[Spring-7]]></title><link><![CDATA[http://j2eeworld.weebly.com/3/post/2008/05/spring-7.html]]></link><comments><![CDATA[http://j2eeworld.weebly.com/3/post/2008/05/spring-7.html#comments]]></comments><pubDate>Thu, 15 May 2008 09:06:47 +0700</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">http://j2eeworld.weebly.com/3/post/2008/05/spring-7.html</guid><description><![CDATA[google_ad_client = "pub-2183173385114771";/* 468x15, created 5/15/08 */google_ad_slot = "3201537227";google_ad_width = 468;google_ad_height = 15;  What is a Pointcut?  [...] ]]></description><content:encoded><![CDATA[<div ><div id="996843169362351" align="left" style="width: 100%; overflow-y: hidden;"><script type="text/javascript">google_ad_client = "pub-2183173385114771";/* 468x15, created 5/15/08 */google_ad_slot = "3201537227";google_ad_width = 468;google_ad_height = 15;</script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div></div><p  style=" text-align: left; ">  <strong style="color: rgb(220, 19, 19);">What is a Pointcut? </strong><br /><br />  A pointcut is something that defines at what joinpoints an advice should be applied. Advices can be applied at any joinpoint that is supported by the AOP framework. These Pointcuts allow you to specify where the advice can be applied. <br /><br />  &nbsp;<br /><br />  <strong style="color: rgb(230, 20, 20);">What is an Introduction in AOP? </strong><br /><br />  An introduction allows the user to add new methods or attributes to an existing class. This can then be introduced to an existing class without having to change the structure of the class, but give them the new behavior and state. <br /><br />  &nbsp;<br /><br />  <strong style="color: rgb(230, 20, 20);">What is a Target? </strong><br /><br />  A target is the class that is being advised. The class can be a third party class or your own class to which you want to add your own custom behavior. By using the concepts of AOP, the target class is free to center on its major concern, unaware to any advice that is being applied. <br /><br />  &nbsp;<br /><br />  <strong><span style="color: rgb(230, 20, 20);">What is a Proxy?</span> </strong><br /><br />  A proxy is an object that is created after applying advice to a target object. When you think of client objects the target object and the proxy object are the same. <br /><br />  &nbsp;<br />  <strong style="color: rgb(230, 20, 20);">What is meant by Weaving? </strong><br /><br />  <span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;;">The process of applying aspects to a target object to create a new proxy object is called as Weaving. The aspects are woven into the target object at the specified joinpoints. </span></p>]]></content:encoded></item><item><title><![CDATA[Spring-6]]></title><link><![CDATA[http://j2eeworld.weebly.com/3/post/2008/05/spring-6.html]]></link><comments><![CDATA[http://j2eeworld.weebly.com/3/post/2008/05/spring-6.html#comments]]></comments><pubDate>Thu, 15 May 2008 09:05:19 +0700</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">http://j2eeworld.weebly.com/3/post/2008/05/spring-6.html</guid><description><![CDATA[google_ad_client = "pub-2183173385114771";/* 468x15, created 5/15/08 */google_ad_slot = "3201537227";google_ad_width = 468;google_ad_height = 15;   [...] ]]></description><content:encoded><![CDATA[<div ><div id="277061509658390" align="left" style="width: 100%; overflow-y: hidden;"><script type="text/javascript">google_ad_client = "pub-2183173385114771";/* 468x15, created 5/15/08 */google_ad_slot = "3201537227";google_ad_width = 468;google_ad_height = 15;</script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div></div><p  style=" text-align: left; ">  <strong style="color: rgb(220, 19, 19);"><span style="font-size: 10pt; font-family: Verdana;">What are different types of Autowire types? </span></strong><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">There are four different types by which autowiring can be done. </span><br /><br />  <strong><span style="font-size: 10pt; font-family: Verdana;">byName       </span></strong><br /><strong><span style="font-size: 10pt; font-family: Verdana;">byType       </span></strong><br /><strong><span style="font-size: 10pt; font-family: Verdana;">constructor       </span></strong><br /><strong><span style="font-size: 10pt; font-family: Verdana;">autodetect </span></strong><br />  <span style="font-size: 10pt; font-family: Verdana;">&nbsp;</span><br /><br />  <strong><span style="font-size: 10pt; font-family: Verdana;"><span style="color: rgb(220, 19, 19);">What are the different types of events related to Listeners?</span> </span></strong><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">There are a lot of events related to <strong>ApplicationContext</strong> of spring framework. All the events are subclasses of <strong>org.springframework.context.Application-Event</strong>. They are </span><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">ContextClosedEvent      &ndash; This is fired when the context is closed. </span><br /><span style="font-size: 10pt; font-family: Verdana;">ContextRefreshedEvent      &ndash; This is fired when the context is initialized or refreshed. </span><br /><span style="font-size: 10pt; font-family: Verdana;">RequestHandledEvent      &ndash; This is fired when the web context handles any request. </span><br />  <span style="font-size: 10pt; font-family: Verdana;">&nbsp;</span><br />  <strong style="color: rgb(220, 19, 19);"><span style="font-size: 10pt; font-family: Verdana;">What is an Aspect? </span></strong><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">An aspect is the cross-cutting functionality that you are implementing. It is the aspect of your application you are modularizing. An example of an aspect is logging. Logging is something that is required throughout an application. However, because applications tend to be broken down into layers based on functionality, reusing a logging module through inheritance does not make sense. However, you can create a logging aspect and apply it throughout your application using AOP. </span><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">&nbsp;</span><br />  <strong style="color: rgb(220, 19, 19);"><span style="font-size: 10pt; font-family: Verdana;">What is a Jointpoint? </span></strong><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">A joinpoint is a point in the execution of the application where an aspect can be plugged in. This point could be a method being called, an exception being thrown, or even a field being modified. These are the points where your aspect&rsquo;s code can be inserted into the normal flow of your application to add new behavior.</span><br /><br />  &nbsp;<br />  <strong style="color: rgb(220, 19, 19);">What is an Advice? </strong><br /><br />  <span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;;">Advice is the implementation of an aspect. It is something like telling your application of a new behavior. Generally, and advice is inserted into an application at joinpoints.</span></p>]]></content:encoded></item><item><title><![CDATA[Spring-5]]></title><link><![CDATA[http://j2eeworld.weebly.com/3/post/2008/05/spring-5.html]]></link><comments><![CDATA[http://j2eeworld.weebly.com/3/post/2008/05/spring-5.html#comments]]></comments><pubDate>Thu, 15 May 2008 09:04:02 +0700</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">http://j2eeworld.weebly.com/3/post/2008/05/spring-5.html</guid><description><![CDATA[google_ad_client = "pub-2183173385114771";/* 468x15, created 5/15/08 */google_ad_slot = "3201537227";google_ad_width = 468;google_ad_height = 15;   [...] ]]></description><content:encoded><![CDATA[<div ><div id="718106968360945" align="left" style="width: 100%; overflow-y: hidden;"><script type="text/javascript">google_ad_client = "pub-2183173385114771";/* 468x15, created 5/15/08 */google_ad_slot = "3201537227";google_ad_width = 468;google_ad_height = 15;</script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div></div><p  style=" text-align: left; ">  <strong style="color: rgb(218, 19, 19);"><span style="font-size: 10pt; font-family: Verdana;">What are the important beans lifecycle methods? </span></strong><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">There are two important bean lifecycle methods. The first one is setup which is called when the bean is loaded in to the container. The second method is the teardown method which is called when the bean is unloaded from the container. </span><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">&nbsp;</span><br /><br />  <strong><span style="font-size: 10pt; font-family: Verdana;"><span style="color: rgb(220, 19, 19);">How can you override beans default lifecycle methods?</span> </span></strong><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">The bean tag has two more important attributes with which you can define your own custom initialization and destroy methods. Here I have shown a small demonstration. Two new methods fooSetup and fooTeardown are to be added to your Foo class. </span><br /><br />          <span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&lt;beans&gt;</span><br /><br />   <span style="font-size: 10pt; font-family: Verdana;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><strong><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&lt;</span></strong><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">bean id="bar"   class="com.act.Foo" <strong>init-method=&rdquo;fooSetup&rdquo;   destroy=&rdquo;fooTeardown&rdquo;/&gt;</strong></span><br /><br />   <span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&lt;/beans&gt;</span><br /><br />        <strong style="color: rgb(220, 19, 19);"><span style="font-size: 10pt; font-family: Verdana;">What are Inner Beans? </span></strong><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">When wiring beans, if a bean element is embedded to a property tag directly, then that bean is said to the Inner Bean. The drawback of this bean is that it cannot be reused anywhere else. </span><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">&nbsp;</span><br /><br />  <strong style="color: rgb(220, 19, 19);"><span style="font-size: 10pt; font-family: Verdana;">What are the different types of bean injections? </span></strong><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">There are two types of bean injections. </span><br /><br />  <strong><span style="font-size: 10pt; font-family: Verdana;">By       setter </span></strong><br /><strong><span style="font-size: 10pt; font-family: Verdana;">By constructor </span></strong><br />  <span style="font-size: 10pt; font-family: Verdana;">&nbsp;</span><br />  <strong style="color: rgb(220, 19, 19);"><span style="font-size: 10pt; font-family: Verdana;">What is Auto wiring? </span></strong><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">You can wire the beans as you wish. But spring framework also does this work for you. It can auto wire the related beans together. All you have to do is just set the autowire attribute of bean tag to an autowire type. </span><br /><br />          <span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&lt;beans&gt;</span><br /><br />   <span style="font-size: 10pt; font-family: Verdana;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><strong><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&lt;</span></strong><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">bean id="bar"   class="com.act.Foo" <strong>Autowire=&rdquo;autowire type&rdquo;/&gt;</strong></span><br /><br />   <span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&lt;/beans&gt;</span><br /><br />        </p>]]></content:encoded></item><item><title><![CDATA[Spring-4]]></title><link><![CDATA[http://j2eeworld.weebly.com/3/post/2008/05/spring-4.html]]></link><comments><![CDATA[http://j2eeworld.weebly.com/3/post/2008/05/spring-4.html#comments]]></comments><pubDate>Thu, 15 May 2008 09:01:30 +0700</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">http://j2eeworld.weebly.com/3/post/2008/05/spring-4.html</guid><description><![CDATA[google_ad_client = "pub-2183173385114771";/* 468x15, created 5/15/08 */google_ad_slot = "3201537227";google_ad_width = 468;google_ad_height = 15;   [...] ]]></description><content:encoded><![CDATA[<div ><div id="114703063376008" align="left" style="width: 100%; overflow-y: hidden;"><script type="text/javascript">google_ad_client = "pub-2183173385114771";/* 468x15, created 5/15/08 */google_ad_slot = "3201537227";google_ad_width = 468;google_ad_height = 15;</script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div></div><p  style=" text-align: left; ">  <strong style="color: rgb(233, 18, 18);"><span style="font-size: 10pt; font-family: Verdana;">What are important ApplicationContext implementations in spring framework? </span></strong><br /><br />  <strong><span style="font-size: 10pt; font-family: Verdana;">ClassPathXmlApplicationContext</span></strong><span style="font-size: 10pt; font-family: Verdana;"> &ndash; This context loads a      context definition from an XML file located in the class path, treating      context definition files as class path resources. </span><br /><strong><span style="font-size: 10pt; font-family: Verdana;">FileSystemXmlApplicationContext      &ndash; </span></strong><span style="font-size: 10pt; font-family: Verdana;">This      context loads a context definition from an XML file in the filesystem. </span><br /><strong><span style="font-size: 10pt; font-family: Verdana;">XmlWebApplicationContext</span></strong><span style="font-size: 10pt; font-family: Verdana;"> &ndash; This context loads the      context definitions from an XML file contained within a web application. </span><br />  <span style="font-size: 10pt; font-family: Verdana;">&nbsp;</span><br /><br />  <strong style="color: rgb(233, 18, 18);"><span style="font-size: 10pt; font-family: Verdana;">Explain Bean lifecycle in Spring framework? </span></strong><br /><br />  <strong><span style="font-size: 10pt; font-family: Verdana;">1. </span></strong><span style="font-size: 10pt; font-family: Verdana;">The spring container finds the bean&rsquo;s definition from the XML file and instantiates the bean. </span><br /><br />  <strong><span style="font-size: 10pt; font-family: Verdana;">2. </span></strong><span style="font-size: 10pt; font-family: Verdana;">Using the dependency injection, spring populates all of the properties as specified in the bean definition. </span><br /><br />  <strong><span style="font-size: 10pt; font-family: Verdana;">3. </span></strong><span style="font-size: 10pt; font-family: Verdana;">If the bean implements the <strong>BeanNameAware</strong> interface, the factory calls <strong>setBeanName()</strong> passing the bean&rsquo;s ID. </span><br /><br />  <strong><span style="font-size: 10pt; font-family: Verdana;">4. </span></strong><span style="font-size: 10pt; font-family: Verdana;">If the bean implements the <strong>BeanFactoryAware</strong> interface, the factory calls <strong>setBeanFactory()</strong>, passing an instance of itself. </span><br /><br />  <strong><span style="font-size: 10pt; font-family: Verdana;">5. </span></strong><span style="font-size: 10pt; font-family: Verdana;">If there are any <strong>BeanPostProcessors</strong> associated with the bean, their <strong>post- ProcessBeforeInitialization()</strong> methods will be called. </span><br /><br />  <strong><span style="font-size: 10pt; font-family: Verdana;">6. </span></strong><span style="font-size: 10pt; font-family: Verdana;">If an init-method is specified for the bean, it will be called. </span><br /><br />  <strong><span style="font-size: 10pt; font-family: Verdana;">7. </span></strong><span style="font-size: 10pt; font-family: Verdana;">Finally, if there are any <strong>BeanPostProcessors</strong> associated with the bean, their <strong>postProcessAfterInitialization()</strong> methods will be called. </span><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">&nbsp;</span><br /><br />  <strong style="color: rgb(233, 23, 23);"><span style="font-size: 10pt; font-family: Verdana;">What is bean wiring? </span></strong><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">Combining together beans within the Spring container is known as bean wiring or wiring. When wiring beans, you should tell the container what beans are needed and how the container should use dependency injection to tie them together. </span><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">&nbsp;</span><br /><br />  <strong style="color: rgb(233, 23, 23);"><span style="font-size: 10pt; font-family: Verdana;">How do add a bean in spring application? </span></strong><br /><br />          <span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(23, 27, 233);">&lt;?xml version="1.0"   encoding="UTF-8"?&gt;</span><br />&nbsp;<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(23, 27, 233);">&lt;!DOCTYPE beans PUBLIC   "-//SPRING//DTD BEAN//EN"</span>   <span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(23, 27, 233);">"http://www.springframework.org/dtd/spring-beans.dtd"&gt;</span><br />&nbsp;<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(23, 27, 233);">&lt;beans&gt;</span>  <br /> <span style="font-size: 10pt; font-family: Verdana; color: rgb(23, 27, 233);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(23, 27, 233);">&lt;bean   id="foo" class="com.act.Foo"/&gt;</span><br />&nbsp;<span style="font-size: 10pt; font-family: Verdana; color: rgb(23, 27, 233);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   </span><strong style="color: rgb(23, 27, 233);"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&lt;bean   id="bar" class="com.act.Bar"/&gt;<br /></span></strong>&nbsp;<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(23, 27, 233);">&lt;/beans&gt;</span><br /><br />        <span style="font-size: 10pt; font-family: Verdana;">In the bean tag the id attribute specifies the bean name and the class attribute specifies the fully qualified class name. </span><br /><br />  &nbsp;<br /><br />&nbsp;  <br />  <strong style="color: rgb(218, 19, 19);"><span style="font-size: 10pt; font-family: Verdana;">What are singleton beans and how can you create prototype beans? </span></strong><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">Beans defined in spring framework are singleton beans. There is an attribute in bean tag named &lsquo;<strong>singleton</strong>&rsquo; if specified true then bean becomes singleton and if set to false then the bean becomes a prototype bean. By default it is set to true. So, all the beans in spring framework are by default singleton beans. </span><br /><br />          <span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(19, 49, 218);">&lt;beans&gt;</span>   <br /><span style="font-size: 10pt; font-family: Verdana; color: rgb(19, 49, 218);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><strong style="color: rgb(19, 49, 218);"><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&lt;</span></strong><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(19, 49, 218);">bean id="bar"   class="com.act.Foo" <strong>singleton=&rdquo;false&rdquo;/&gt;<br /></strong></span>&nbsp;<span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(19, 49, 218);">&lt;/beans&gt;</span><br /><br />        </p>]]></content:encoded></item><item><title><![CDATA[Spring-3]]></title><link><![CDATA[http://j2eeworld.weebly.com/3/post/2008/05/spring-3.html]]></link><comments><![CDATA[http://j2eeworld.weebly.com/3/post/2008/05/spring-3.html#comments]]></comments><pubDate>Thu, 15 May 2008 08:58:45 +0700</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">http://j2eeworld.weebly.com/3/post/2008/05/spring-3.html</guid><description><![CDATA[google_ad_client = "pub-2183173385114771";/* 468x15, created 5/15/08 */google_ad_slot = "3201537227";google_ad_width = 468;google_ad_height = 15;   [...] ]]></description><content:encoded><![CDATA[<div ><div id="343648658765528" align="left" style="width: 100%; overflow-y: hidden;"><script type="text/javascript">google_ad_client = "pub-2183173385114771";/* 468x15, created 5/15/08 */google_ad_slot = "3201537227";google_ad_width = 468;google_ad_height = 15;</script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div></div><p  style=" text-align: left; ">  <strong style="color: rgb(233, 18, 18);"><span style="font-size: 10pt; font-family: Verdana;">What is a BeanFactory? </span></strong><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">A BeanFactory is an implementation of the factory pattern that applies Inversion of Control to separate the application&rsquo;s configuration and dependencies from the actual application code. </span><br /><br /><span style="color: rgb(233, 18, 18);">&nbsp;  </span>  <strong style="color: rgb(233, 18, 18);"><span style="font-size: 10pt; font-family: Verdana;">What is AOP </span></strong><strong style="color: rgb(233, 18, 18);"><span style="font-size: 10pt; font-family: Verdana;">Alliance</span></strong><strong style="color: rgb(233, 18, 18);"><span style="font-size: 10pt; font-family: Verdana;">? </span></strong><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">AOP Alliance is an open-source project whose goal is to promote adoption of AOP </span><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">and interoperability among different AOP implementations by defining a common </span><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">set of interfaces and components. </span><br /><br />  <strong><span style="font-size: 10pt; font-family: Verdana;">&nbsp;</span></strong><br />  <strong style="color: rgb(233, 18, 18);"><span style="font-size: 10pt; font-family: Verdana;">What is Spring configuration file? </span></strong><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">Spring configuration file is an XML file. This file contains the classes information and describes how these classes are configured and introduced to each other. </span><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">&nbsp;</span><br />  <strong style="color: rgb(230, 18, 18);"><span style="font-size: 10pt; font-family: Verdana;">What does a simple spring application contain? </span></strong><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">These applications are like any Java application. They are made up of several classes, each performing a specific purpose within the application. But these classes are configured and introduced to each other through an XML file. This XML file describes how to configure the classes, known as the Spring configuration file. </span><br /><br />  <span style="font-size: 10pt; font-family: Verdana;">&nbsp;</span><br />  <strong style="color: rgb(230, 18, 18);"><span style="font-size: 10pt; font-family: Verdana;">What is XMLBeanFactory? </span></strong><br /><br />  <strong><span style="font-size: 10pt; font-family: Verdana;">BeanFactory</span></strong><span style="font-size: 10pt; font-family: Verdana;"> has many implementations in Spring. But one of the most useful one is <strong>org.springframework.beans.factory.xml.XmlBeanFactory</strong>, which loads its beans based on the definitions contained in an XML file. To create an <strong>XmlBeanFactory</strong>, pass a java.io.InputStream to the constructor. The <strong>InputStream</strong> will provide the XML to the factory. For example, the following code snippet uses a java.io.<strong>FileInputStream</strong> to provide a bean definition XML file to <strong>XmlBeanFactory</strong>. </span><br /><br />          <strong><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">BeanFactory</span></strong><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"> factory = new <strong>XmlBeanFactory</strong>(new   <strong>FileInputStream</strong>("beans.xml"));</span><br /><br />        <span style="font-size: 10pt; font-family: Verdana;">To retrieve the bean from a <strong>BeanFactory</strong>, call the <strong>getBean()</strong> method by passing the name of the bean you want to retrieve. </span><br /><br />          <span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">MyBean myBean = (MyBean)   factory.<strong>getBean</strong>("myBean");</span><br /><br />        </p>]]></content:encoded></item><item><title><![CDATA[Spring-2]]></title><link><![CDATA[http://j2eeworld.weebly.com/3/post/2008/05/spring-2.html]]></link><comments><![CDATA[http://j2eeworld.weebly.com/3/post/2008/05/spring-2.html#comments]]></comments><pubDate>Thu, 15 May 2008 08:56:46 +0700</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">http://j2eeworld.weebly.com/3/post/2008/05/spring-2.html</guid><description><![CDATA[google_ad_client = "pub-2183173385114771";/* 468x15, created 5/15/08 */google_ad_slot = "3201537227";google_ad_width = 468;google_ad_height = 15;  What is Application context module?  [...] ]]></description><content:encoded><![CDATA[<div ><div id="243948237518398" align="left" style="width: 100%; overflow-y: hidden;"><script type="text/javascript">google_ad_client = "pub-2183173385114771";/* 468x15, created 5/15/08 */google_ad_slot = "3201537227";google_ad_width = 468;google_ad_height = 15;</script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div></div><p  style=" text-align: left; ">  <strong style="color: rgb(233, 18, 18);">What is Application context module? </strong><br /><br />  The Application context module makes spring a framework. This module extends the concept of BeanFactory, providing support for internationalization (I18N) messages, application lifecycle events, and validation. This module also supplies many enterprise services such JNDI access, EJB integration, remoting, and scheduling. It also provides support to other framework. <br /><br />  <strong>&nbsp;</strong><br /><br />  <strong style="color: rgb(233, 18, 18);">What is AOP module? </strong><br /><br />  The AOP module is used for developing aspects for our Spring-enabled application. Much of the support has been provided by the AOP Alliance in order to ensure the interoperability between Spring and other AOP frameworks. This module also introduces metadata programming to Spring. Using Spring&rsquo;s metadata support, we will be able to add annotations to our source code that instruct Spring on where and how to apply aspects. <br /><br />  &nbsp;<br /><br />  <strong style="color: rgb(233, 18, 18);">What is JDBC abstraction and DAO module? </strong><br /><br />  Using this module we can keep up the database code clean and simple, and prevent problems that result from a failure to close database resources. A new layer of meaningful exceptions on top of the error messages given by several database servers is bought in this module. In addition, this module uses Spring&rsquo;s AOP module to provide transaction management services for objects in a Spring application. <br /><br />  <strong>&nbsp;</strong><br />  <strong style="color: rgb(233, 18, 18);">What are object/relational mapping integration module? </strong><br /><br />  Spring also supports for using of an object/relational mapping (ORM) tool over straight JDBC by providing the ORM module. Spring provide support to tie into several popular ORM frameworks, including Hibernate, JDO, and iBATIS SQL Maps. Spring&rsquo;s transaction management supports each of these ORM frameworks as well as JDBC. <br /><br />  <strong>&nbsp;</strong><br />  <strong style="color: rgb(233, 18, 18);">What is web module? </strong><br /><br />  <span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;;">This module is built on the application context module, providing a context that is appropriate for web-based applications. This module also contains support for several web-oriented tasks such as transparently handling multipart requests for file uploads and programmatic binding of request parameters to your business objects. It also contains integration support with Jakarta Struts.</span></p>]]></content:encoded></item><item><title><![CDATA[Spring-1]]></title><link><![CDATA[http://j2eeworld.weebly.com/3/post/2008/05/first-post.html]]></link><comments><![CDATA[http://j2eeworld.weebly.com/3/post/2008/05/first-post.html#comments]]></comments><pubDate>Thu, 15 May 2008 08:52:12 +0700</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">http://j2eeworld.weebly.com/3/post/2008/05/first-post.html</guid><description><![CDATA[google_ad_client = "pub-2183173385114771";/* 468x15, created 5/15/08 */google_ad_slot = "3201537227";google_ad_width = 468;google_ad_height = 15;  What is Spring?   Sp [...] ]]></description><content:encoded><![CDATA[<div ><div id="968233764507234" align="left" style="width: 100%; overflow-y: hidden;"><script type="text/javascript">google_ad_client = "pub-2183173385114771";/* 468x15, created 5/15/08 */google_ad_slot = "3201537227";google_ad_width = 468;google_ad_height = 15;</script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div></div><p  style=" text-align: left; ">  <strong style="color: rgb(233, 18, 18);">What is Spring? </strong><br /><br />  Spring is a lightweight inversion of control and aspect-oriented container framework. <br /><br /><strong style="color: rgb(233, 18, 18);">Explain Spring? </strong><br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><strong>Lightweight </strong>&ndash; spring is lightweight when it comes to size and transparency. The basic version of spring framework is around 1MB. And the processing overhead is also very negligible. <br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><strong>Inversion of control (IoC)</strong> &ndash; Loose coupling is achieved in spring using the technique Inversion of Control. The objects give their dependencies instead of creating or looking for dependent objects. <br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><strong>Aspect oriented (AOP)</strong> &ndash; Spring supports Aspect oriented programming and enables cohesive development by separating application business logic from systems services. <br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><strong>Container</strong> &ndash; Spring contains and manages the life cycle and configuration of application objects. <br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><strong>Framework</strong> - Spring provides most of the intra functionality leaving rest of the coding to the developer. <br /><strong>&nbsp;</strong><br /><br />  <strong style="color: rgb(233, 18, 18);">What are the different modules in Spring framework? </strong><br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>The Core container module <br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>Application context module <br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>AOP module (Aspect Oriented Programming) <br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>JDBC abstraction and DAO module <br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>O/R mapping integration module (Object/Relational) <br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>Web module <br /><br />  <span style="font-size: 10pt; font-family: Symbol;"><span style="">&middot;<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span>MVC framework module <br /><br />&nbsp;  <br />  <strong style="color: rgb(233, 18, 18);">What is the Core container module? </strong><br /><br />  <span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;;">This module provides the fundamental functionality of the spring framework. In this module <strong>BeanFactory</strong> is the heart of any spring-based application. The entire framework was built on the top of this module. This module makes the spring container. </span></p>]]></content:encoded></item></channel></rss>
