<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>J2EE :The way to Enterprise web</title>
	<atom:link href="http://seeazee.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://seeazee.wordpress.com</link>
	<description>Express yourself...</description>
	<lastBuildDate>Tue, 01 Sep 2009 14:55:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='seeazee.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>J2EE :The way to Enterprise web</title>
		<link>http://seeazee.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://seeazee.wordpress.com/osd.xml" title="J2EE :The way to Enterprise web" />
	<atom:link rel='hub' href='http://seeazee.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Spring: Data Sources Configurations</title>
		<link>http://seeazee.wordpress.com/2009/08/10/spring-data-sources-configurations/</link>
		<comments>http://seeazee.wordpress.com/2009/08/10/spring-data-sources-configurations/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 09:57:46 +0000</pubDate>
		<dc:creator>Abdul Aziz</dc:creator>
				<category><![CDATA[J2EE]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA["Connection Pooling"]]></category>
		<category><![CDATA[DAO]]></category>
		<category><![CDATA[JDBCTemplate]]></category>
		<category><![CDATA[JNDI DataSource]]></category>

		<guid isPermaLink="false">http://seeazee.wordpress.com/2009/08/13/spring-data-sources-configurations/</guid>
		<description><![CDATA[Spring provides several options for making a DataSource available to your application. 1) Getting a DataSource from JNDI &#60;bean class="org.springframework.jndi.JndiObjectFactoryBean"&#62; &#60;property name="jndiName"&#62; &#60;value&#62;java:comp/env/jdbc/myDatasource&#60;/value&#62; &#60;/property&#62; &#60;/bean&#62; We have now wired in our server's DataSource and its connection pooling facility 2) Creating a DataSource connection pool &#60;bean id=&#8220;myDataSource&#8221; class=&#8220;com.mchange.v2.c3p0.ComboPooledDataSource&#8221; destroy-method=&#8220;close&#8221;&#62; &#60;property name=&#8220;driverClass&#8221; value=&#8220;net.sourceforge.jtds.jdbc.Driver&#8221; /&#62; &#60;property name=&#8220;jdbcUrl&#8221; value=&#8220;jdbc:jtds:sqlserver://R2DDEV2:1433/sampleDB&#8221; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeazee.wordpress.com&amp;blog=3830637&amp;post=68&amp;subd=seeazee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:Arial;"><span style="font-size:10pt;">Spring provides several options for making a </span><span style="font-size:9pt;">DataSource </span><span style="font-size:10pt;">available to your application.<br />
</span></span></p>
<h3><span style="font-family:Arial;"><em>1) Getting a DataSource from JNDI<br />
</em></span></h3>
<pre><span style="font-family:Arial, 'Times New Roman', 'Bitstream Charter', Times, serif;line-height:19px;white-space:normal;font-size:13px;"><span style="font-size:10pt;"><span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;font-size:small;"><span style="line-height:18px;white-space:pre;">
&lt;bean
<span style="font-size:small;">class="org.springframework.jndi.<strong>JndiObjectFactoryBean</strong>"&gt;</span>
&lt;property name="jndiName"&gt;

&lt;value&gt;java:comp/env/jdbc/myDatasource&lt;/value&gt;

