<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4735327920528753836</id><updated>2026-08-16T03:08:55.444-07:00</updated><category term="ce"/><title type='text'>Abani</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-3144956218692062912</id><published>2014-07-16T09:35:00.000-07:00</published><updated>2017-03-01T15:26:44.687-08:00</updated><title type='text'>LDAP integration with AEM6 (OSGi Config way)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; color: #333333; line-height: 15.600000381469727px;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;In AEM 6, LDAP support comes with a new implementation that requires a different type of configuration than with previous versions.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; line-height: 15.600000381469727px;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; line-height: 15.600000381469727px;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;All LDAP configurations are now available as OSGi configurations. They can be configured via the Web Management console at:&lt;br /&gt;&lt;span class=&quot;monospaced&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; line-height: 15.600000381469727px;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span class=&quot;monospaced&quot;&gt;http://serveraddress:4502/system/console/configMgr&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 12px; line-height: 15.600000381469727px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; line-height: 15.600000381469727px;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;The required config classes are listed below.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;/div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;org.apache.jackrabbit.oak.security.authentication.ldap.impl.LdapIdentityProvider&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;org.apache.jackrabbit.oak.spi.security.authentication.external.impl.DefaultSyncHandler&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;org.apache.jackrabbit.oak.spi.security.authentication.external.impl.ExternalLoginModuleFactory.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif; line-height: 15.600000381469727px;&quot;&gt;The configs can be updated manually via OSGi console or via deployment. We can use the follow steps &amp;amp; config files to add/update an LDAP provider.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif; line-height: 15.600000381469727px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif; line-height: 15.600000381469727px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;/div&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif; line-height: 15.600000381469727px;&quot;&gt;Create OSGi config file of type &amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;sling:OsgiConfig&quot; &amp;amp; name it to&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif; line-height: 15.600000381469727px;&quot;&gt;&quot;org.apache.jackrabbit.oak.security.authentication.ldap.impl.LdapIdentityProvider.xml&quot;.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif; line-height: 15.600000381469727px;&quot;&gt;See here for reference.&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;&lt;script src=&quot;https://gist.github.com/abani-github/2062627f0dbf4e1eae5f.js&quot;&gt;&lt;/script&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 12px; line-height: 15.600000381469727px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 12px; line-height: 15.600000381469727px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 12px; line-height: 15.600000381469727px;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif; font-size: small;&quot;&gt;Similarly create two more config files &amp;amp; name them as below.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 12px; line-height: 15.600000381469727px;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;org.apache.jackrabbit.oak.spi.security.authentication.external.impl.DefaultSyncHandler.xml&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;&lt;script src=&quot;https://gist.github.com/abani-github/27420b598e3399ee63f0.js&quot;&gt;&lt;/script&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;org.apache.jackrabbit.oak.spi.security.authentication.external.impl.ExternalLoginModuleFactory.xml&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;&lt;script src=&quot;https://gist.github.com/abani-github/2222cc6b113b273e20f5.js&quot;&gt;&lt;/script&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;Now with this config files in place, do a config/content deployment &amp;amp; upon successful deployment your AEM instance is configured with the provided LDAP server.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;Tested with OpenDS 2.2 &amp;amp; AEM 6&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 15.600000381469727px;&quot;&gt;Please Note: You may need to restart your AEM instance once the configs are applied.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 12px; line-height: 15.600000381469727px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;


