Marketplace for Content, Tests and Assessment
 
 

Archive

Posts Tagged ‘spring 3.0’

Spring adds JSON support

January 27th, 2010 Vinay No comments

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’s comment. We apologize to our users. Here is the post JSON JavaScript Tutorial.   JSON is really cool and gives a lot of power in hands of developer.

Spring 3.0 which has come up with a lot of simplification like asynchronous method invocation , 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 AJAX Simplification in Spring 3

PS: Last time I checked out the spring blog,  the above url was pointing to wrong post. They might have fixed it by now

Asynchronous method invocation in Spring 3.0

January 13th, 2010 Vinay 6 comments

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 where in user registers and system has to send confirmation mail or any similar task where you do not want to block user.

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. Read more…

Spring Framework 3.0 M3 released

June 25th, 2009 Vinay 1 comment

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 of Java 5 features like generics, varargs and other language improvements.  The code is still compatible with older versions of Java

3. Spring Expression Language – Spring has introduced an expression language which is similar to Unified EL in its syntax but offers significantly more features

The following is an example of how the Expression Language can be used to configure some properties of a database setup

<bean class=“mycompany.RewardsTestDatabase”> <property name=“databaseName” value=“#{systemProperties.databaseName}”/> <property name=“keyGenerator” value=“#{strategyBean.databaseKeyGenerator}”/> </bean>

4. Some core features from the JavaConfig project have been added to the Spring Framework now. This means that the following annotations are now directly supported:

  • @Configuration
  • @Bean
  • @Primary
  • @Lazy
  • @Import
  • @Value

5. Additional annotations such as @CookieValue and @RequestHeaders have been added

6. Early support for asynchronous method invocations through the use of the new @Async annotation (or EJB 3.1’s @Asynchronous annotation).

7. The most exciting new feature for the Web Tier is the support for building RESTful web services and web applications

8. Object to XML mapping functionality (OXM) from the Spring Web Services project has been moved to the core Spring Framework now

9. Extended support for meta-annotations: Spring’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

@Service
@Scope(“request”)
@Transactional(rollbackFor=Exception.class)

@Retention(RetentionPolicy.RUNTIME)
public @interface MyService {
}@MyService
public class RewardsService {

}

Source :  Spring 3.0 documentation

Get Adobe Flash playerPlugin by wpburn.com wordpress themes