Spring - Other

springmvc

What are the major features in different versions of Spring?

  1. Spring 2.5 made annotation-driven configuration possible
  2. Spring 3.0 made great use of the Java 5 improvements
  3. Spring 4.0 is the first version to fully support Java 8 features. To use Spring 4.0, you need at least Java 6.

What are the latest specification supported by Spring 4.0?

Spring 4.0 support Java EE 7 specification

  1. JMS 2.0
  2. JTA 1.2
  3. JPA 2.1
  4. Bean Validation 1.1
  5. JSR-236 for Concurrency

Can you describe some of the new features in Spring 4.0 and 4.1?

  1. spring-websocket module provides support for WebSocket-based communication
  2. Spring 4.0 focused on Servlet 3.0 environments
  3. @RestController annotation is introduced
  4. Spring 4.1 introduces @JmsListener annotations to easily register JMS listener endpoints
  5. Spring 4.1 support JCache (JSR-107) annotation using Spring's existing cache configuration.
  6. Jackson's @JsonViewissupporteddirectlyon @ResponseBodyAndResponseEntitycontroller methods for serialization of details of the same POJO

How is Spring's Singleton bean different from Gang of Four Singleton pattern?

The singleton scope is the default scope in Spring. GoF defines Singleton as having one and only one instance per ClassLoader. However, Spring singleton is defined as one instance of bean definition per container.

How can we represent stateful bean in Spring?

Stateful beans are represented in Spring with a prototype scope. A new instance is created every time a request for the bean is made. For example: <bean id="state" class="com.foo.SomeState" scope="prototype"/>

What is the purpose of the JSR 303 and JSR 349?

The JSR 303 and JSR 349 defines specification for the Bean Validation API (version 1.0 and 1.1, respectively), and Hibernate Validator is the reference implementation.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License