</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/3144956218692062912/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2014/07/ldap-integration-with-aem6-osgi-config.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/3144956218692062912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/3144956218692062912'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2014/07/ldap-integration-with-aem6-osgi-config.html' title='LDAP integration with AEM6 (OSGi Config way)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-3883478645527296290</id><published>2014-07-08T02:27:00.001-07:00</published><updated>2014-07-08T02:27:20.613-07:00</updated><title type='text'>Inject OSGi services in Sling models (Pojos) - Sling model way</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Create the injection point in the sling model class with @Source annotation &amp;amp; assign &quot;osgi-services&quot; as a value to the source annotation.&amp;nbsp;&lt;script src=&quot;https://gist.github.com/anonymous/d0c1b917c2a4a6327ac9.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
By this we can inject the below OSGi service in the Sling Model class.&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/anonymous/7c6297e412c88c5f981b.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/3883478645527296290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2014/07/inject-osgi-services-in-sling-models.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/3883478645527296290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/3883478645527296290'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2014/07/inject-osgi-services-in-sling-models.html' title='Inject OSGi services in Sling models (Pojos) - Sling model way'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-2616392626492268678</id><published>2014-07-08T02:17:00.001-07:00</published><updated>2014-07-08T02:18:54.732-07:00</updated><title type='text'>JCR content mapping with Sling Model</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
follow the easy steps to use sling model for JCR content mapping.&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Add sling model bundle dependency information in pom.xml &lt;script src=&quot;https://gist.github.com/abani-github/1d56a92da565bebf193c.js&quot;&gt;&lt;/script&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Add Sling-Model-Packages declaration in the instruction&amp;nbsp;&lt;script src=&quot;https://gist.github.com/abani-github/05e8f226b20f11489ecd.js&quot;&gt;&lt;/script&gt;&lt;/li&gt;
&lt;li&gt;Annotate pojo class with @Model annotation and use @Inject against the fields (with getters) &lt;script src=&quot;https://gist.github.com/abani-github/efeddd914dce4f64032c.js&quot;&gt;&lt;/script&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Now adapt this pojo with resource.adaptTo()&amp;nbsp;&lt;script src=&quot;https://gist.github.com/abani-github/0212212ec86a0597b377.js&quot;&gt;&lt;/script&gt;&lt;/li&gt;
&lt;li&gt;This Will map the below content structure easily without the bulgy or cluttered code. &amp;nbsp;&lt;script src=&quot;https://gist.github.com/abani-github/a73212caf9a3967ef847.js&quot;&gt;&lt;/script&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/2616392626492268678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2014/07/jcr-content-mapping-with-sling-model.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/2616392626492268678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/2616392626492268678'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2014/07/jcr-content-mapping-with-sling-model.html' title='JCR content mapping with Sling Model'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-4040195051101021993</id><published>2013-10-22T00:43:00.002-07:00</published><updated>2013-10-22T00:43:10.884-07:00</updated><title type='text'>Remote access of JCR repository in CQ5 | AEM</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Follow the below steps to access the CQ5 JCR repository (CRX) remotely.&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Construct the remote URL of your CQ instance.&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;e.g. &lt;span style=&quot;background-color: yellow;&quot;&gt;http://localhost:4502/crx/server&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;Where localhost &amp;nbsp;is the host where CQ is running &amp;amp; 4502 is port where CQ is listening to the requests.&lt;/li&gt;
&lt;li&gt;Get the repository by using the &lt;span style=&quot;background-color: yellow;&quot;&gt;JCRUtils &lt;/span&gt;class which is available in the jackrabbit-jcr-commons.jar library.&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;repository = JcrUtils.getRepository(&quot;http://localhost:4502/crx/server&quot;);&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;Create a SimpleCredential object by passing username, password entries.&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;SimpleCredentials creds = new SimpleCredentials(&quot;admin&quot;, &quot;admin&quot;.toCharArray());&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;Invoke the login method of repository object by passing the credential object &amp;amp; the workspace name.&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;Session session = repository.login(creds, &quot;crx.default&quot;);&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/ol&gt;
&lt;br /&gt;
A code snippet for the above can be found below&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/abani-github/de28ab07fd4ef09d1e7b.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/4040195051101021993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2013/10/remote-access-of-jcr-repository-in-cq5.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/4040195051101021993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/4040195051101021993'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2013/10/remote-access-of-jcr-repository-in-cq5.html' title='Remote access of JCR repository in CQ5 | AEM'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-1547294409136096254</id><published>2013-10-17T03:05:00.001-07:00</published><updated>2013-10-17T03:21:04.660-07:00</updated><title type='text'>Access different widgets inside the widget event listeners | CQ5 / AEM</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
To access widgets inside the event listeners of any widget, follow the below step.&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Get the &quot;dialog&quot; object first. &amp;nbsp;&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;var dailogObject =&amp;nbsp;this.findParentByType(&#39;dialog&#39;);&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;This will return the dialog object associated with your compoent dialog. Then look for the corresponding widget by invoking&amp;nbsp;&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;var titleField =&amp;nbsp;dailogObject&amp;nbsp;.getField(&#39;./jcr:title&#39;);&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;The above function looks for a widget by name &#39;&lt;span style=&quot;background-color: yellow;&quot;&gt;./jcr:title&lt;/span&gt;&#39; and returns the widget object associated.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
Use case scenario.&lt;/div&gt;
&lt;div&gt;
Let&#39;s create a component dialog with 2 widgets (Pathfield, TextField).&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;u&gt;use case 1:&lt;/u&gt; if author selects any link URL then the corresponding title of the page should be set into the TextField widget.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Below steps can be followed to achieve this.&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.diigo.com/item/p/qdcoeeezbredrpbsbzbbqaqqba/390d7a1c8fc766c5fc2863f0f60ead40&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;create a component dialog with two widgets.&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;One path field with name &quot;./path&quot; and xtype is &amp;nbsp;&quot;pathfield&quot;&lt;/li&gt;
&lt;li&gt;Text field with name &quot;./title&quot; and xtype is &quot;textfield&quot;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;Attach a listener to the path field. And add &quot;dialogclose&quot; event to the listener.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;The javascript function for the above event can be written as below.&lt;/li&gt;
&lt;li&gt;&lt;script src=&quot;https://gist.github.com/abani-github/d420b93e96dc74707505.js&quot;&gt;&lt;/script&gt;&lt;/li&gt;
&lt;li&gt;Sample screen shot&lt;/li&gt;
&lt;li&gt;&lt;img border=&quot;0&quot; height=&quot;193&quot; src=&quot;https://www.diigo.com/item/p/qdcoeeezbredrpbsbzbbqaqqba/390d7a1c8fc766c5fc2863f0f60ead40&quot; width=&quot;320&quot; /&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/1547294409136096254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2013/10/access-different-widgets-inside-widget.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/1547294409136096254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/1547294409136096254'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2013/10/access-different-widgets-inside-widget.html' title='Access different widgets inside the widget event listeners | CQ5 / AEM'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-275139161374035974</id><published>2013-10-17T02:06:00.000-07:00</published><updated>2013-10-17T02:06:26.242-07:00</updated><title type='text'>Attach listeners to widgets in CQ5 / AEM</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Follow the below steps to create or attach listeners (javascript event listeners) to any widget in CQ5 / AEM.&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Create a node by name &quot;listeners&quot; of type &quot;nt:unstructured&quot;&lt;/li&gt;
&lt;li&gt;Find out the events which can be attached to a widget. You can find the list of events from the CQ Widget API documentation. &lt;a href=&quot;http://dev.day.com/docs/en/cq/current/widgets-api/index.html&quot; target=&quot;_blank&quot;&gt;Click here&lt;/a&gt; to visit.&lt;/li&gt;
&lt;li&gt;e.g. The &quot;pathfield&quot; widget has got one event called &quot;dialogclose&quot;. This event is fired when user selects any link from the browse field &amp;amp; clicks OK.&lt;/li&gt;
&lt;li&gt;To attach this add one property by name &quot;dialogclose&quot; to the listeners node. The value should be any javascript function call.&amp;nbsp;&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;e.g. &lt;span style=&quot;background-color: #ffe599;&quot;&gt;function(){ console.log(&quot;You have selected a link in path field&quot;); }&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;Please see below &amp;nbsp;image for reference.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;a href=&quot;https://www.diigo.com/item/p/qdcoeeezbredqreobzbbqapbac/c9f0667aa4fb8eb19b2a2aad19c1b4d8&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;36&quot; src=&quot;https://www.diigo.com/item/p/qdcoeeezbredqreobzbbqapbac/c9f0667aa4fb8eb19b2a2aad19c1b4d8&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/abani-github/b19575234404a92e9838.js&quot;&gt;&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/275139161374035974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2013/10/attach-listeners-to-widgets-in-cq5-aem.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/275139161374035974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/275139161374035974'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2013/10/attach-listeners-to-widgets-in-cq5-aem.html' title='Attach listeners to widgets in CQ5 / AEM'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-8813253649160264759</id><published>2013-10-15T02:23:00.001-07:00</published><updated>2013-10-15T02:24:52.343-07:00</updated><title type='text'>Edit the Bottom tool bar of SmartImage widget in CQ5 / AEM</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Modify the below properties to remove/edit the tool bar (appears on the bottom) of the HTML5 smart image &lt;a href=&quot;http://dev.day.com/docs/en/cq/current/widgets-api/index.html&quot; target=&quot;_blank&quot;&gt;widget&lt;/a&gt;. (xtype:&amp;nbsp;&lt;span style=&quot;background-color: white; color: #333333; font-size: 12.727272033691406px;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS, sans-serif;&quot;&gt;html5smartimage&lt;/span&gt;&lt;/span&gt;) &lt;br /&gt;
&lt;br /&gt;
disableZoom=&quot;{Boolean}true&quot; This will disable the zoom functionality&lt;br /&gt;
mapParameter=&quot;0&quot; This will disable the Map feature&lt;br /&gt;
rotateParameter=&quot;0&quot; This will disable the image rotation capability&lt;br /&gt;
cropParameter=&quot;&quot; This will disable the image crop capability&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/abani-github/93c25415391eb96416cd.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/8813253649160264759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2013/10/edit-bottom-tool-bar-of-smartimage.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/8813253649160264759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/8813253649160264759'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2013/10/edit-bottom-tool-bar-of-smartimage.html' title='Edit the Bottom tool bar of SmartImage widget in CQ5 / AEM'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-6028271304375707801</id><published>2012-07-30T23:12:00.001-07:00</published><updated>2012-07-30T23:12:37.071-07:00</updated><title type='text'>Ajax with JSF 2</title><content type='html'>&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;344&quot; src=&quot;http://www.youtube.com/embed/Y8sS5OlzQvU?fs=1&quot; width=&quot;459&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/6028271304375707801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2012/07/ajax-with-jsf-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/6028271304375707801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/6028271304375707801'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2012/07/ajax-with-jsf-2.html' title='Ajax with JSF 2'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/Y8sS5OlzQvU/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-5350257994021408481</id><published>2012-07-16T11:00:00.001-07:00</published><updated>2012-07-16T11:00:49.823-07:00</updated><title type='text'>Clustering with Tomcat &amp; Session replication</title><content type='html'>&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;344&quot; src=&quot;http://www.youtube.com/embed/1Sdr42EMwEI?fs=1&quot; width=&quot;459&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/5350257994021408481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2012/07/clustering-with-tomcat-session.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/5350257994021408481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/5350257994021408481'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2012/07/clustering-with-tomcat-session.html' title='Clustering with Tomcat &amp; Session replication'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/1Sdr42EMwEI/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-5576678891619004799</id><published>2012-07-15T11:27:00.001-07:00</published><updated>2012-07-15T11:27:26.559-07:00</updated><title type='text'>Load Balancing, clustering with Apache &amp; Tomcat</title><content type='html'>&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;344&quot; src=&quot;http://www.youtube.com/embed/yNuuoQLw0tA?fs=1&quot; width=&quot;459&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/5576678891619004799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2012/07/load-balancing-clustering-with-apache.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/5576678891619004799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/5576678891619004799'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2012/07/load-balancing-clustering-with-apache.html' title='Load Balancing, clustering with Apache &amp; Tomcat'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/yNuuoQLw0tA/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-4681129628013570518</id><published>2012-05-09T01:50:00.003-07:00</published><updated>2012-05-09T20:36:22.708-07:00</updated><title type='text'>InterceptorBinding in 4 Steps for CDI/JEE6 applications</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Interceptors with interceptor binding in CDI/JEE6 enabled applications can be written &amp;amp; used by following the below simple steps.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Create a custom annotation with &lt;span style=&quot;color: #c27ba0;&quot;&gt;@InterceptorBinding&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;table id=&quot;src_table_0&quot; style=&quot;background-color: white; border-collapse: collapse; color: black; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; font-size: 12px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre;&quot;&gt;&lt;tbody style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;tr id=&quot;sl_svn29_14&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;
@Inherited&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn29_15&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;@InterceptorBinding&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn29_16&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;@Retention&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;RetentionPolicy&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;RUNTIME&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn29_17&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;@Target&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;ElementType&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;METHOD&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;ElementType&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;TYPE&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;})&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn29_18&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;@interface&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Logged&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn29_19&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn29_20&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Create an interceptor class &amp;amp; annotate the class with the custom annotation.&amp;nbsp;&lt;/span&gt;&lt;table id=&quot;src_table_0&quot; style=&quot;background-color: white; border-collapse: collapse; color: black; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; font-size: 12px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre;&quot;&gt;&lt;tbody style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;tr id=&quot;sl_svn29_19&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;
@Logged&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn29_20&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;@Interceptor&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn29_21&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;LoggingInterceptor&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;add a method to the interceptor. Annotate the method with &lt;span style=&quot;color: #c27ba0;&quot;&gt;@AroundInvoke&lt;/span&gt; annotation &amp;amp; pass &lt;span style=&quot;color: #c27ba0;&quot;&gt;InvocationContext &lt;/span&gt;object as a parameter.&lt;/span&gt;&lt;table id=&quot;src_table_0&quot; style=&quot;background-color: white; border-collapse: collapse; color: black; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; font-size: 12px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre;&quot;&gt;&lt;tbody style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;tr id=&quot;sl_svn29_27&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;
@AroundInvoke&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn29_28&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; logMethodEntry&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;InvocationContext&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; invocationContext&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Specify the interceptor in &lt;span style=&quot;color: blue;&quot;&gt;beans.xml&lt;/span&gt; file.&lt;/span&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyo4jlrumGrxNRF8Oy7AIEomXN39ENY7lsnHHcOhMZXlx3zP_iAcO4m8RABoQBAY_wqyuLir6xmIN_dRUazTTcMrAmOhJsPHxokra0csspCIw1KChYm-Lx0MsY5Xv9JHGd3pQO963pw4Y/s1600/interceptor.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;152&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyo4jlrumGrxNRF8Oy7AIEomXN39ENY7lsnHHcOhMZXlx3zP_iAcO4m8RABoQBAY_wqyuLir6xmIN_dRUazTTcMrAmOhJsPHxokra0csspCIw1KChYm-Lx0MsY5Xv9JHGd3pQO963pw4Y/s640/interceptor.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Now, the interceptor is ready to be used via the custom annotation. Use the custom annotation created earlier in the methods of the service classes those are exposed via CDI. (see below). This will make the CDI container to invoke the interceptor&#39;s intercepting method ( this is the method which is present in the Interceptor class &amp;amp; annotated with @AroundInvoke ) .&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;table id=&quot;src_table_0&quot; style=&quot;background-color: white; border-collapse: collapse; color: black; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; font-size: 12px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre;&quot;&gt;&lt;tbody style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;tr id=&quot;sl_svn29_25&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;@Logged&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn29_26&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; greet&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;final&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; greeter &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn29_27&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;Hallo &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; greeter &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot; from EJB&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn29_28&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}


