<?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/"
	>

<channel>
	<title>Free practice test , mock test, driving test, interview questions &#187; spring 3.0</title>
	<atom:link href="http://www.skill-guru.com/blog/tag/spring-3-0/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.skill-guru.com/blog</link>
	<description>Find free mock and practice test, create and sell tests</description>
	<lastBuildDate>Mon, 16 Jan 2012 16:53:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Spring certifications tests at Skill-guru</title>
		<link>http://www.skill-guru.com/blog/2011/05/02/spring-certifications-tests-at-skill-guru/</link>
		<comments>http://www.skill-guru.com/blog/2011/05/02/spring-certifications-tests-at-skill-guru/#comments</comments>
		<pubDate>Mon, 02 May 2011 18:03:09 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[Mock  Exam / Certifications]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[spring 3.0]]></category>

		<guid isPermaLink="false">http://www.skill-guru.com/blog/?p=4024</guid>
		<description><![CDATA[For users  who have been taking the Spring certification practice tests 1 and  Spring certification practice tests 2 at skill-guru  have raise the concern that
We have contacted the creator of these tests Ikoko , and he has clarified thatthe Spring documentation for the exam syllabus has changed  (improved) since he had created the exam [...]]]></description>
			<content:encoded><![CDATA[<p>For users  who have been taking the <a href="http://www.skill-guru.com/test/81/core-spring-3.0-certification-mock">Spring certification practice tests 1</a> and <a href="http://www.skill-guru.com/test/86/core-spring-3.0-certification-mock-test-2"> Spring certification practice tests 2</a> at skill-guru  have raise the concern that</p>
<p>We have contacted the creator of these tests <a href="http://www.skill-guru.com/guru/ikoko">Ikoko</a> , and he has clarified thatthe Spring documentation for the exam syllabus has changed  (improved) since he had created the exam so the  tests now appear to be different to the syllabus</p>
<p>The  historical documentation and support for the certification has been poor  from Spring and might even be incorrect.</p>
<p>he also pointed out that <a href="http://www.skill-guru.com">Skill-guru</a> test-takers basing their  opinions on the Spring documentation and not actually doing the Spring  exam are therefore possibly misled by the official documentation</p>
<p>From Ikoko&#8217;s email</p>
<blockquote><p>I  sat both the 2.5 exam and 3.0 exam so have experienced both exams  first-hand and have been keen to keep my exams accurate based on real  exam-experience and not any vague syllabus published by Spring</p>
<p>Having  said all, this at a higher topic level I only noticed the category of  SpEL (Spring expression language) being a category in my tests that was  not in the offical syllabus. I had 1 SpEL question in test 1, and 2  questions in test 2. I have now removed all three questions.</p></blockquote>
<p>Hope  this clarifies the doubt of our readers and thanks to MaggieL and Shane Mannion for pointing this out</p>
]]></content:encoded>
			<wfw:commentRss>http://www.skill-guru.com/blog/2011/05/02/spring-certifications-tests-at-skill-guru/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring 3 MVC &#8211; Using mvc:interceptors</title>
		<link>http://www.skill-guru.com/blog/2011/03/30/spring-3-mvc-using-mvc-interceptors/</link>
		<comments>http://www.skill-guru.com/blog/2011/03/30/spring-3-mvc-using-mvc-interceptors/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 01:02:35 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[Programming / tutorials]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[nocache]]></category>
		<category><![CDATA[spring 3.0]]></category>

		<guid isPermaLink="false">http://www.skill-guru.com/blog/?p=3969</guid>
		<description><![CDATA[One of the new feature in Spring 3 MVC  has been introduction of  mvc  XML configuration namespace that simplifies the setup of Spring MVC inside the web application.
Spring 3 allows you to intercept the request and response headers without writing the filter explicitly .  Spring&#8217;s handler mapping mechanism includes handler interceptors.
If you would prefer to [...]]]></description>
			<content:encoded><![CDATA[<p>One of the new feature in Spring 3 MVC  has been introduction of  mvc  XML configuration namespace that simplifies the setup of Spring MVC inside the web application.</p>
<p>Spring 3 allows you to intercept the request and response headers without writing the filter explicitly .  Spring&#8217;s handler mapping mechanism includes handler interceptors.</p>
<p>If you would prefer to write a filter explicitly, it has been covered in <a href="../2011/03/27/servlet-filter-to-prevent-no-cache/">Servlet Filter to prevent No Cache</a>.</p>
<blockquote><p>From Spring MVC docs</p>
<p>Interceptors located in the handler mapping must implement       <code>HandlerInterceptor</code> from the       <code>org.springframework.web.servlet</code> package. This       interface defines three methods: one is called       <em>before</em> the actual handler is executed; one is       called <em>after</em> the handler is executed; and one is       called <em>after the complete request has finished</em>.       These       three methods should provide enough flexibility to do all kinds of       preprocessing and postprocessing</p></blockquote>
<p>You have an option in which instead of writing your own custom class, you can modify the servlet-Context.xml file to provide no caching feature</p>
<p>Here is what will go inside the file</p>
<p>&lt;mvc:annotation-driven/&gt;<br />
&lt;mvc:interceptors&gt;<br />
&lt;bean id=&#8221;webContentInterceptor&#8221;&gt;<br />
&lt;property name=&#8221;cacheSeconds&#8221; value=&#8221;0&#8243;/&gt;<br />
&lt;property name=&#8221;useExpiresHeader&#8221; value=&#8221;true&#8221;/&gt;<br />
&lt;property name=&#8221;useCacheControlHeader&#8221; value=&#8221;true&#8221;/&gt;<br />
&lt;property name=&#8221;useCacheControlNoStore&#8221; value=&#8221;true&#8221;/&gt;<br />
&lt;/bean&gt;<br />
&lt;/mvc:interceptors&gt;<span id="more-3969"></span></p>
<p>I am giving the example of No cache but you can add any other property supported .</p>
<p>Remember, these settings will be done in your servlet-Context.xml and not in your application Context file.</p>
<p>The servlet-context.xml is set up when you are configuring the Displatcher Servlet</p>
<p>&lt;servlet&gt;<br />
&lt;servlet-name&gt;appServlet&lt;/servlet-name&gt;<br />
&lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;<br />
&lt;init-param&gt;<br />
&lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;<br />
&lt;param-value&gt;/WEB-INF/spring/servlet-context.xml&lt;/param-value&gt;<br />
&lt;/init-param&gt;<br />
&lt;load-on-startup&gt;0&lt;/load-on-startup&gt;<br />
&lt;/servlet&gt;</p>
<p>The only drawback is that it applies to all your requests and response . So if you would like to cache your images files, it would not allow even to do that.</p>
<p>When will this not work ?</p>
<p>If you are using any other filter mechanism outside Spring MVC , and your pages are not rendered through Dispatcher servlet, then this will not help you out. For eg the dispatcher servlet is configured to server pages behind folder foo/abc.htm, foo/faa/hello.html .</p>
<p>Now you have another set of pages outside foo like /index.html, /myDataView.jsp , then the above changes will not affect the response for these pages.</p>
<p>Reference : <a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html">Spring 3 MVC docs</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.skill-guru.com/blog/2011/03/30/spring-3-mvc-using-mvc-interceptors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring adds JSON support</title>
		<link>http://www.skill-guru.com/blog/2010/01/27/spring-adds-json-support/</link>
		<comments>http://www.skill-guru.com/blog/2010/01/27/spring-adds-json-support/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 04:02:19 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[Programming / tutorials]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[spring 3.0]]></category>

		<guid isPermaLink="false">http://www.skill-guru.com/blog/?p=1639</guid>
		<description><![CDATA[We had posted a tutorial example on JSON  Java script sometimes back. It became a pretty popular post and people gave good feedback about it.  Some how the post got deleted and with it all the user&#8217;s comment. We apologize to our users. Here is the post JSON JavaScript Tutorial.   JSON is really cool and [...]]]></description>
			<content:encoded><![CDATA[<p>We had posted a tutorial example on JSON  Java script sometimes back. It became a pretty popular post and people gave good feedback about it.  Some how the post got deleted and with it all the user&#8217;s comment. We apologize to our users. Here is the post <a href="http://www.skill-guru.com/blog/2010/01/27/json-javascript-tutorial/">JSON JavaScript Tutorial</a>.   JSON is really cool and gives a lot of power in hands of developer.</p>
<p>Spring 3.0 which has come up with a lot of simplification like <a href="http://www.skill-guru.com/blog/2010/01/13/asynchronous-method-invocation-in-spring-3-0/">asynchronous method invocation</a> , have also simplified AJAX calls.  You can now now invoke server side code with JSON and Spring 3 provide support for that. Details on it can be read from Spring Source blog <a href="http://blog.springsource.com/2010/01/25/ajax-simplifications-in-spring-3-0/">AJAX Simplification in Spring 3</a></p>
<p>P<em>S: Last time I checked out the spring blog,  the above url was pointing to wrong post. They might have fixed it by now</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.skill-guru.com/blog/2010/01/27/spring-adds-json-support/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Asynchronous method invocation in Spring 3.0</title>
		<link>http://www.skill-guru.com/blog/2010/01/13/asynchronous-method-invocation-in-spring-3-0/</link>
		<comments>http://www.skill-guru.com/blog/2010/01/13/asynchronous-method-invocation-in-spring-3-0/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 13:20:41 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[Programming / tutorials]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[spring 3.0]]></category>

		<guid isPermaLink="false">http://www.skill-guru.com/blog/?p=1450</guid>
		<description><![CDATA[Spring 3.0  has added  annotation support for both task scheduling and asynchronous method execution.  We will discuss @Async annotation and its uses.
The @Async annotation
The @Async annotation allows invocation of that method to occur asynchronously. In other words, the caller will return immediately upon invocation.
One of the use cases of @Async function can be in situations [...]]]></description>
			<content:encoded><![CDATA[<p>Spring 3.0  has added  annotation support for both task scheduling and asynchronous method execution.  We will discuss @Async annotation and its uses.</p>
<p><strong>The @Async annotation</strong></p>
<p>The @Async annotation allows invocation of that method to occur asynchronously. In other words, the caller will return immediately upon invocation.</p>
<p>One of the use cases of @Async function can be in situations where in user registers and system has to send confirmation mail or any similar task where you do not want to block user.</p>
<p>We will look at the  example below to explain it more clearly . Since for most of you this will be first Spring 3.0 application, please notice the changes in applicationContext.xml.<span id="more-1450"></span></p>
<blockquote><p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;</p>
<p>&lt;beans xmlns=&#8221;http://www.springframework.org/schema/beans&#8221; xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221;<br />
xmlns:p=&#8221;http://www.springframework.org/schema/p&#8221; xmlns:context=&#8221;http://www.springframework.org/schema/context&#8221;<br />
xsi:schemaLocation=&#8221;<br />
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd<br />
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd<br />
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd&#8221;&gt;</p>
<p>&lt;context:component-scan base-package=&#8221;cs&#8221;/&gt;</p>
<p>&lt;/beans&gt;</p></blockquote>
<p>Let us now look at our classes<!--more--></p>
<p><strong>TestService.java</strong></p>
<blockquote><p>import org.springframework.context.support.ClassPathXmlApplicationContext;<br />
import cs.service.RegularService;</p>
<p>public class TestService {</p>
<p>public static void main(String args[]){</p>
<p>ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext(new String[] {<br />
&#8220;applicationContext.xml&#8221;});</p>
<p>RegularService regService = (RegularService) appContext.getBean(&#8220;regularService&#8221;);</p>
<p>regService.registerUser(&#8220;Skill-Guru&#8221;);</p>
<p>}</p>
<p>}</p></blockquote>
<p><strong>RegularService.java</strong></p>
<blockquote><p>import org.springframework.beans.factory.annotation.Autowired;<br />
import org.springframework.stereotype.Service;</p>
<p>import cs.async.MailUtility;</p>
<p>@Service<br />
public class RegularService {</p>
<p>@Autowired<br />
private MailUtility mailUtility ;</p>
<p>public void registerUser(String userName){</p>
<p>System.out.println(&#8221; User registration for  &#8220;+userName +&#8221; complete&#8221;);</p>
<p>mailUtility.sendMail(userName);</p>
<p>System.out.println(&#8221; Registration Complete. Mail will be send after 5 seconds &#8220;);<br />
}</p>
<p>}</p></blockquote>
<p><strong>MailUtility.java</strong></p>
<blockquote><p>import org.springframework.scheduling.annotation.Async;<br />
import org.springframework.stereotype.Component;</p>
<p>@Component<br />
public class MailUtility {</p>
<p>@Async<br />
public void sendMail(String name){</p>
<p>System.out.println(&#8221; I Will be formatting html mail and sending it  &#8220;);</p>
<p>try {<br />
Thread.sleep(5000);</p>
<p>} catch (InterruptedException e) {</p>
<p>e.printStackTrace();<br />
}</p>
<p>System.out.println(&#8221; Asynchronous method call of send email &#8212; Complete &#8220;);</p>
<p>}</p>
<p>}</p></blockquote>
<p>Once you run the TestService.java the output would be</p>
<p><em>User registration for  Skill-Guru complete<br />
I Will be formatting html mail and sending it<br />
Asynchronous method call of send email &#8212; Complete<br />
Registration Complete. Mail will be send after 5 seconds</em></p>
<p>Now wait a minute. This does not look like asynchronous call. What the hell is wrong here ?</p>
<p>We missed <strong>&lt;task:annotation-driven/&gt;</strong> in applicationContext.xml</p>
<p>The modified applicationContext.xml would be</p>
<blockquote><p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;</p>
<p>&lt;beans xmlns=&#8221;http://www.springframework.org/schema/beans&#8221; xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221;<br />
xmlns:p=&#8221;http://www.springframework.org/schema/p&#8221; xmlns:context=&#8221;http://www.springframework.org/schema/context&#8221;<br />
<strong>xmlns:task=&#8221;http://www.springframework.org/schema/task&#8221;</strong><br />
xsi:schemaLocation=&#8221;<br />
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd<br />
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd<br />
<strong>http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd</strong>&#8220;&gt;</p>
<p>&lt;context:component-scan base-package=&#8221;cs&#8221;/&gt;</p>
<p><strong>&lt;task:annotation-driven/&gt;</strong></p>
<p>&lt;/beans&gt;</p></blockquote>
<p>Notice the changes in bold.</p>
<p>Now run your TestService again. The output would be</p>
<p><em>User registration for  Skill-Guru complete<br />
Registration Complete. Mail will be send after 5 seconds<br />
I Will be formatting html mail and sending it</em></p>
<p>The program will not exit and after 5 second you will see</p>
<p><em>Asynchronous method call of send email &#8212; Complete</em></p>
<p>You can see <strong>registerUser</strong> calls <strong>sendMail</strong> and the control is returned back to caller immediately.</p>
<p>Are you preparing for Spring Certification ? Try out the <a href="http://www.skill-guru.com/test/81/core-spring-3.0-certification-mock">Spring certification Mock Practice test</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.skill-guru.com/blog/2010/01/13/asynchronous-method-invocation-in-spring-3-0/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Spring Framework 3.0 M3 released</title>
		<link>http://www.skill-guru.com/blog/2009/06/25/spring-framework-3-0-m3-released/</link>
		<comments>http://www.skill-guru.com/blog/2009/06/25/spring-framework-3-0-m3-released/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 21:05:47 +0000</pubDate>
		<dc:creator>Vinay</dc:creator>
				<category><![CDATA[Programming / tutorials]]></category>
		<category><![CDATA[spring 3.0]]></category>
		<category><![CDATA[spring 3.0 new features]]></category>

		<guid isPermaLink="false">http://www.skill-guru.com/blog/?p=72</guid>
		<description><![CDATA[Spring team has released 3.0 version of their popular Spring source framework. This is a third major release  after 2.0 and 2.5 .
What are the new features in Spring 3.0?
1. The Spring Framework is now based on Java 5, and Java 6 is fully supported.
2. The entire framework code has been revised to take advantage [...]]]></description>
			<content:encoded><![CDATA[<p>Spring team has released 3.0 version of their popular Spring source framework. This is a third major release  after 2.0 and 2.5 .</p>
<p>What are the new features in Spring 3.0?</p>
<p>1. The Spring Framework is now based on Java 5, and Java 6 is fully supported.</p>
<p>2. The entire framework code has been revised to take advantage of Java 5 features  like generics, varargs and other language improvements.  The code is still compatible with older versions of Java</p>
<p>3. Spring Expression Language &#8211; Spring has introduced an expression language which is similar to Unified EL in its  syntax but offers significantly more features</p>
<p>The following is an example of how the Expression Language can be used to  configure some properties of a database setup</p>
<p>&lt;<span>bean</span> <span>class</span>=<span>&#8220;mycompany.RewardsTestDatabase&#8221;</span>&gt;     &lt;<span>property</span> <span>name</span>=<span>&#8220;databaseName&#8221;</span> <span>value</span>=<span>&#8220;#{systemProperties.databaseName}&#8221;</span>/&gt;     &lt;<span>property</span> <span>name</span>=<span>&#8220;keyGenerator&#8221;</span> <span>value</span>=<span>&#8220;#{strategyBean.databaseKeyGenerator}&#8221;</span>/&gt; &lt;<span>/bean</span>&gt;</p>
<p>4. Some core features from the <a href="http://www.springsource.org/javaconfig" target="_top">JavaConfig</a> project  have been added to the Spring Framework now. This means that the following  annotations are now directly supported:</p>
<div>
<ul type="disc">
<li>@Configuration</li>
<li>@Bean</li>
<li>@Primary</li>
<li>@Lazy</li>
<li>@Import</li>
<li>@Value</li>
</ul>
</div>
<p>5. Additional annotations such as <code>@CookieValue</code> and  <code>@RequestHeaders</code> have been added</p>
<p>6. Early support for asynchronous method invocations through the use of the new @Async  annotation (or EJB 3.1&#8217;s @Asynchronous annotation).</p>
<p>7. The most exciting new feature for the Web Tier is the support for building  RESTful web services and web applications</p>
<p>8. Object to XML mapping functionality (OXM) from the Spring Web Services project  has been moved to the core Spring Framework now</p>
<p>9. <strong>Extended support for meta-annotations:</strong> Spring&#8217;s @Scope and @Transactional annotations, as well as specialized stereotypes such as @Service and @Controller, can be applied as meta-annotations on custom annotations now. for eg</p>
<div><strong>@Service<br />
@Scope(&#8220;request&#8221;)<br />
@Transactional(rollbackFor=Exception.class)</strong><br />
@Retention(RetentionPolicy.RUNTIME)<br />
public @interface MyService {<br />
}@MyService<br />
public class RewardsService {<br />
…<br />
}</div>
<p>Source :  Spring 3.0 documentation</p>
]]></content:encoded>
			<wfw:commentRss>http://www.skill-guru.com/blog/2009/06/25/spring-framework-3-0-m3-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

