What Is New in Spring Framework 1.2
Spring Framework 1.2 delivers a substantial update focused on expanding its web capabilities, refining data access, and enhancing overall developer productivity. This release solidifies Spring's position as a comprehensive foundation for enterprise Java development.
| Category | Key Highlights |
|---|---|
| New Features | JSR-168 Portlet support, CGLIB-based AOP proxies (no interfaces required), enhanced JMS support, and new JSP tags for Spring bindings. |
| Web Framework Improvements | Major upgrades to Spring Web MVC, including support for Portlets, JSTL, Velocity, and improved handler mappings. |
| Data Access & Transactions | Introduction of the @Transactional annotation for declarative transaction management and a new JpaTemplate for JPA. |
| Middleware & Integration | Enhanced support for JMX, JCA CCI, and Quartz integration. New abstractions for JMS and email. |
| Core Container | Bean definition enhancements, improved event handling, and the introduction of the BeanFactoryUtils class for utility operations. |
| Deprecated Features | The older BeanFactory hierarchy (e.g., XmlBeanFactory) began its phase-out in favor of ApplicationContext. |
How did Spring 1.2 improve web application development?
The web layer received the most significant overhaul. The introduction of JSR-168 Portlet support allowed developers to build portal applications using the same consistent Spring MVC programming model. This meant you could write a controller once and have it work in both servlet and portlet environments.
Support for additional view technologies like JSTL and Velocity was a major practical win. It gave teams the freedom to choose the templating engine that best fit their skills and project requirements, moving beyond just JSP. The new Spring JSP tags also simplified form binding and data display, cutting down on boilerplate scriptlet code.
What changed in data access and transaction management?
Spring 1.2 made declarative transaction management much cleaner with the introduction of the @Transactional annotation. While the XML configuration was still fully supported, the annotation offered a less verbose and more intuitive way to define transaction boundaries right on your service methods.
For developers adopting the then-emerging Java Persistence API (JPA), the new JpaTemplate provided a familiar, Spring-style template that handled resource management and exception translation. This followed the same pattern as the established JdbcTemplate and HibernateTemplate, creating a consistent data access experience across different technologies.
Why was the CGLIB proxy support a big deal for AOP?
Prior to 1.2, Spring AOP proxies required Java interfaces. This was a limitation for legacy code or classes that couldn't be refactored to implement an interface. The new CGLIB-based proxy engine removed this constraint entirely.
In practice, this meant you could apply Spring's declarative transactions and other AOP advice to any plain old Java object (POJO), even if it didn't implement any interface. It greatly increased the framework's flexibility and reduced the friction of adopting AOP in existing projects.
What middleware and integration features were added?
This release significantly boosted Spring's integration story. The JMX support became more comprehensive, making it easier to expose and manage your application beans as JMX MBeans. For scheduled tasks, first-class support for the Quartz scheduler was added, providing a cleaner alternative to custom timer threads.
New abstractions for JMS and email simplified working with these Java EE APIs. The JCA CCI support improved integration with legacy or proprietary Enterprise Information Systems. These additions meant Spring could serve as the unified backbone for more complex, multi-faceted enterprise applications.
FAQ
Can I use Spring 1.2 to build a portal application?
Yes, absolutely. The key new feature is full support for the JSR-168 Portlet API. You can use your existing Spring MVC knowledge and controllers to build portlets, sharing logic between servlet and portlet environments.
Do I need interfaces for AOP proxies in Spring 1.2?
No, you don't. The new CGLIB-based proxy engine allows you to apply AOP advice (like @Transactional) directly to concrete classes without requiring them to implement an interface.
What's the new way to declare transactions?
While XML-based configuration is still supported, Spring 1.2 introduces the @Transactional annotation. You can place it on your service layer methods for a more concise and metadata-driven approach to transaction demarcation.
Is JPA supported in this release?
Yes, Spring 1.2 adds initial support for the Java Persistence API (JPA) through the new JpaTemplate helper class. It follows the familiar Spring template pattern for consistent exception translation and resource management.
What view technologies are supported besides JSP?
Spring 1.2 expands support to include JSTL and Apache Velocity. This gives developers more choice for view rendering and helps teams leverage existing templating skills.