&lt;span style=&quot;color: black; font-family: &#39;Trebuchet MS&#39;, sans-serif; font-size: small; text-align: left; white-space: normal;&quot;&gt;The complete code can be found &lt;a href=&quot;http://code.google.com/p/abani-office-projects/source/browse/trunk/NetBeans/Mock&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;. Please see the video below, where I have demonstrated uses of Interceptors.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;object width=&quot;320&quot; height=&quot;266&quot; class=&quot;BLOGGER-youtube-video&quot; classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&quot; data-thumbnail-src=&quot;http://2.gvt0.com/vi/taNki3_3NhY/0.jpg&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/taNki3_3NhY&amp;fs=1&amp;source=uds&quot; /&gt;
&lt;param name=&quot;bgcolor&quot; value=&quot;#FFFFFF&quot; /&gt;
&lt;embed width=&quot;320&quot; height=&quot;266&quot;  src=&quot;http://www.youtube.com/v/taNki3_3NhY&amp;fs=1&amp;source=uds&quot; type=&quot;application/x-shockwave-flash&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;
&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Trebuchet MS&#39;, sans-serif; font-size: small; text-align: left; white-space: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;
&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/4681129628013570518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2012/05/interceptorbinding-in-3-steps-for.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/4681129628013570518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/4681129628013570518'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2012/05/interceptorbinding-in-3-steps-for.html' title='InterceptorBinding in 4 Steps for CDI/JEE6 applications'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyo4jlrumGrxNRF8Oy7AIEomXN39ENY7lsnHHcOhMZXlx3zP_iAcO4m8RABoQBAY_wqyuLir6xmIN_dRUazTTcMrAmOhJsPHxokra0csspCIw1KChYm-Lx0MsY5Xv9JHGd3pQO963pw4Y/s72-c/interceptor.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-8196744840142472774</id><published>2012-05-03T22:47:00.001-07:00</published><updated>2012-05-03T23:24:17.449-07:00</updated><title type='text'>Asynchronous Methods in EJB</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: small;&quot;&gt;In this blog I will write about Asynchronous methods in EJBs. Will write an application where we will demonstrate how to access asynchronous methods in EJB.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: small;&quot;&gt;Asynchronous methods are new in EJB 3.1. This can be achieved by an annotation named @Asynchronous. The annotation can be applied to class level &amp;amp; method level as well. See the code snippet below.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table id=&quot;src_table_0&quot; style=&quot;background-color: white; border-collapse: collapse; color: black; font-family: monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; font-size: 12px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre;&quot;&gt;&lt;tbody style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;tr id=&quot;sl_svn28_19&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;@Stateless&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn28_20&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;@LocalBean&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn28_21&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;@Asynchronous &lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn28_22&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;ServicesBean&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;table id=&quot;src_table_0&quot; style=&quot;background-color: white; border-collapse: collapse; color: black; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; font-size: 12px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre;&quot;&gt;&lt;tbody style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;tr id=&quot;sl_svn28_25&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;@Asynchronous&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn28_26&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sendEmailAsync&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;final&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; recepient&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;;&quot;&gt;When we annotate a method in EJB with @Asynchronous&amp;nbsp;annotation, the EJB container executes the method in an asynchronous manner. The caller of the async method doesn&#39;t have to wait until the completion of the async method execution.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;table id=&quot;src_table_0&quot; style=&quot;background-color: white; border-collapse: collapse; color: black; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; font-size: 12px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre;&quot;&gt;&lt;tbody style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;tr id=&quot;sl_svn28_25&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;   @Asynchronous&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn28_26&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sendEmailAsync&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;final&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; recepient&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn28_27&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;//perform all activities related to&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn28_28&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;//the mailing actvity&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn28_29&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LOG&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;strat of sendEmailAsync&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn28_30&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;/*&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn28_31&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; below code snippet is to show case&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn28_32&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a long running process. Don&#39;t use&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn28_33&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; it in real time &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn28_34&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; */&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn28_35&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn28_36&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Thread&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;sleep&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;4000l&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn28_37&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;InterruptedException&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ex&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn28_38&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LOG&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Level&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;SEVERE&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ex&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn28_39&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn28_40&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LOG&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;info&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;end of sendEmailAsync&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn28_41&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;white-space: pre-wrap;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&lt;span style=&quot;color: #666600; white-space: pre-wrap;&quot;&gt;}