&lt;/property&gt;
<span style="font-size:small;">&lt;/bean&gt;</span>
</span></span></span><span style="font-size:10pt;">We have now wired in our server's </span><span style="font-size:9pt;">DataSource </span><span style="font-size:10pt;">and its connection pooling facility</span></span></pre>
<h3><span style="font-family:Arial;">2) Creating a DataSource connection pool<br />
</span></h3>
<p><span style="font-family:Arial;font-size:10pt;"><span style="color:teal;">&lt;</span><span style="color:#3f7f7f;">bean </span><span style="color:#7f007f;">id</span><span style="color:black;">=</span><span style="color:#2a00ff;">&#8220;myDataSource&#8221; </span><span style="color:#7f007f;">class</span><span style="color:black;">=</span><span style="color:#2a00ff;">&#8220;com.mchange.v2.c3p0.ComboPooledDataSource&#8221; </span><span style="color:#7f007f;">destroy-method</span><span style="color:black;">=</span><span style="color:#2a00ff;">&#8220;close&#8221;</span><span style="color:teal;">&gt;</span><br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;"><span style="color:teal;">&lt;</span><span style="color:#3f7f7f;">property </span><span style="color:#7f007f;">name</span><span style="color:black;">=</span><span style="color:#2a00ff;">&#8220;<strong>driverClass</strong>&#8221; </span><span style="color:#7f007f;">value</span><span style="color:black;">=</span><span style="color:#2a00ff;">&#8220;net.sourceforge.jtds.jdbc.Driver&#8221; </span><span style="color:teal;">/&gt;</span><br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;"><span style="color:teal;">&lt;</span><span style="color:#3f7f7f;">property </span><span style="color:#7f007f;">name</span><span style="color:black;">=</span><span style="color:#2a00ff;">&#8220;<strong>jdbcUrl</strong>&#8221; </span><span style="color:#7f007f;">value</span><span style="color:black;">=</span><span style="color:#2a00ff;">&#8220;jdbc:jtds:sqlserver://R2DDEV2:1433/sampleDB&#8221; </span><span style="color:teal;">/&gt;</span><br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;"><span style="color:teal;">&lt;</span><span style="color:#3f7f7f;">property </span><span style="color:#7f007f;">name</span><span style="color:black;">=</span><span style="color:#2a00ff;">&#8220;<strong>user</strong>&#8221; </span><span style="color:#7f007f;">value</span><span style="color:black;">=</span><span style="color:#2a00ff;">&#8220;sa&#8221; </span><span style="color:teal;">/&gt;</span><br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;"><span style="color:teal;">&lt;</span><span style="color:#3f7f7f;">property </span><span style="color:#7f007f;">name</span><span style="color:black;">=</span><span style="color:#2a00ff;">&#8220;<strong>password</strong>&#8221; </span><span style="color:#7f007f;">value</span><span style="color:black;">=</span><span style="color:#2a00ff;">&#8220;dev123&#8243; </span><span style="color:teal;">/&gt;</span><br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;"><span style="color:teal;">&lt;/</span><span style="color:#3f7f7f;">bean</span><span style="color:teal;">&gt;<br />
</span></span></p>
<p><span style="font-family:Arial;"><span style="font-size:10pt;">We now have a </span><span style="font-size:9pt;">DataSource </span><span style="font-size:10pt;">with connection pooling independent of an application server.<br />
</span></span></p>
<h3><span style="font-family:Arial;">3) Using a DataSource while testing<br />
</span></h3>
<p><span style="font-family:Arial;"><span style="font-size:9pt;"><strong>DriverManagerDataSource</strong></span><span style="font-size:10pt;">. This class can easily be configured and used with a unit test or suite of unit tests.<br />
</span></span></p>
<p><span style="font-family:Arial;font-size:8pt;">DriverManagerDataSource dataSource = new DriverManagerDataSource();<br />
</span></p>
<p><span style="font-family:Arial;font-size:8pt;">dataSource.setDriverClassName(driver);<br />
</span></p>
<p><span style="font-family:Arial;font-size:8pt;">dataSource.setUrl(url);<br />
</span></p>
<p><span style="font-family:Arial;font-size:8pt;">dataSource.setUsername(username);<br />
</span></p>
<p><span style="font-family:Arial;font-size:8pt;">dataSource.setPassword(password);<br />
</span></p>
<p><span style="font-family:Arial;"><span style="font-size:9pt;">You now have a </span><span style="font-size:8pt;">DataSource </span><span style="font-size:9pt;">to use when testing your data access code.<br />
</span></span></p>
<h4><span style="font-family:Arial;">Using JdbcTemplate<br />
</span></h4>
<p><span style="font-family:Arial;font-size:8pt;">JdbcTemplate template = new JdbcTemplate(myDataSource);<br />
</span></p>
<p><span style="text-decoration:underline;"><span style="font-size:10pt;">All of Spring&#8217;s </span><span style="font-size:9pt;">DAO </span><span style="font-size:10pt;">template classes are <strong>thread-safe</strong>, we only need <span style="color:blue;"><strong>one</strong></span><br />
</span><span style="font-size:9pt;">JdbcTemplate </span><span style="font-size:10pt;">instance for each </span><span style="font-size:9pt;">DataSource </span><span style="font-size:10pt;">in our application<br />
</span></span></p>
<p><span style="font-family:Arial;font-size:10pt;">&lt;bean id=&#8221;<strong>jdbcTemplate</strong>&#8220;<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">class=&#8221;org.springframework.jdbc.core.JdbcTemplate&#8221;&gt;<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">&lt;property name=&#8221;<strong>dataSource</strong>&#8220;&gt;&lt;ref bean=&#8221;dataSource&#8221;/&gt;&lt;/property&gt;<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">&lt;/bean&gt;<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">&lt;bean id=&#8221;<strong>studentDao</strong>&#8221; class=&#8221;StudentDaoJdbc&#8221;&gt;<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">&lt;property name=&#8221;<strong>jdbcTemplate</strong>&#8220;&gt;&lt;ref bean=&#8221;<strong>jdbcTemplate</strong>&#8220;/&gt;&lt;/property&gt;<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">&lt;/bean&gt;<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">&lt;bean id=&#8221;<strong>courseDao</strong>&#8221; class=&#8221;CourseDaoJdbc&#8221;&gt;<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">&lt;property name=&#8221;<strong>jdbcTemplate</strong>&#8220;&gt;&lt;ref bean=&#8221;<strong>jdbcTemplate</strong>&#8220;/&gt;&lt;/property&gt;<br />
</span></p>
<p><span style="font-family:Arial;font-size:9pt;"><br />
</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/seeazee.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/seeazee.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/seeazee.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/seeazee.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/seeazee.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/seeazee.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/seeazee.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/seeazee.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/seeazee.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/seeazee.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/seeazee.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/seeazee.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/seeazee.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/seeazee.wordpress.com/68/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeazee.wordpress.com&amp;blog=3830637&amp;post=68&amp;subd=seeazee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://seeazee.wordpress.com/2009/08/10/spring-data-sources-configurations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Abdul Aziz</media:title>
		</media:content>
	</item>
		<item>
		<title>SPRING: AOP:Advice</title>
		<link>http://seeazee.wordpress.com/2009/07/17/spring-aopadvice/</link>
		<comments>http://seeazee.wordpress.com/2009/07/17/spring-aopadvice/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 14:54:16 +0000</pubDate>
		<dc:creator>Abdul Aziz</dc:creator>
				<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://seeazee.wordpress.com/2009/09/01/spring-aopadvice/</guid>
		<description><![CDATA[Any functionality that exists in an application, but cannot be added in a desirable way is called a cross-cutting concern. That cross-cutting concern is called aspect-oriented programming (AOP). It deals with the functionality in applications that cannot be efficiently implemented with pure object-oriented techniques. One of the core features of AOP frameworks is implementing cross-cutting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeazee.wordpress.com&amp;blog=3830637&amp;post=89&amp;subd=seeazee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;"><span style="color:#141314;font-family:Arial;">Any functionality that exists in an application, but cannot be added in a desirable way is called a <strong><em>cross-cutting concern</em></strong>.<br />
</span></p>
<p style="text-align:justify;"><span style="color:#141314;font-family:Arial;">That cross-cutting concern is called aspect-oriented programming (<strong>AOP</strong>). It deals with the functionality in applications that cannot be efficiently implemented with pure object-oriented techniques.<br />
</span></p>
<p style="text-align:justify;"><span style="color:#141314;font-family:Arial;">One of the core features of AOP frameworks is implementing cross-cutting concerns once and reusing them in different places and in different applications. <span style="text-decoration:underline;">In AOP jargon, the implementation of a cross-cutting concern is called an <strong><em>advice</em></strong>.<br />
</span></span></p>
<p><span style="color:#141314;font-family:Arial;font-size:10pt;">AOP frameworks allow you to define which advice is applied to which methods<br />
</span></p>
<p style="text-align:justify;">
<p style="text-align:justify;"><span style="color:#141314;font-family:Arial;">Spring AOP supports <strong>four</strong> advice types that each represents a specific scenario for advice implementations:<br />
</span></p>
<p style="text-align:justify;"><span style="color:#141314;font-family:Arial;"><strong><em>Around advice</em>:</strong> Controls the execution of a join point. This type is ideal for advice that needs to control the execution of the method on the target object.<br />
</span></p>
<p style="text-align:justify;"><span style="color:#141314;font-family:Arial;"><strong><em>Before advice</em>:</strong> Is executed before the execution of a join point. This type is ideal for advice that needs to performan action before the execution of the method on the target object.<br />
</span></p>
<p style="text-align:justify;"><span style="color:#141314;font-family:Arial;"><strong><em>After advice</em>:</strong> Is executed after the execution of a join point. This type is ideal for advice that needs to perform an action after the execution of the method on the target object.<br />
</span></p>
<p><span style="font-family:Arial;"><span style="color:#141314;"><strong><em>Throws advice</em>:</strong> Is executed after the execution of a join point if an exception is thrown. This </span>type is ideal for advice that needs to performan action when the execution of the method on the target object has thrown an exception.</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/seeazee.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/seeazee.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/seeazee.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/seeazee.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/seeazee.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/seeazee.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/seeazee.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/seeazee.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/seeazee.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/seeazee.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/seeazee.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/seeazee.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/seeazee.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/seeazee.wordpress.com/89/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeazee.wordpress.com&amp;blog=3830637&amp;post=89&amp;subd=seeazee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://seeazee.wordpress.com/2009/07/17/spring-aopadvice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Abdul Aziz</media:title>
		</media:content>
	</item>
		<item>
		<title>JDBC with Spring</title>
		<link>http://seeazee.wordpress.com/2009/06/19/jdbc-with-spring/</link>
		<comments>http://seeazee.wordpress.com/2009/06/19/jdbc-with-spring/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 11:54:18 +0000</pubDate>
		<dc:creator>Abdul Aziz</dc:creator>
				<category><![CDATA[J2EE]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[JDBCTemplate]]></category>
		<category><![CDATA[ResultSet]]></category>
		<category><![CDATA[RowMapper]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[stored Procedures]]></category>

		<guid isPermaLink="false">http://seeazee.wordpress.com/2009/06/19/jdbc-with-spring/</guid>
		<description><![CDATA[Spring JDBC framework will clean up your JDBC code by putting the burden of Resource management and Error handling. This leaves you free to write the statements and queries to get your data to and from the database. JdbcTemplate template = new JdbcTemplate(myDataSource); Spring DAO template classes are thread-safe, we only need one JdbcTemplate instance [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeazee.wordpress.com&amp;blog=3830637&amp;post=67&amp;subd=seeazee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Spring JDBC framework will clean up your JDBC code by putting the burden of <strong>Resource management</strong> and <strong>Error handling</strong>. This leaves you free to write the statements and queries to get your data to and from the database.
</p>
<p><span style="color:#4f81bd;">JdbcTemplate template = new JdbcTemplate(<strong>myDataSource</strong>);<br />
</span></p>
<p><strong>Spring DAO template</strong> classes are <strong>thread-safe</strong>, we only need one <strong>JdbcTemplate</strong> instance for each <strong>DataSource</strong> in our application.
</p>
<p><span style="color:#4f81bd;">&lt;bean id=&#8221;<strong>jdbcTemplate</strong>&#8221; class=&#8221;<strong>org.springframework.jdbc.core.JdbcTemplate</strong>&#8220;&gt;<br />
</span></p>
<p><span style="color:#4f81bd;">&lt;property name=&#8221;dataSource&#8221;&gt;&lt;ref bean=&#8221;<strong>dataSource</strong>&#8220;/&gt;&lt;/property&gt;<br />
</span></p>
<p><span style="color:#4f81bd;">&lt;/bean&gt;<br />
</span></p>
<p><span style="text-decoration:underline;"><strong>Writing data<br />
</strong></span></p>
<p>The JdbcTemplate uses several of these callbacks when writing data to the database.
</p>
<p>Now whenever the JdbcTempate calls on this class to create a PreparedStatment, it will also be able to log the executed SQL. This can prove invaluable during development and debugging.
</p>
<p><span style="text-decoration:underline;"><strong>Reading data<br />
</strong></span></p>
<p>We simply need to tell Spring what to do with each row in the <strong>ResultSet</strong>. We do so through the <strong>RowCallbackHandler</strong> interface by implementing its only method:
</p>
<p><span style="color:#4f81bd;">void processRow(java.sql.ResultSet rs)<br />
</span></p>
<p>This method is called for each row in our ResultSet.
</p>
<p>There is also a sub-interface you can implement that is useful for retrieving <span style="text-decoration:underline;">multiple objects</span> through a query.
</p>
<p>The <strong>RowMapper</strong> interface is <span style="text-decoration:underline;">responsible for mapping a <strong>ResultSet</strong> row to an <strong>object</strong>.</span>
	</p>
<p>Suppose we want a method that retrieves all of our objects. To do this we would implement <strong>ResultReader</strong>.
</p>
<p>Spring provides an implementation of this interface that does exactly what we need: <strong>RowMapperResultReader</strong>. The RowMapper interface is responsible for mapping a ResultSet row to an object.
</p>
<p>jdbcTemplate.<strong>query</strong>(sql, params, rowMapperResultReaderObj);
</p>
<p><strong>Query</strong> function pull data to create domain objects. But what about queries that just return simple types, like int or String? JdbcTemplate also contains some convenience methods for precisely this.
</p>
<p><span style="color:#4f81bd;">jdbcTemplate.queryForInt(&#8220;select count(*) from Students&#8221;);<br />
</span></p>
<p><span style="color:#4f81bd;">query()<br />
</span></p>
<p><span style="color:#4f81bd;">queryForInt()<br />
</span></p>
<p><span style="color:#4f81bd;">queryForObject()<br />
</span></p>
<p><span style="text-decoration:underline;"><strong>Calling stored Procedures<br />
</strong></span></p>
<p>Spring provides the same support for calling stored procedures as it does for executing statements and queries. This time get the support by implementing <span style="color:#4f81bd;"><strong>CallableStatementCallback</strong></span>.
</p>
<p><span style="color:#4f81bd;">CallableStatementCallback <strong>cb</strong> = new CallableStatementCallback() {<br />
</span></p>
<p><span style="color:#4f81bd;">public Object doInCallableStatement(CallableStatement cs) throws SQLException{<br />
</span></p>
<p style="margin-left:36pt;"><span style="color:#4f81bd;">cs.execute();<br />
</span></p>
<p style="margin-left:36pt;"><span style="color:#4f81bd;">return null;<br />
</span></p>
<p><span style="color:#4f81bd;">}<br />
</span></p>
<p><span style="color:#4f81bd;">};<br />
</span></p>
<p><span style="color:#4f81bd;">jdbcTemplate.execute(&#8220;{ ARCHIVE_Vehicle_Volume_Data }&#8221;, <strong>cb</strong>);<br />
</span></p>
<p>We have all the benefits of resource management and exception handling.All we have to do is define the name of our stored procedure and execute it.
</p>
<p><strong>SqlUpdate object<br />
</strong></p>
<p>To create a reusable object for executing inserts or updates, you subclass the SqlUpdate class.
</p>
<p><strong>MappingSqlQuery<br />
</strong></p>
<p>Querying the database with a MappingSqlQuery To model a query as an object, we subclass the MappingSqlQuery class.
</p>
<p><strong>Auto-incrementing keys<br />
</strong></p>
<p>Spring provides a means to do this via the DataFieldMaxValueIncrementer interface. This interface has three different methods for obtaining the next value to be used as a key<span style="color:#1f497d;">: nextIntValue(),</span><br />
		<span style="color:#1f497d;">nextLongValue(),</span> and <span style="color:#1f497d;">nextStringValue().<br />
</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/seeazee.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/seeazee.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/seeazee.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/seeazee.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/seeazee.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/seeazee.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/seeazee.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/seeazee.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/seeazee.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/seeazee.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/seeazee.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/seeazee.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/seeazee.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/seeazee.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeazee.wordpress.com&amp;blog=3830637&amp;post=67&amp;subd=seeazee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://seeazee.wordpress.com/2009/06/19/jdbc-with-spring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Abdul Aziz</media:title>
		</media:content>
	</item>
		<item>
		<title>BeanFactory</title>
		<link>http://seeazee.wordpress.com/2009/04/30/beanfactory/</link>
		<comments>http://seeazee.wordpress.com/2009/04/30/beanfactory/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 10:48:52 +0000</pubDate>
		<dc:creator>Abdul Aziz</dc:creator>
				<category><![CDATA[J2EE]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://seeazee.wordpress.com/2009/06/16/beanfactory/</guid>
		<description><![CDATA[It is an implementation of the &#8220;Factory Design Pattern&#8221;; It is a class whose responsibility is to CREATE and DISPENSE beans. A bean factory is a general-purpose factory, creating and dispensing many types of beans. It is also able to create associations between collaborating objects as they are instantiated. A bean factory also takes part [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeazee.wordpress.com&amp;blog=3830637&amp;post=51&amp;subd=seeazee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It is an implementation of the <strong>&#8220;Factory Design Pattern&#8221;;</strong> It is a class whose responsibility is to <strong>CREATE</strong> and <strong>DISPENSE</strong> beans. A bean factory is a general-purpose factory, <span style="text-decoration:underline;">creating and dispensing many types of beans. </span>It is also able to create <strong>associations</strong> between collaborating objects as they are instantiated. A bean factory also takes part in the <strong>lifecycle of a bean</strong>, <span style="text-decoration:underline;">making calls to custom initialization and destruction methods, if those methods are defined.<br />
</span></p>
<p><span style="text-decoration:underline;">There are many implementations of <strong>BeanFactory</strong> in Spring.<br />
</span></p>
<p><span style="color:#4f81bd;">org.springframework.beans.factory.xml.<strong>XmlBeanFactory</strong></span> It loads its beans based on the definitions contained in an XML file
</p>
<p><span style="color:#4f81bd;">BeanFactory factory = new XmlBeanFactory(new FileSystemResource(&#8220;<strong>beans.xml</strong>&#8220;));<br />
</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/seeazee.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/seeazee.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/seeazee.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/seeazee.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/seeazee.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/seeazee.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/seeazee.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/seeazee.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/seeazee.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/seeazee.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/seeazee.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/seeazee.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/seeazee.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/seeazee.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeazee.wordpress.com&amp;blog=3830637&amp;post=51&amp;subd=seeazee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://seeazee.wordpress.com/2009/04/30/beanfactory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Abdul Aziz</media:title>
		</media:content>
	</item>
		<item>
		<title>ApplicationContext</title>
		<link>http://seeazee.wordpress.com/2009/04/27/applicationcontext/</link>
		<comments>http://seeazee.wordpress.com/2009/04/27/applicationcontext/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 13:33:02 +0000</pubDate>
		<dc:creator>Abdul Aziz</dc:creator>
				<category><![CDATA[J2EE]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://seeazee.wordpress.com/2009/06/16/applicationcontext/</guid>
		<description><![CDATA[An ApplicationContext is much the same as a BeanFactory But an ApplicationContext offers much more: -&#62; provide a means for resolving text messages. -&#62; provide a generic way to load file resources. -&#62; publish events to beans that are registered as listeners. ApplicationContext are three that are commonly used: ClassPathXmlApplicationContext—Loads a context definition from an [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeazee.wordpress.com&amp;blog=3830637&amp;post=52&amp;subd=seeazee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>An <strong>ApplicationContext</strong> is much the same as a <strong>BeanFactory</strong> But an ApplicationContext offers much more:
</p>
<p>-&gt; provide a means for resolving text messages.
</p>
<p>-&gt; provide a generic way to load file resources.
</p>
<p>-&gt; publish events to beans that are registered as listeners.
</p>
<p>ApplicationContext are <strong>three</strong> that are commonly used:
</p>
<p><strong>ClassPathXml</strong>ApplicationContext—Loads a context definition from an XML file located in the classpath, treating context definition files as classpath resources.
</p>
<p><strong>FileSystemXml</strong>ApplicationContext—Loads a context definition from an XML file in the file system.
</p>
<p><strong>XmlWeb</strong>ApplicationContext—Loads context definitions from an XML file contained within a web application.
</p>
<p><span style="color:#4f81bd;">ApplicationContext context = new FileSystemXmlApplicationContext(&#8220;beans.xml&#8221;);<br />
</span></p>
<p><span style="color:#4f81bd;">ApplicationContext context = new ClassPathXmlApplicationContext(&#8220;beans.xml&#8221;);<br />
</span></p>
<p><strong>FileSystemXmlApplicationContext</strong> will look for <strong>beans.xml</strong> in a specific location within the file system, whereas Class <strong>PathXmlApplicationContext </strong>will look for foo.xml anywhere in the classpath.
</p>
<p>A <strong>bean factory</strong> lazily loads all beans, deferring bean creation until the getBean() method is called. An <strong>application context</strong> is a bit smarter and preloads all singleton beans upon context startup. <span style="text-decoration:underline;">By preloading singleton beans, you ensure that they will be ready to use when needed—your application won&#8217;t have to wait for them to be created.<br />
</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/seeazee.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/seeazee.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/seeazee.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/seeazee.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/seeazee.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/seeazee.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/seeazee.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/seeazee.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/seeazee.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/seeazee.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/seeazee.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/seeazee.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/seeazee.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/seeazee.wordpress.com/52/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeazee.wordpress.com&amp;blog=3830637&amp;post=52&amp;subd=seeazee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://seeazee.wordpress.com/2009/04/27/applicationcontext/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Abdul Aziz</media:title>
		</media:content>
	</item>
		<item>
		<title>Autowiring</title>
		<link>http://seeazee.wordpress.com/2009/04/24/autowiring/</link>
		<comments>http://seeazee.wordpress.com/2009/04/24/autowiring/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 13:51:24 +0000</pubDate>
		<dc:creator>Abdul Aziz</dc:creator>
				<category><![CDATA[J2EE]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://seeazee.wordpress.com/2009/06/16/autowiring/</guid>
		<description><![CDATA[Normally in Spring bean&#8217;s properties are wired using either the &#60;constructor-arg&#62; or the &#60;property&#62; element. Spring automatically figure out how to wire beans together by setting the autowire property on each &#60;bean&#62; that you want Spring to autowire. Spring provides four flavors of autowiring byName—Attempts to find a bean in the container whose name (or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeazee.wordpress.com&amp;blog=3830637&amp;post=53&amp;subd=seeazee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Normally in Spring bean&#8217;s properties are wired using either the <span style="color:#4f81bd;">&lt;constructor-arg&gt;</span> or the <span style="color:#4f81bd;">&lt;property&gt;</span> element.
</p>
<p>Spring automatically figure out how to wire beans together by setting the <strong>autowire</strong> property on each &lt;bean&gt; that you want Spring to autowire.
</p>
<p><span style="text-decoration:underline;">Spring provides four flavors of autowiring<br />
</span></p>
<p><strong>byName</strong>—Attempts to find a bean in the container whose name (or ID) is the same as the name of the property being wired. If a matching bean is not found, the property will remain unwired.
</p>
<p><strong>byType</strong>—Attempts to find a single bean in the container whose type matches the type of the property being wired. If no matching bean is found, the property will not be wired. If more than one bean matches, an <span style="color:#4f81bd;">org.springframework.beans.factory.UnsatisfiedDependencyException</span> will be thrown.
</p>
<p><strong>constructor</strong>—Tries to match up one or more beans in the container with the parameters of one of the constructors of the bean being wired. In the event of ambiguous beans or ambiguous constructors, an <span style="color:#4f81bd;">org.springframework.beans.factory.UnsatisfiedDependencyException </span>will be thrown.
</p>
<p><strong>autodetect</strong>—Attempts to autowire by constructor first and then using byType. Ambiguity is handled the same way as with constructor and byType wiring
</p>
<p><strong>Autowiring</strong> by default: means beans will not be autowired unless you set the autowire attribute. However, you can set a default autowiring for all beans within the Spring context by setting default-autowire on the root &lt;beans&gt; element:
</p>
<p>&lt;beans <span style="color:#4f81bd;"><strong>default-autowire</strong>=&#8221;byName&#8221;&gt;</span> &#8212; &lt;/beans&gt;
</p>
<p>You can also do Mixing auto with explicit wiring.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/seeazee.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/seeazee.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/seeazee.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/seeazee.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/seeazee.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/seeazee.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/seeazee.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/seeazee.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/seeazee.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/seeazee.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/seeazee.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/seeazee.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/seeazee.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/seeazee.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeazee.wordpress.com&amp;blog=3830637&amp;post=53&amp;subd=seeazee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://seeazee.wordpress.com/2009/04/24/autowiring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Abdul Aziz</media:title>
		</media:content>
	</item>
		<item>
		<title>Spring Bean Scoping</title>
		<link>http://seeazee.wordpress.com/2009/04/20/spring-bean-scoping/</link>
		<comments>http://seeazee.wordpress.com/2009/04/20/spring-bean-scoping/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 14:21:15 +0000</pubDate>
		<dc:creator>Abdul Aziz</dc:creator>
				<category><![CDATA[J2EE]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://seeazee.wordpress.com/2009/06/16/spring-bean-scoping/</guid>
		<description><![CDATA[  By default, all Spring beans are singletons. To force Spring to produce a new bean instance each time one is needed, you should declare the bean&#8217;s scope attribute to be prototype.    <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeazee.wordpress.com&amp;blog=3830637&amp;post=55&amp;subd=seeazee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>
 </p>
<p>By default, all Spring beans are singletons. To force Spring to produce a new bean instance each time one is needed, you should declare the bean&#8217;s scope attribute to be <strong>prototype</strong>.
</p>
<p>
 </p>
<p><img src="http://seeazee.files.wordpress.com/2009/06/061609_1421_springbeans1.png?w=600">
	</p>
<p>
 </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/seeazee.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/seeazee.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/seeazee.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/seeazee.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/seeazee.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/seeazee.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/seeazee.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/seeazee.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/seeazee.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/seeazee.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/seeazee.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/seeazee.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/seeazee.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/seeazee.wordpress.com/55/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeazee.wordpress.com&amp;blog=3830637&amp;post=55&amp;subd=seeazee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://seeazee.wordpress.com/2009/04/20/spring-bean-scoping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Abdul Aziz</media:title>
		</media:content>

		<media:content url="http://seeazee.files.wordpress.com/2009/06/061609_1421_springbeans1.png" medium="image" />
	</item>
		<item>
		<title>Spring: AOP</title>
		<link>http://seeazee.wordpress.com/2009/04/16/spring-aop/</link>
		<comments>http://seeazee.wordpress.com/2009/04/16/spring-aop/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 14:51:39 +0000</pubDate>
		<dc:creator>Abdul Aziz</dc:creator>
				<category><![CDATA[J2EE]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://seeazee.wordpress.com/2009/06/16/spring-aop/</guid>
		<description><![CDATA[Aspects are often described in terms of advice, pointcuts, and joinpoints. Advice: the job of an aspect is called advice; Advice defines both what and the when of an aspect describing the job that an aspect will perform, advice addresses the question of when to perform the job. Before a method or after the method [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeazee.wordpress.com&amp;blog=3830637&amp;post=56&amp;subd=seeazee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Aspects are often described in terms of <span style="color:#4f81bd;"><strong>advice</strong>, <strong>pointcuts</strong>, and <strong>joinpoints</strong>.</span>
	</p>
<p><span style="font-family:Arial;font-size:10pt;"><strong>Advice: </strong>the job of an aspect is called <em>advice</em>; Advice defines both <em>what</em> and the <em>when</em> of an aspect describing the job that an aspect will perform, advice addresses the question of when to perform the job. Before a method or after the method is invoked.<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;"><strong>Joinpoint: </strong>A joinpoint is a point in the execution of the application where an aspect can be plugged in. This point could be a <em>method</em> being called, an <em>exception</em> being thrown, or even a <em>field</em> being modified. These are the points where your aspect&#8217;s code can be inserted into the normal flow of your application to add new behavior.<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;"><strong>Pointcut</strong>: pointcuts define the where. A pointcut definition matches one or more joinpoints at which advice should be woven<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;"><strong>Aspect: </strong>An aspect is the merger of advice and pointcuts<br />
</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/seeazee.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/seeazee.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/seeazee.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/seeazee.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/seeazee.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/seeazee.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/seeazee.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/seeazee.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/seeazee.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/seeazee.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/seeazee.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/seeazee.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/seeazee.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/seeazee.wordpress.com/56/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeazee.wordpress.com&amp;blog=3830637&amp;post=56&amp;subd=seeazee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://seeazee.wordpress.com/2009/04/16/spring-aop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Abdul Aziz</media:title>
		</media:content>
	</item>
		<item>
		<title>Spring MVC: Handling exceptions</title>
		<link>http://seeazee.wordpress.com/2009/03/31/spring-mvc-handling-exceptions/</link>
		<comments>http://seeazee.wordpress.com/2009/03/31/spring-mvc-handling-exceptions/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 11:14:52 +0000</pubDate>
		<dc:creator>Abdul Aziz</dc:creator>
				<category><![CDATA[J2EE]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://seeazee.wordpress.com/2009/03/31/spring-mvc-handling-exceptions/</guid>
		<description><![CDATA[SimpleMappingExceptionResolver comes to the rescue when an exception is thrown from a controller. Use the following &#60;bean&#62; definition to configure SimpleMappingExceptionResolver to gracefully handle any java.lang.Exceptions thrown from Spring MVC controllers: &#60;bean id=&#8221;exceptionResolver&#8221; class=&#8221;org.springframework.web. ➥ servlet.handler.SimpleMappingExceptionResolver&#8221;&#62; &#60;property name=&#8221;exceptionMappings&#8221;&#62; &#60;props&#62; &#60;prop key=&#8221;java.lang.Exception&#8221;&#62;someError&#60;/prop&#62; &#60;/props&#62; &#60;/property&#62; &#60;/bean&#62; The exceptionMappings property takes a java.util.Properties that contains a mapping of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeazee.wordpress.com&amp;blog=3830637&amp;post=46&amp;subd=seeazee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#0070c0;font-family:Courier New;font-size:10pt;">SimpleMappingExceptionResolver</span><span style="color:black;"><span style="font-family:Courier New;font-size:10pt;"><br />
			</span><span style="font-family:Times New Roman;font-size:10pt;">comes to the rescue when an exception is thrown from a </span></span><span style="color:#0070c0;font-family:Times New Roman;font-size:10pt;">controller</span><span style="color:black;"><span style="font-family:Times New Roman;font-size:10pt;">. Use the following </span><span style="font-family:Courier New;font-size:10pt;">&lt;bean&gt; </span><span style="font-family:Times New Roman;font-size:10pt;">definition to configure </span><span style="font-family:Courier New;font-size:10pt;">SimpleMappingExceptionResolver </span><span style="font-family:Times New Roman;font-size:10pt;">to gracefully handle any </span><span style="font-family:Courier New;font-size:10pt;">java.lang.Exception</span><span style="font-family:Times New Roman;"><span style="font-size:10pt;">s thrown from Spring </span><span style="font-size:9pt;">MVC </span><span style="font-size:10pt;">controllers:<br />
</span></span></span></p>
<p><span style="color:gray;font-family:Courier New;font-size:8pt;">&lt;bean id=&#8221;exceptionResolver&#8221; class=&#8221;org.springframework.web.<br />
</span></p>
<p><span style="color:gray;"><span style="font-size:10pt;"><span style="font-family:MS Mincho;">➥</span><span style="font-family:Arial;"><br />
				</span></span><span style="font-family:Courier New;font-size:8pt;">servlet.handler.SimpleMappingExceptionResolver&#8221;&gt;<br />
</span></span></p>
<p><span style="color:gray;font-family:Courier New;font-size:8pt;">&lt;property name=&#8221;exceptionMappings&#8221;&gt;<br />
</span></p>
<p><span style="color:gray;font-family:Courier New;font-size:8pt;">&lt;props&gt;<br />
</span></p>
<p><span style="color:gray;font-family:Courier New;font-size:8pt;">&lt;prop key=&#8221;java.lang.Exception&#8221;&gt;someError&lt;/prop&gt;<br />
</span></p>
<p><span style="color:gray;font-family:Courier New;font-size:8pt;">&lt;/props&gt;<br />
</span></p>
<p><span style="color:gray;font-family:Courier New;font-size:8pt;">&lt;/property&gt;<br />
</span></p>
<p><span style="color:gray;font-family:Courier New;font-size:8pt;">&lt;/bean&gt;<br />
</span></p>
<p><span style="color:black;"><span style="font-family:Times New Roman;font-size:10pt;">The </span><span style="font-family:Courier New;font-size:10pt;">exceptionMappings </span><span style="font-family:Times New Roman;font-size:10pt;">property takes a </span></span><span style="color:#0070c0;font-family:Courier New;font-size:10pt;">java.util.Properties</span><span style="color:black;"><span style="font-family:Courier New;font-size:10pt;"><br />
			</span><span style="font-family:Times New Roman;font-size:10pt;">that contains a mapping of fully qualified exception class names to logical view names.<br />
</span></span></p>
<p><span style="font-family:Times New Roman;font-size:10pt;">The base </span><span style="font-family:Courier New;font-size:10pt;">Exception </span><span style="font-family:Times New Roman;font-size:10pt;">class is mapped to the </span><span style="font-family:Courier New;font-size:10pt;">View </span><span style="font-family:Times New Roman;font-size:10pt;">whose logical name is </span><span style="font-family:Courier New;font-size:10pt;">someError </span><span style="font-family:Times New Roman;font-size:10pt;">so that if any errors are thrown, users won&#8217;t have to see an ugly stack trace in their browser. When a controller throws an </span><span style="font-family:Courier New;font-size:10pt;">Exception</span><span style="font-family:Times New Roman;font-size:10pt;">, </span><span style="font-family:Courier New;font-size:10pt;"><strong>SimpleMappingExceptionResolver</strong><br />
		</span><span style="font-family:Times New Roman;font-size:10pt;">will resolve it to </span><span style="font-family:Courier New;font-size:10pt;">someError</span><span style="font-family:Times New Roman;font-size:10pt;">, which in turn will be resolved to a </span><span style="font-family:Courier New;font-size:10pt;">View </span><span style="font-family:Times New Roman;font-size:10pt;">using whatever view resolver(s) are configured.</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/seeazee.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/seeazee.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/seeazee.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/seeazee.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/seeazee.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/seeazee.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/seeazee.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/seeazee.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/seeazee.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/seeazee.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/seeazee.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/seeazee.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/seeazee.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/seeazee.wordpress.com/46/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeazee.wordpress.com&amp;blog=3830637&amp;post=46&amp;subd=seeazee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://seeazee.wordpress.com/2009/03/31/spring-mvc-handling-exceptions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Abdul Aziz</media:title>
		</media:content>
	</item>
		<item>
		<title>Throwaway controllers</title>
		<link>http://seeazee.wordpress.com/2009/03/31/throwaway-controllers/</link>
		<comments>http://seeazee.wordpress.com/2009/03/31/throwaway-controllers/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 11:09:19 +0000</pubDate>
		<dc:creator>Abdul Aziz</dc:creator>
				<category><![CDATA[J2EE]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://seeazee.wordpress.com/2009/03/31/throwaway-controllers/</guid>
		<description><![CDATA[Throwaway controllers are significantly simpler than the other controllers, as evidenced by the ThrowawayController interface: To create your own throwaway controller, all you must do is implement this interface and place the program logic in the execute() method Instead of being given parameters through an HttpServletRequest or a command object, throwaway controllers act as their [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeazee.wordpress.com&amp;blog=3830637&amp;post=45&amp;subd=seeazee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:Arial;font-size:10pt;">Throwaway controllers are significantly simpler than the other controllers, as evidenced by the <span style="color:#0070c0;">ThrowawayController</span> interface:<br />
</span></p>
<p><span style="color:gray;font-family:Arial;font-size:10pt;"> </span></p>
<p><pre class="brush: java;">
public interface ThrowawayController {

ModelAndView execute() throws Exception;
{
}
}</pre></p>
<p><span style="font-family:Arial;font-size:10pt;">To create your own throwaway controller, all you must do is implement this interface and place the program logic in the <span style="color:#0070c0;">execute()</span> method<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Instead of being given parameters through an HttpServletRequest or a command object, throwaway controllers act as their own command object.<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">The execute() method in throwaway must return a ModelAndView object when it has finished. Just as with any controller, you also must declare throwaway controllers in the DispatcherServlet&#8217;s context configuration file.<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">But the scope attribute has been set to <span style="color:#0070c0;">prototype</span>. By default all beans are singletons.<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;">Setting scope to prototype tells Spring to throw the controller away after it has been used and to instantiate a fresh instance for each request.<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;"><span style="color:black;">You must tell DispatcherServlet to use a different handler adapter. Specifically, you must configure </span><span style="color:#0070c0;">ThrowawayControllerHandlerAdapter</span><span style="color:black;"> as follows:<br />
</span></span></p>
<p><span style="color:gray;font-family:Arial;font-size:10pt;">&lt;bean id=&#8221;throwawayHandler&#8221; class=&#8221;org.springframework.web.<br />
</span></p>
<p><span style="color:gray;font-size:10pt;"><span style="font-family:MS Mincho;">➥</span><span style="font-family:Arial;"> servlet.mvc.throwaway.ThrowawayControllerHandlerAdapter&#8221;/&gt;<br />
</span></span></p>
<p><span style="color:black;font-family:Arial;font-size:10pt;">By just declaring this bean, you are telling DispatcherServlet to replace its default handler adapter with ThrowawayControllerHandlerAdapter.<br />
</span></p>
<p><span style="font-family:Arial;font-size:10pt;"><span style="color:black;">Consequently, you still need DispatcherServlet to use its regular handler adapter as well. Thus, you should also declare </span><span style="color:#0070c0;">SimpleControllerHandlerAdapter</span><span style="color:black;"> as follows:<br />
</span></span></p>
<p><span style="color:gray;font-family:Arial;font-size:10pt;">&lt;bean id=&#8221;simpleHandler&#8221; class=&#8221;org.springframework.web.<br />
</span></p>
<p><span style="color:gray;font-size:10pt;"><span style="font-family:MS Mincho;">➥</span><span style="font-family:Arial;"> servlet.mvc.SimpleControllerHandlerAdapter&#8221;/&gt;<br />
</span></span></p>
<p><span style="color:black;font-family:Arial;font-size:10pt;">Declaring both handler adapters lets you mix both types of controllers in the same application.</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/seeazee.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/seeazee.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/seeazee.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/seeazee.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/seeazee.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/seeazee.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/seeazee.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/seeazee.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/seeazee.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/seeazee.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/seeazee.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/seeazee.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/seeazee.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/seeazee.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=seeazee.wordpress.com&amp;blog=3830637&amp;post=45&amp;subd=seeazee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://seeazee.wordpress.com/2009/03/31/throwaway-controllers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Abdul Aziz</media:title>
		</media:content>
	</item>
	</channel>
</rss>