&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: small; text-align: left; white-space: normal;&quot;&gt;If we observe the above code block, the complete execution of the block will take minimum of 4 seconds&lt;br /&gt;&amp;nbsp;&lt;i&gt;&lt;span style=&quot;color: red;&quot;&gt;(For demonstration purpose I have used Thead.sleep(), please don&#39;t use such code blocks)&lt;/span&gt;&lt;/i&gt;.&lt;br /&gt;&amp;nbsp;In normal scenarios if we invoke this method in synchronous way, then the caller has to wait for&lt;br /&gt;minimum of 4 seconds.Which will impact heavily on the performance of whole application.&lt;br /&gt;&lt;br /&gt;Through the asynchronous capability of EJBs, we can avoid &amp;nbsp;this problems.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;pun&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: small; text-align: left; white-space: normal;&quot;&gt;&lt;b&gt;&lt;u&gt;Handling Asynchronous method Responses:&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: small;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;If the async method returns some value or object, then the value/object needs to be sent&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: small;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;through java.util.concurrent.Future. Please see the code below.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: small;&quot;&gt;&lt;span style=&quot;background-color: #cfe2f3; white-space: normal;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public &lt;/span&gt;&lt;span style=&quot;color: #a64d79;&quot;&gt;Future&lt;integer&gt;&lt;/integer&gt;&lt;/span&gt; &lt;b&gt;executeComputationAsync&lt;/b&gt;(&lt;span style=&quot;color: blue;&quot;&gt;final &lt;/span&gt;String employeeid){&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: small;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: small;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: small;&quot;&gt;new &lt;span style=&quot;color: #e06666;&quot;&gt;AsyncResult&lt;integer&gt;&lt;/integer&gt;&lt;/span&gt;&lt;span style=&quot;color: #ea9999;&quot;&gt;(&lt;/span&gt;100);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: small;&quot;&gt;&lt;span style=&quot;background-color: #cfe2f3; white-space: normal;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: small; white-space: normal;&quot;&gt;In the above method the return type is an Future object of type Integer.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: small; white-space: normal;&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: small; white-space: normal;&quot;&gt;he&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &#39;Trebuchet MS&#39;; font-size: small; white-space: normal;&quot;&gt;AsyncResult class is part of javax.ejb package &amp;amp; implement the Future interface.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: small;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;To get the resulting info from the Future object, we can invoke the &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;get()&lt;/span&gt;&lt;/b&gt; method of Future &lt;br /&gt;object. Please see the code below.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: small;&quot;&gt;&lt;span style=&quot;background-color: #cfe2f3; white-space: normal;&quot;&gt;&lt;span style=&quot;color: #e06666;&quot;&gt;Future&lt;integer&gt;&lt;/integer&gt;&lt;/span&gt; result = servicesBean.executeComputationAsync(&lt;span style=&quot;color: lime;&quot;&gt;&quot;213&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: small;&quot;&gt;&lt;span style=&quot;background-color: #cfe2f3; white-space: normal;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;int &lt;/span&gt;res = result.&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;get()&lt;/span&gt;&lt;/b&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: small;&quot;&gt;&lt;span style=&quot;background-color: #cfe2f3; white-space: normal;&quot;&gt;out.println(&lt;span style=&quot;color: lime;&quot;&gt;&quot;Async result is &quot;&lt;/span&gt; + res);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &#39;Trebuchet MS&#39;; font-size: small; white-space: normal;&quot;&gt;In the below video, I have demonstrated developing &amp;amp; accessing asynchronous methods in EJB.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/sHDvCnL-UrA?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;span class=&quot;pun&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: small; text-align: left; white-space: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;; font-size: small; text-align: left; white-space: normal;&quot;&gt;The complete working code can be found &lt;a href=&quot;http://code.google.com/p/abani-office-projects/source/browse/trunk/NetBeans/Mock&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;/span&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/8196744840142472774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2012/05/asynchronous-methods-in-ejb_03.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/8196744840142472774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/8196744840142472774'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2012/05/asynchronous-methods-in-ejb_03.html' title='Asynchronous Methods in EJB'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-2638842680201568591</id><published>2012-05-02T04:17:00.004-07:00</published><updated>2012-05-02T04:18:48.267-07:00</updated><title type='text'>Programmatic login with Servlet 3.0</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;In this blog I will describe you how we can achieve programmatic login with Servlet 3.0 compliant JEE server or container.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;The HttpServletRequest object in Servlet3 has got few new methods.&amp;nbsp; Few of them are listed below.&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;b&gt;login(username, password)&lt;/b&gt; - validate the user with specified username &amp;amp; password with the default realm &amp;amp; creates an authenticated subject in the current request.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;b&gt;logout()&lt;/b&gt; - logs out the current logged in user/subject&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;b&gt;getParts()&lt;/b&gt; - returns array of Multi-part objects available in the request.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;b&gt;getPart(field)&lt;/b&gt; - return the multi-part object associated with the field name&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;In our case, I will use login &amp;amp; logout methods respectively.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;The software used to illustrate the&amp;nbsp;programmatic login&amp;nbsp;are listed below.&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;NetBeans 7.1.1 ( IDE )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Tomcat 7.0.27 ( Server / Container )&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Ubuntu LTS 12.04 ( OS )&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;I have created a dynamic web application named LoginDemo &amp;amp; my target runtime server is tomcat7. The project&amp;nbsp;structure&amp;nbsp;looks like below.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVSIZsjigUNJj3idZs98bDr1VwihjfPFZsimqfGjnMh1SYzHP3eN-ZufXvlkFeqQJI2jGUBGrp0hMCxxCqgHTz1MjSsKSnMvSElj8ULm2hwcXIBmXKdy1srH_xK7C-leihz69klZLyV_k/s1600/1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;281&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVSIZsjigUNJj3idZs98bDr1VwihjfPFZsimqfGjnMh1SYzHP3eN-ZufXvlkFeqQJI2jGUBGrp0hMCxxCqgHTz1MjSsKSnMvSElj8ULm2hwcXIBmXKdy1srH_xK7C-leihz69klZLyV_k/s640/1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;below. I have created two jsp pages &lt;/span&gt;&lt;a href=&quot;http://code.google.com/p/abani-office-projects/source/browse/trunk/NetBeans/LoginDemo/web/index.jsp&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;index.jsp&lt;/a&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&amp;nbsp;&amp;amp; &lt;/span&gt;&lt;a href=&quot;http://code.google.com/p/abani-office-projects/source/browse/trunk/NetBeans/LoginDemo/web/myaccount.jsp&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;myaccount.jsp&lt;/a&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;. index.jsp has the login form where I will submit my action to a servlet, where I will perform my&amp;nbsp;authentication.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;To authenticate the user inputs I have created a servlet named &lt;a href=&quot;http://code.google.com/p/abani-office-projects/source/browse/trunk/NetBeans/LoginDemo/src/java/org/logindemo/servlets/AuthServlet.java&quot;&gt;AuthServlet &lt;/a&gt;in my application. The AuthServlet holds the business logic to perform login. Please see the code snippet below.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table id=&quot;src_table_0&quot; style=&quot;background-color: white; border-collapse: collapse; color: black; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; font-size: 12px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre;&quot;&gt;&lt;tbody style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;tr id=&quot;sl_svn23_45&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; processLogin&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;HttpServletRequest&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; request&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;HttpServletResponse&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; response&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;throws&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;IOException&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;ServletException&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_46&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; username &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; request&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;getParameter&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;uid&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_47&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; password &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; request&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;getParameter&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;pwd&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_48&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;RequestDispatcher&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; rd &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_49&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_50&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;request&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;login&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;username&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; password&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_51&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rd &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; request&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;getRequestDispatcher&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;myaccount.jsp&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_52&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_53&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Exception&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_54&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; request&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;setAttribute&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;msg&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;Unable to login with &lt;b&gt; &quot;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; username &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;&lt;/span&gt;&lt;/b&gt;&quot;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_55&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rd &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; request&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;getRequestDispatcher&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;login.jsp&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_56&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_57&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;forward&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; response&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_58&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;The request object has login() method. which takes 2 parameters. The first one is the username &amp;amp; second&amp;nbsp;parameter&amp;nbsp;as password. Then the login method validates the username/password with the default realm. In case of tomcat the default realm is configured with file based &lt;b&gt;tomcat-users.xml&lt;/b&gt; file. which can be found under &lt;b&gt;$CATALINA_HOME/conf&lt;/b&gt; directory.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;So we have to configure few users in the tomcat-users.xml file. See below for a sample config.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvAdSCMKaWUd7zDj_LrH0wDy-5HWpv6qJw6G0ey5bLvBlxE4BBEGpQpcx99wSbo2J170rItgWmDm_yHAv5supG8BSTeGIaZxlEpzVQLks1yjtomOYNOUl5eZAt3AyuPBDehX-_uKyndZ8/s1600/3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;156&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvAdSCMKaWUd7zDj_LrH0wDy-5HWpv6qJw6G0ey5bLvBlxE4BBEGpQpcx99wSbo2J170rItgWmDm_yHAv5supG8BSTeGIaZxlEpzVQLks1yjtomOYNOUl5eZAt3AyuPBDehX-_uKyndZ8/s640/3.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Tomcat creates an authenticated subjected by matching the username/password provided with the username password available in tomcat-users.xml file (The file based realm is the default realm in tomcat, we can change it to &lt;a href=&quot;http://www.youtube.com/watch?v=xFuul6TRlws&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;LDAPRealm/JNDIRealm&lt;/a&gt;, JDBCRealm, JAASRealm) .&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Similar to login() method, the request object has another method named logout(), which just logs out the user from current authenticated subject. See the code below for logout functionality.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table id=&quot;src_table_0&quot; style=&quot;background-color: white; border-collapse: collapse; color: black; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; font-size: 12px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; white-space: pre;&quot;&gt;&lt;tbody style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;tr id=&quot;sl_svn23_32&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;protected&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; processRequest&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;HttpServletRequest&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; request&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;HttpServletResponse&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; response&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_33&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;throws&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;ServletException&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;IOException&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_34&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; request&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;getServletPath&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;equalsIgnoreCase&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;/login&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_35&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; processLogin&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; response&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_36&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_37&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_38&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;request&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;logout&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_39&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; request&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;setAttribute&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;msg&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;You have successfully logged out of system&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_40&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; request&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;getRequestDispatcher&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;index.jsp&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;forward&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; response&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_41&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr id=&quot;sl_svn23_42&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td class=&quot;source&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 0px; padding-top: 0px; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;The complete code can be checked in at Google svn &amp;amp; can be found &lt;a href=&quot;http://code.google.com/p/abani-office-projects/source/browse/trunk/NetBeans/LoginDemo/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;. The screen shots &amp;nbsp;of the above application in running mode are given below.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjK1_St30C4vyfoXTyNaNxrhuDEC8ibGIlKm2Jz46nGAm6UGxiFEfBo0LztL0V1N7QL4jBoD9ocYHVStE-u_bPHViqtuExFqWBM4dXivGkpoowLTdBlvvbf_oqNBGzMVAXT53nDCUkMHoI/s1600/7.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;172&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjK1_St30C4vyfoXTyNaNxrhuDEC8ibGIlKm2Jz46nGAm6UGxiFEfBo0LztL0V1N7QL4jBoD9ocYHVStE-u_bPHViqtuExFqWBM4dXivGkpoowLTdBlvvbf_oqNBGzMVAXT53nDCUkMHoI/s320/7.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGfIlgj8USTLJ2ag8vnDf7ODXYPxiMaZuyjBizVMhfihKigPfEI3BltXB2Lhexl4w4B6tNuaQDSZOW0dA9_fet8osj7NUYy5WHGUKB8qIicarTYFlyQwJmBwxkSmW6wagAG1W0OCSW8Qw/s1600/4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;156&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGfIlgj8USTLJ2ag8vnDf7ODXYPxiMaZuyjBizVMhfihKigPfEI3BltXB2Lhexl4w4B6tNuaQDSZOW0dA9_fet8osj7NUYy5WHGUKB8qIicarTYFlyQwJmBwxkSmW6wagAG1W0OCSW8Qw/s320/4.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsv8Z2uuiYVKeiZcBaF_SfdMy_QQ9b0JrWq5vmFlaKueUG83GTt4H4N8SqvarPLfIAxh5PixkA6ZQAZlBiKrqgbN-S4_xQOc_RmIKnrg8-dI5gKMfyAq0TQQoB5-q5Ko0rGnLBzvX1OTE/s1600/6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;151&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsv8Z2uuiYVKeiZcBaF_SfdMy_QQ9b0JrWq5vmFlaKueUG83GTt4H4N8SqvarPLfIAxh5PixkA6ZQAZlBiKrqgbN-S4_xQOc_RmIKnrg8-dI5gKMfyAq0TQQoB5-q5Ko0rGnLBzvX1OTE/s320/6.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0go1h0tIpYmlDF4jOLkp21ylBLYNRpd4tDfDYRSszM0TZKb4biD3CZ7ykJUUq8155QIYV25bmMiEOksGkMgvXfSJnFh3-aTgwlfmQ1j6Rq_n9Ifzod3qGCvEsUSef2HVDa-jy1ZqiMWU/s1600/5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;164&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0go1h0tIpYmlDF4jOLkp21ylBLYNRpd4tDfDYRSszM0TZKb4biD3CZ7ykJUUq8155QIYV25bmMiEOksGkMgvXfSJnFh3-aTgwlfmQ1j6Rq_n9Ifzod3qGCvEsUSef2HVDa-jy1ZqiMWU/s320/5.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Let me know if you find any difficulty in accessing or executing the code.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Thanks,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Abani R. Behera&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/2638842680201568591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2012/05/programmatic-login-in-servlet-30.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/2638842680201568591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/2638842680201568591'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2012/05/programmatic-login-in-servlet-30.html' title='Programmatic login with Servlet 3.0'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVSIZsjigUNJj3idZs98bDr1VwihjfPFZsimqfGjnMh1SYzHP3eN-ZufXvlkFeqQJI2jGUBGrp0hMCxxCqgHTz1MjSsKSnMvSElj8ULm2hwcXIBmXKdy1srH_xK7C-leihz69klZLyV_k/s72-c/1.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-3464966751345684579</id><published>2012-05-01T21:26:00.001-07:00</published><updated>2012-05-01T21:26:39.186-07:00</updated><title type='text'>Accessing EJB methods from JSF pages via CDI</title><content type='html'>&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;270&quot; src=&quot;http://www.youtube.com/embed/oBY0e_xowwI?fs=1&quot; width=&quot;480&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/3464966751345684579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2012/05/accessing-ejb-methods-from-jsf-pages.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/3464966751345684579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/3464966751345684579'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2012/05/accessing-ejb-methods-from-jsf-pages.html' title='Accessing EJB methods from JSF pages via CDI'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/oBY0e_xowwI/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-4254986474739931671</id><published>2012-02-20T23:57:00.000-08:00</published><updated>2012-02-20T23:57:19.465-08:00</updated><title type='text'>Ajaxifying File Upload with HTML5/Servlet3.0</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;This post will describe about uploading a file in ajax without any third party java script libraries or tools which are used to upload files in asynchronous way. &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;To show case the demo, I have used &lt;b&gt;&lt;a href=&quot;https://developer.mozilla.org/En/XMLHttpRequest/Using_XMLHttpRequest#Using_FormData_objects&quot;&gt;FormData&lt;/a&gt;&amp;nbsp;&lt;/b&gt;javascript&amp;nbsp;library as my client side API &amp;amp; &lt;b&gt;Servlet3.0&amp;nbsp;&lt;/b&gt;as my server side component, Eclipse Indigo as IDE and Tomcat 7 as the web&amp;nbsp;container. I have followed bellow steps to do the sample app.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;I have created a Dynamic Web&amp;nbsp;Application&amp;nbsp;with version 3 supported. So that, servlet 3 support will be added.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Created a jsp file named &lt;a href=&quot;http://code.google.com/p/abani-office-projects/source/browse/trunk/Eclipse/HTML5/WebContent/index.jsp&quot; target=&quot;_blank&quot;&gt;index.jsp&lt;/a&gt; which is main UI page. the code snippet for index.jsp is given below .&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3OAnFte2TjU_IrREP9y00UMdiMWwDsRlnjdo9GjaX1KO1YlJ-lQ56EHLS-TS_2iZ_ppHCKUjo-aflG3XEiRJ3fHvEd4FPes-ga_tHlYAFR4W1ChjdLO35bm_W0hAngX6xrjh_AEbRq0w/s1600/jsp-1.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;72&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3OAnFte2TjU_IrREP9y00UMdiMWwDsRlnjdo9GjaX1KO1YlJ-lQ56EHLS-TS_2iZ_ppHCKUjo-aflG3XEiRJ3fHvEd4FPes-ga_tHlYAFR4W1ChjdLO35bm_W0hAngX6xrjh_AEbRq0w/s640/jsp-1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Have used simple input type file &amp;amp; a button to upload the selected file. On click of the upload button, I am calling a javascript function startUploading(this). The former method will create a javascript FormData object &amp;amp; send the object in the XHR-Ajax post method. the code snippet for the same function is given &amp;nbsp;below.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcWVf7RpJvqtuxHFuNvzCtiUdoHeRfsmeJHWROJlT_ieKkstU0Md5oKdCTH7QrZba_v6DEhv1aRI0C-WWzcJrioL1q7sqQ-8M8FfY247vBR0ABMiIgNMSgJr9GCTGiuzoa-7WDkud0t9w/s1600/jsp-2.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;352&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcWVf7RpJvqtuxHFuNvzCtiUdoHeRfsmeJHWROJlT_ieKkstU0Md5oKdCTH7QrZba_v6DEhv1aRI0C-WWzcJrioL1q7sqQ-8M8FfY247vBR0ABMiIgNMSgJr9GCTGiuzoa-7WDkud0t9w/s640/jsp-2.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;We can notice few javascript&amp;nbsp;built in functions.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;First we have created a FormData Object with passing the html form object. &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;i&gt;var vFD = new FormData(document.getElementById(&#39;upload_form&#39;));&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;i style=&quot;color: blue;&quot;&gt;vFD &lt;/i&gt;will hold all the&amp;nbsp;information&amp;nbsp;about the HTML file component.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Again, we have created XMLHttpRequest (V2) Object with method type:POST, the invoking URL as &lt;b&gt;upload&lt;/b&gt; &amp;amp; async as true.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;The URL is nothing but the server side component, to which we will post our FormData Object through ajax. For our case I have used an servlet (v3) as my server side component which will save the received file in the disk or file system.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Servlet 3 has built in support for handling multipart/form-data. Which means we don&#39;t have to depend upon third party libraries like apache commons file upload. Servlet 3 has introduced new interface named as &lt;b&gt;Part&amp;nbsp;&lt;/b&gt;which can be retrieved from the HttpServletRequest object. The Part object will hold the file information available in the request. We can retrieve the file content, file length, file type from the Part object. The Part interface has a write method which write the file to a location being passed as a method parameter. Please see the code below.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;i&gt;Part p = request.getPart(&quot;image_file&quot;);&lt;/i&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;This will create a object of Part from the request object.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;i&gt;p.write(disk_path);&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;This will write the file to the disk path specified in the method.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;The code snippet for the above servlet (&lt;a href=&quot;http://code.google.com/p/abani-office-projects/source/browse/trunk/Eclipse/HTML5/src/com/html5/servlets/UploadServlet.java&quot; target=&quot;_blank&quot;&gt;UploadServlet&lt;/a&gt;) is given below&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqkSjm1Fl5QuwSJuE1LKQ12g3JKO8JviJLWrlA4AZ-rJHwQ0TiPnmGOeFuFZOQGn-lH1MOeJDAmQfWFp3AxwqXOUsN9J-W6WINLHhdhZKaP9gv__ifFD6JxchLLRMCO7p7-jxvrH_KQgQ/s1600/jsp-3.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;424&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqkSjm1Fl5QuwSJuE1LKQ12g3JKO8JviJLWrlA4AZ-rJHwQ0TiPnmGOeFuFZOQGn-lH1MOeJDAmQfWFp3AxwqXOUsN9J-W6WINLHhdhZKaP9gv__ifFD6JxchLLRMCO7p7-jxvrH_KQgQ/s640/jsp-3.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Working &lt;a href=&quot;http://abani.jelastic.servint.net/HTML5/&quot; target=&quot;_blank&quot;&gt;demo &lt;/a&gt;of this application can be found out &lt;a href=&quot;http://abani.jelastic.servint.net/HTML5/&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMiW7E1RQzwbzGgiVzhEQQt3frjODT-8MG8O3ejD-5PsjIBlp8GEM83tc3vzsgLSksGjZaCzirT31dyrQw63ONnvQHCdfKjbPHyEN74JwnxltV38rW76TbcyshrsmRu7-szHkV8pRyu9A/s1600/jsp-4.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;148&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMiW7E1RQzwbzGgiVzhEQQt3frjODT-8MG8O3ejD-5PsjIBlp8GEM83tc3vzsgLSksGjZaCzirT31dyrQw63ONnvQHCdfKjbPHyEN74JwnxltV38rW76TbcyshrsmRu7-szHkV8pRyu9A/s640/jsp-4.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6u5Mub28MYv34uaJplqke010qrGcEuKVvEhGpoiC1LxJDb3iHxaTjdRE3jIs1oh_sYOrmfyJ2OJinlP2vLsqIbF6xGVb2sEa7Cagt8mIjpmJgOcxIEn-nP-ssvFmKPZNM7tYW6ab-_Ug/s1600/jsp-5.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;194&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6u5Mub28MYv34uaJplqke010qrGcEuKVvEhGpoiC1LxJDb3iHxaTjdRE3jIs1oh_sYOrmfyJ2OJinlP2vLsqIbF6xGVb2sEa7Cagt8mIjpmJgOcxIEn-nP-ssvFmKPZNM7tYW6ab-_Ug/s640/jsp-5.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7k3wuXobjWq23CYimsoIKN_2UDmCDc22y6mL1AdoF-WGceU5M1M9pU-L2o1EIF_03W74OY1vBxoZ1cD8tSqGVOaNfgACDA81JK4t90h3H_J7luW8vrFU-3MwKnvGzB9WZfAt7z_bshKo/s1600/jsp-6.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;114&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7k3wuXobjWq23CYimsoIKN_2UDmCDc22y6mL1AdoF-WGceU5M1M9pU-L2o1EIF_03W74OY1vBxoZ1cD8tSqGVOaNfgACDA81JK4t90h3H_J7luW8vrFU-3MwKnvGzB9WZfAt7z_bshKo/s640/jsp-6.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/4254986474739931671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2012/02/ajaxifying-file-upload-with.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/4254986474739931671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/4254986474739931671'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2012/02/ajaxifying-file-upload-with.html' title='Ajaxifying File Upload with HTML5/Servlet3.0'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3OAnFte2TjU_IrREP9y00UMdiMWwDsRlnjdo9GjaX1KO1YlJ-lQ56EHLS-TS_2iZ_ppHCKUjo-aflG3XEiRJ3fHvEd4FPes-ga_tHlYAFR4W1ChjdLO35bm_W0hAngX6xrjh_AEbRq0w/s72-c/jsp-1.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-5559932701031578862</id><published>2011-11-19T06:14:00.000-08:00</published><updated>2011-11-19T07:58:40.993-08:00</updated><title type='text'>CDI (JSR 299) with JBoss WELD</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;Here I will describe about the implementation of JSR 299, JBOSS WELD, by using this we can achieve context dependency injection (akka CDI). For JSR 299 till now there are two main implementations are available.&lt;div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Apache WebBeans&lt;/li&gt;&lt;li&gt;JBoss WELD &lt;/li&gt;&lt;/ol&gt;&lt;div&gt;I will show a demo of CDI with JBoss Weld in a simple web application. JBoss Weld has easier implementation when it compared with Apache WebBean. Tools used are JKD7, Tomcat7, Weld API, Netbeans IDE.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Below JBoss Weld jar files are required.&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;weld-api.jar&lt;br /&gt;&lt;/li&gt;&lt;li&gt;weld-build-config.jar&lt;/li&gt;&lt;li&gt;weld-core.jar&lt;/li&gt;&lt;li&gt;weld-servlet.jar&lt;/li&gt;&lt;li&gt;weld-sp.jar&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;These jar files can be downloaded at &lt;a href=&quot;http://seamframework.org/Weld&quot;&gt;weld&lt;/a&gt; site.&lt;/div&gt;&lt;div&gt;Now create a simple Web Project in NetBeans IDE.&lt;/div&gt;&lt;div&gt;The project will look like this&lt;/div&gt;&lt;div&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2VK0zVGy_uMJMKT4ImYd6G3WA1shi2wnVDrfPYNbxt3W5fKh1qUTwGtyUWYy-dwuSXuRMDVEDoo7fnVFVnhtqJ132tYighh3kRe1JeL9ScadvV5jxlpB7f3ZHchLL_a1SbHx7NFyayD0/s320/weld.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5676714850520125474&quot; style=&quot;color: rgb(0, 0, 238); text-decoration: underline; display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 320px; height: 239px; &quot; /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Add the above jar files into WEB-INF/lib folder.For CDI we have to create an empty &lt;b&gt;beans.xml&lt;/b&gt; file. We have place this is WEB-INF folder, parallel to web.xml file.&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;b&gt;           &lt;/b&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;          &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Now create a package like com.weld.beans in the source folder. Create a class named GreetService &amp;amp; add a method greet() into it. The class/method signature is given below.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;public class GreetService {&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;    &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;public String greet (final String name){&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;return &quot;Hallo &quot;+ name + &quot; from WELD&quot;;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;This is simple java class with a simple method. we are going to inject the class in run-time &amp;amp; invoke the method. To do so we will create a servlet &amp;amp; inject GreetService class. Create servlet named CDIServlet in the package com.weld.servlets. The default created servlet will look like below.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;@WebServlet(name = &quot;CDIServlet&quot;, urlPatterns = {&quot;/CDIServlet&quot;})&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;public class CDIServlet extends HttpServlet {&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;    /** &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     * Processes requests for both HTTP &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;POST&lt;/code&gt; methods.&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     * @param request servlet request&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     * @param response servlet response&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     * @throws ServletException if a servlet-specific error occurs&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     * @throws IOException if an I/O error occurs&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     */&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;    protected void processRequest(HttpServletRequest request, HttpServletResponse response)&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;            throws ServletException, IOException {&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;        response.setContentType(&quot;text/html;charset=UTF-8&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;        PrintWriter out = response.getWriter();&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;        try {&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;            out.println(&quot;&lt;h1&gt;Servlet CDIServlet &lt;/h1&gt;&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;        } finally {            &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;            out.close();&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;    // &lt;editor-fold defaultstate=&quot;collapsed&quot; desc=&quot;HttpServlet methods. Click on the + sign on the left to edit the code.&quot;&gt;&lt;/editor-fold&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;    /** &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     * Handles the HTTP &lt;code&gt;GET&lt;/code&gt; method.&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     * @param request servlet request&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     * @param response servlet response&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     * @throws ServletException if a servlet-specific error occurs&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     * @throws IOException if an I/O error occurs&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     */&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;    @Override&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;    protected void doGet(HttpServletRequest request, HttpServletResponse response)&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;            throws ServletException, IOException {&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;        processRequest(request, response);&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;    /** &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     * Handles the HTTP &lt;code&gt;POST&lt;/code&gt; method.&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     * @param request servlet request&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     * @param response servlet response&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     * @throws ServletException if a servlet-specific error occurs&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     * @throws IOException if an I/O error occurs&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     */&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;    @Override&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;    protected void doPost(HttpServletRequest request, HttpServletResponse response)&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;            throws ServletException, IOException {&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;        processRequest(request, response);&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;    /**&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     * Returns a short description of the servlet.&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     * @return a String containing servlet description&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;     */&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;    @Override&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;    public String getServletInfo() {&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;        return &quot;Short description&quot;;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;    }//&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Now we will inject with an annotation @Inject (javax.inject.Inject part of CDI).&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Add the below code at the top level of the servlet.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;private @Inject GreetService greetService;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;the @Inject will create a injection point for the class GreetService at this peace of the servlet code.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;To test this let&#39;s print the GreetService object reference. to do so add the below code after processRequest method of CDI Servlet.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;LOGGER.log(Level.INFO,&quot;GreetService Object is {0}&quot;, greetService);&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;To invoke the greet method of the GreetService class update the processRequest method with beow code.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;out.println(&quot;&lt;span class=&quot;Apple-style-span&quot;&gt;Servlet CDIServlet at &quot; + greetService.greet(&quot;abani&quot;) );&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;Save the servlet. Now we have to test the CDI implementation. We can run the servlet &amp;amp; watch the servler log. To do so right click on the servlet &amp;amp; choose run file option in menu.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;after successfully invoking the servlet we can see some logs as below.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;Nov 19, 2011 8:28:37 PM com.weld.servlets.CDIServlet processRequest&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;b&gt;INFO: GreetService Object is com.weld.beans.GreetService@68a427&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;The servlet output will look like below.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaB_CRTSsNp1Xrdlt44kAs-d4-UB0mDvpcVv7p3BSugoGprLfn2BcCIkQ5DbFV1NyyUru0tzDlbKs9rojr0R7dml_H9K-scp4jLdaIbMy_NccUPzNM_jdUCJo033Uao7dRnAFDNW9Sgyw/s320/result.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5676727860438667154&quot; style=&quot;text-align: center; cursor: pointer; width: 320px; height: 150px; &quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/5559932701031578862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2011/11/cdi-jsr-299-with-jboss-weld.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/5559932701031578862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/5559932701031578862'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2011/11/cdi-jsr-299-with-jboss-weld.html' title='CDI (JSR 299) with JBoss WELD'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2VK0zVGy_uMJMKT4ImYd6G3WA1shi2wnVDrfPYNbxt3W5fKh1qUTwGtyUWYy-dwuSXuRMDVEDoo7fnVFVnhtqJ132tYighh3kRe1JeL9ScadvV5jxlpB7f3ZHchLL_a1SbHx7NFyayD0/s72-c/weld.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-9129913521846565380</id><published>2011-08-30T09:50:00.000-07:00</published><updated>2011-08-30T09:50:47.046-07:00</updated><title type='text'>Servlet 3.0 Demo</title><content type='html'>&lt;iframe width=&quot;480&quot; height=&quot;295&quot; src=&quot;http://www.youtube.com/embed/LPya-BlMXJM?fs=1&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/9129913521846565380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2011/08/servlet-30-demo.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/9129913521846565380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/9129913521846565380'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2011/08/servlet-30-demo.html' title='Servlet 3.0 Demo'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/LPya-BlMXJM/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-3475670840189898973</id><published>2011-02-20T19:23:00.000-08:00</published><updated>2011-02-20T19:23:02.738-08:00</updated><title type='text'>float css – one of various CSS properties</title><content type='html'>&lt;a href=&quot;http://www.script-tutorials.com/float-css/&quot;&gt;float css – one of various CSS properties&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/3475670840189898973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2011/02/float-css-one-of-various-css-properties.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/3475670840189898973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/3475670840189898973'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2011/02/float-css-one-of-various-css-properties.html' title='float css – one of various CSS properties'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-3650150419658631758</id><published>2011-02-20T19:22:00.000-08:00</published><updated>2011-02-20T19:22:50.686-08:00</updated><title type='text'>Login with Facebook and Twitter</title><content type='html'>&lt;a href=&quot;http://www.9lessons.info/2011/02/login-with-facebook-and-twitter.html&quot;&gt;Login with Facebook and Twitter&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/3650150419658631758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2011/02/login-with-facebook-and-twitter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/3650150419658631758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/3650150419658631758'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2011/02/login-with-facebook-and-twitter.html' title='Login with Facebook and Twitter'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-8976167646918658710</id><published>2011-02-20T19:16:00.000-08:00</published><updated>2011-02-20T19:16:22.455-08:00</updated><title type='text'>Tech Insight Magazine: 3 Best Tips To Make Windows XP Run Faster</title><content type='html'>&lt;a href=&quot;http://techinsightmagazine.blogspot.com/2011/02/3-best-tips-to-make-windows-xp-run.html&quot;&gt;Tech Insight Magazine: 3 Best Tips To Make Windows XP Run Faster&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/8976167646918658710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2011/02/tech-insight-magazine-3-best-tips-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/8976167646918658710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/8976167646918658710'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2011/02/tech-insight-magazine-3-best-tips-to.html' title='Tech Insight Magazine: 3 Best Tips To Make Windows XP Run Faster'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-648604287664639068</id><published>2011-02-20T19:14:00.000-08:00</published><updated>2011-02-20T19:14:32.855-08:00</updated><title type='text'>Connecting to Active Directory in Java: Still a Sorry State of Affairs « Nick Watts’ Weblog</title><content type='html'>&lt;a href=&quot;http://thewonggei.wordpress.com/2011/02/18/connecting-to-active-directory-in-java-still-a-sorry-state-of-affairs/&quot;&gt;Connecting to Active Directory in Java: Still a Sorry State of Affairs « Nick Watts’ Weblog&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/648604287664639068/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2011/02/connecting-to-active-directory-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/648604287664639068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/648604287664639068'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2011/02/connecting-to-active-directory-in-java.html' title='Connecting to Active Directory in Java: Still a Sorry State of Affairs « Nick Watts’ Weblog'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-3110850044254887296</id><published>2011-02-15T19:55:00.000-08:00</published><updated>2011-02-15T19:55:47.415-08:00</updated><title type='text'>Build a RESTful Web service using Jersey and Apache Tomcat</title><content type='html'>&lt;a href=&quot;http://www.ibm.com/developerworks/web/library/wa-aj-tomcat/index.html&quot;&gt;Build a RESTful Web service using Jersey and Apache Tomcat&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/3110850044254887296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2011/02/build-restful-web-service-using-jersey.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/3110850044254887296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/3110850044254887296'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2011/02/build-restful-web-service-using-jersey.html' title='Build a RESTful Web service using Jersey and Apache Tomcat'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-4843156225213395587</id><published>2011-02-15T07:27:00.000-08:00</published><updated>2011-02-15T07:27:58.377-08:00</updated><title type='text'>Getters and setters: evil or necessary evil? — Berry Langerak</title><content type='html'>&lt;a href=&quot;http://berryllium.nl/2011/02/getters-and-setters-evil-or-necessary-evil/&quot;&gt;Getters and setters: evil or necessary evil? — Berry Langerak&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/4843156225213395587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2011/02/getters-and-setters-evil-or-necessary.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/4843156225213395587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/4843156225213395587'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2011/02/getters-and-setters-evil-or-necessary.html' title='Getters and setters: evil or necessary evil? — Berry Langerak'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-4813722413665985515</id><published>2011-02-10T20:10:00.000-08:00</published><updated>2011-02-10T20:10:40.831-08:00</updated><title type='text'>Oracle patches decade-old &#39;Mark-of-the-Beast&#39; bug in Java • The Register</title><content type='html'>&lt;a href=&quot;http://www.theregister.co.uk/2011/02/09/java_floating_point_bug_fixed/&quot;&gt;Oracle patches decade-old &#39;Mark-of-the-Beast&#39; bug in Java • The Register&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/4813722413665985515/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2011/02/oracle-patches-decade-old-mark-of-beast.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/4813722413665985515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/4813722413665985515'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2011/02/oracle-patches-decade-old-mark-of-beast.html' title='Oracle patches decade-old &#39;Mark-of-the-Beast&#39; bug in Java • The Register'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4735327920528753836.post-8185305685866831049</id><published>2011-02-03T03:46:00.000-08:00</published><updated>2011-02-03T03:46:13.896-08:00</updated><title type='text'>HTML5 Server-Push Technologies, Part 1 | Java.net</title><content type='html'>&lt;a href=&quot;http://today.java.net/article/2010/03/31/html5-server-push-technologies-part-1&quot;&gt;HTML5 Server-Push Technologies, Part 1 | Java.net&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://abani-behera.blogspot.com/feeds/8185305685866831049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abani-behera.blogspot.com/2011/02/html5-server-push-technologies-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/8185305685866831049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4735327920528753836/posts/default/8185305685866831049'/><link rel='alternate' type='text/html' href='http://abani-behera.blogspot.com/2011/02/html5-server-push-technologies-part-1.html' title='HTML5 Server-Push Technologies, Part 1 | Java.net'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/06010890334869296999</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>