What's Coming in Spring 3.0

Matt Raible
Matt RaibleWeb Developer, Java Champion, and Developer Advocate at Okta
What’s coming in Spring 3.0


              Matt Raible
      Colorado Software Summit 2008
          http://www.linkedin.com/in/mraible
Agenda

• Introductions
• Spring History
• Spring Overview
• Choose Your Own Adventure
• Q and A
Introductions

 • Your experience with Spring?
 • Your experience with Java and J2EE?
 • What do you hope to learn today?
 • Open Source experience: Ant, Maven,
   Eclipse, Hibernate, Tomcat, JBoss?
 • Favorite IDE? Favorite OS?
Who is Matt Raible?
• Java Blogger since 2002
• Power user of Java Frameworks
• Author of Spring Live and Pro JSP 2.0
• Founder of AppFuse (http://appfuse.org)
• Lead UI Architect at LinkedIn
• Father, Skier, Cyclist and Beer Connoisseur
• http://www.linkedin.com/in/mraible
The Spring Framework


• Simplify J2EE
• Manage Dependencies
• Inversion of Control
• À la carte framework
Spring Mission Statement
Spring Modules
Spring Portfolio
Past Releases

 • March 24, 2004 - Spring 1.0
 • October 5, 2006 - Spring 2.0
 • November 19, 2007 - Spring 2.5
 • January 2009 - Spring 3.0
3.0 Release Schedule

• 3.0 M1 scheduled for September 2008
• 3.0 RC1 scheduled for December 2008
• 3.0 Final in January 2009
New in Spring 2.5
• Extended Platform Support
 • Java SE 6, Java EE 5 and OSGi
• Enhanced AspectJ support
• Comprehensive support for Annotations
 • Bean lifecycle
 • Autowiring
 • Spring MVC enhancements
Annotation Examples
@Repository(value = quot;userDaoquot;)
public class UserDaoHibernate implements UserDao {
    HibernateTemplate hibernateTemplate;

    @Autowired
    public UserDaoHibernate(SessionFactory sessionFactory) {
        this.hibernateTemplate = new HibernateTemplate(sessionFactory);
    }

    public List getUsers() {
        return hibernateTemplate.find(quot;from Userquot;);
    }

    @Transactional
    public void saveUser(User user) {
        hibernateTemplate.saveOrUpdate(user);
    }
}
                           @Service(value = quot;userManagerquot;)
                           public class UserManagerImpl implements UserManager {
                               @Autowired UserDao dao;

                               public List getUsers() {
                                   return dao.getUsers();
                               }
                           }
Annotation Examples
@Repository(value = quot;userDaoquot;)
public class UserDaoHibernate implements UserDao {
    HibernateTemplate hibernateTemplate;

    @Autowired
    public UserDaoHibernate(SessionFactory sessionFactory) {
        this.hibernateTemplate = new HibernateTemplate(sessionFactory);
    }

    public List getUsers() {
        return hibernateTemplate.find(quot;from Userquot;);
    }

    @Transactional
    public void saveUser(User user) {
        hibernateTemplate.saveOrUpdate(user);
    }
}
                           @Service(value = quot;userManagerquot;)
                           public class UserManagerImpl implements UserManager {
                               @Autowired UserDao dao;

                               public List getUsers() {
                                   return dao.getUsers();
                               }
                           }
XML Configuration
Annotation Scanning
<!-- Replaces ${...} placeholders with values from a properties file -->
<!-- (in this case, JDBC-related settings for the dataSource definition below) -->
<context:property-placeholder location=quot;classpath:jdbc.propertiesquot;/>

<!-- Enable @Transactional support -->
<tx:annotation-driven/>

<!-- Enable @AspectJ support -->
<aop:aspectj-autoproxy/>

<!-- Scans for @Repository, @Service and @Component -->
<context:component-scan base-package=quot;org.appfusequot;/>
XML Configuration
Declarative Transactions

 <aop:config>
     <aop:advisor id=quot;managerTxquot; advice-ref=quot;txAdvicequot;
                  pointcut=quot;execution(* *..service.*Manager.*(..))quot;/>
 </aop:config>

 <tx:advice id=quot;txAdvicequot;>
     <tx:attributes>
         <tx:method name=quot;get*quot; read-only=quot;truequot;/>
         <tx:method name=quot;*quot;/>
     </tx:attributes>
 </tx:advice>
Testing
    package org.appfuse.service;

    import   org.appfuse.model.User;
    import   static org.junit.Assert.*;
    import   org.junit.Test;
    import   org.junit.runner.RunWith;
    import   org.springframework.beans.factory.annotation.Autowired;
    import   org.springframework.test.context.ContextConfiguration;
    import   org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
    import   org.springframework.transaction.annotation.Transactional;

    @RunWith(SpringJUnit4ClassRunner.class)
    @ContextConfiguration
    public class UserManagerTest {
        @Autowired
        UserManager userManager;

        @Test
        @Transactional
        public void testGetUsers() {

        }
    }
Spring MVC Improvements
 @Controller
 public class UserController {
     @Autowired
     UserManager userManager;

      @RequestMapping(quot;/usersquot;)
      public String execute(ModelMap model) {
          model.addAttribute(userManager.getUsers());
          return quot;userListquot;;
      }
 }

     <!-- Activates mapping of @Controller -->
     <context:component-scan base-package=quot;org.appfuse.webquot;/>

     <!-- Activates @Autowired for Controllers -->
     <context:annotation-config/>

     <!-- View Resolver for JSPs -->
     <bean id=quot;viewResolverquot;
         class=quot;org.springframework.web.servlet.view.InternalResourceViewResolverquot;>
         <property name=quot;viewClassquot;
                   value=quot;org.springframework.web.servlet.view.JstlViewquot;/>
         <property name=quot;prefixquot; value=quot;/quot;/>
         <property name=quot;suffixquot; value=quot;.jspquot;/>
     </bean>
ModelMap Naming


• Automatically generates a key name
 • o.a.m.User ➟ ‘user’
 • java.util.HashMap ➟ ‘hashMap’
 • o.a.m.User[] ➟ ‘userList’
 • ArrayList, HashSet ➟ ‘userList’
@RequestMapping

• Methods with @RequestMapping are
  allowed very flexible signatures
• Arguments supported:
 • ServletRequest and ServletResponse
 • HttpSession
 • Locale
 • ModelMap
 • http://is.gd/2wly
Spring 2.0 ➟ 2.5
Spring Annotations

http://refcardz.dzone.com/refcardz/spring-annotations
Other Spring Technologies
• Spring Security 2.x with OpenID Support
• Spring Web Flow 2.x
• Spring Remoting (HttpInvoker)
• Spring Web Services
• Spring Batch
• Spring Dynamic Modules
• SpringSource Application Platform
New in Spring 3.0
• Java 5+
• Spring Expression Language
• New Spring MVC Features
 • REST
 • Ajax
 • Declarative Validation
• Backwards compatible with Spring 2.5
Spring Expression Language
• Unified EL++
 • Deferred evaluation of expressions
 • Support for expressions that can set
    values and invoke methods
  • Pluggable API for resolving Expressions
  • Unified EL Reference: http://is.gd/2xqF
  • Spring 3.0 allows usage in XML files and
    @Value annotations
REST Support
               http://infoq.com/articles/rest-introduction
REST with @PathParam

   http://myserver/myapp/show/123

   @RequestMapping(method = RequestMethod.GET)
   public User show(@PathParam Long id) {
   	 return userManager.getUser(id);
   }
REST with RestController
@Controller
public class ResumesController implements RestController<Resume, Long> {
	
	   GET http://myserver/myapp/resumes
	   public List<Resume> index() {}

	   POST http://myserver/myapp/resumes
	   public void create(Resume resume) {}

	   GET http://myserver/myapp/resumes/1
	   public Resume show(Long id) {}

	   DELETE http://myserver/myapp/resumes/1
	   public void delete(Long id) {}

	   PUT http://myserver/myapp/resumes/1
	   public void update(Resume resume) {}
}
JAX-RS Annotations

• JAX-RS: Java API for RESTful Web Services
 • http://jcp.org/en/jsr/detail?id=311
 • http://www.infoq.com/news/2008/10/jaxrs-
    comparison
• @Path, @GET, @PUT, @POST, @DELETE
• @DefaultValue, @PathParam,
  @QueryParam
Dropping Support For...

• Commons Attributes
• TopLink (EclipseLink instead)
• MVC Controller hierarchy
• JUnit 3.8 Test classes
      import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests;

      public class UserManagerTest extends AbstractTransactionalDataSourceSpringContextTests {
          private UserManager userManager;

         public void setUserManager(UserManager userManager) {
             this.userManager = userManager;
         }

         protected String[] getConfigLocations() {
             setAutowireMode(AUTOWIRE_BY_NAME);
             return new String[] {quot;classpath*:/WEB-INF/applicationContext*.xmlquot;};
         }

         protected void onSetUpInTransaction() throws Exception {
             deleteFromTables(new String[] {quot;app_userquot;});
         }
2.5 Community Feedback

• Most common requests for Spring MVC:
 • Add REST Support
 • Add EL Support
 • Add Conversation Support
• 3.0 Targeted Issues:
 • http://snurl.com/3ob7o
Choose Your Own Adventure

• Create a new Spring 3.0 Application with JPA
  and Spring MVC
• Upgrade an existing Spring 2.0 Application to
  Spring 3.0
Get the Source




  http://raibledesigns.com/rd/entry/the_colorado_software_summit_and
Spring 3.0 Kickstart
      http://spring-kickstart.googlecode.com
Spring 2.0 ➟ 3.0
Questions?


matt@raibledesigns.com
http://raibledesigns.com
http://twitter.com/mraible
Download Presentation
 http://raibledesigns.com/rd/page/publications
1 of 35

Recommended

Spring MVC Annotations by
Spring MVC AnnotationsSpring MVC Annotations
Spring MVC AnnotationsJordan Silva
6.1K views16 slides
Spring 3.x - Spring MVC by
Spring 3.x - Spring MVCSpring 3.x - Spring MVC
Spring 3.x - Spring MVCGuy Nir
6.1K views54 slides
Java Server Faces (JSF) - advanced by
Java Server Faces (JSF) - advancedJava Server Faces (JSF) - advanced
Java Server Faces (JSF) - advancedBG Java EE Course
64.1K views55 slides
Spring MVC Basics by
Spring MVC BasicsSpring MVC Basics
Spring MVC BasicsBozhidar Bozhanov
12.4K views14 slides
Introduction to Spring MVC by
Introduction to Spring MVCIntroduction to Spring MVC
Introduction to Spring MVCRichard Paul
6.4K views18 slides
JSP - Java Server Page by
JSP - Java Server PageJSP - Java Server Page
JSP - Java Server PageVipin Yadav
721 views78 slides

More Related Content

What's hot

Spring annotation by
Spring annotationSpring annotation
Spring annotationRajiv Srivastava
3K views6 slides
Jsp presentation by
Jsp presentationJsp presentation
Jsp presentationSher Singh Bardhan
7.6K views24 slides
Data Access with JDBC by
Data Access with JDBCData Access with JDBC
Data Access with JDBCBG Java EE Course
3.3K views48 slides
Grails Advanced by
Grails Advanced Grails Advanced
Grails Advanced Saurabh Dixit
3.6K views75 slides
Developing ASP.NET Applications Using the Model View Controller Pattern by
Developing ASP.NET Applications Using the Model View Controller PatternDeveloping ASP.NET Applications Using the Model View Controller Pattern
Developing ASP.NET Applications Using the Model View Controller Patterngoodfriday
2.7K views66 slides
ASP.NET MVC 4 - Routing Internals by
ASP.NET MVC 4 - Routing InternalsASP.NET MVC 4 - Routing Internals
ASP.NET MVC 4 - Routing InternalsLukasz Lysik
11.4K views41 slides

What's hot(20)

Developing ASP.NET Applications Using the Model View Controller Pattern by goodfriday
Developing ASP.NET Applications Using the Model View Controller PatternDeveloping ASP.NET Applications Using the Model View Controller Pattern
Developing ASP.NET Applications Using the Model View Controller Pattern
goodfriday2.7K views
ASP.NET MVC 4 - Routing Internals by Lukasz Lysik
ASP.NET MVC 4 - Routing InternalsASP.NET MVC 4 - Routing Internals
ASP.NET MVC 4 - Routing Internals
Lukasz Lysik11.4K views
Advanced Dagger talk from 360andev by Mike Nakhimovich
Advanced Dagger talk from 360andevAdvanced Dagger talk from 360andev
Advanced Dagger talk from 360andev
Mike Nakhimovich3.3K views
Switch to React.js from AngularJS developer by Eugene Zharkov
Switch to React.js from AngularJS developerSwitch to React.js from AngularJS developer
Switch to React.js from AngularJS developer
Eugene Zharkov1.2K views
Spring Web MVC by zeeshanhanif
Spring Web MVCSpring Web MVC
Spring Web MVC
zeeshanhanif10.6K views
20150516 modern web_conf_tw by Tse-Ching Ho
20150516 modern web_conf_tw20150516 modern web_conf_tw
20150516 modern web_conf_tw
Tse-Ching Ho1.6K views
Spring 4 advanced final_xtr_presentation by sourabh aggarwal
Spring 4 advanced final_xtr_presentationSpring 4 advanced final_xtr_presentation
Spring 4 advanced final_xtr_presentation
sourabh aggarwal650 views
Workshop 26: React Native - The Native Side by Visual Engineering
Workshop 26: React Native - The Native SideWorkshop 26: React Native - The Native Side
Workshop 26: React Native - The Native Side
Visual Engineering2.8K views
50 new features of Java EE 7 in 50 minutes by Antonio Goncalves
50 new features of Java EE 7 in 50 minutes50 new features of Java EE 7 in 50 minutes
50 new features of Java EE 7 in 50 minutes
Antonio Goncalves22.9K views
Intro to Retrofit 2 and RxJava2 by Fabio Collini
Intro to Retrofit 2 and RxJava2Intro to Retrofit 2 and RxJava2
Intro to Retrofit 2 and RxJava2
Fabio Collini3.1K views
Practical Protocol-Oriented-Programming by Natasha Murashev
Practical Protocol-Oriented-ProgrammingPractical Protocol-Oriented-Programming
Practical Protocol-Oriented-Programming
Natasha Murashev90.3K views
Adding a modern twist to legacy web applications by Jeff Durta
Adding a modern twist to legacy web applicationsAdding a modern twist to legacy web applications
Adding a modern twist to legacy web applications
Jeff Durta354 views
Basic Tutorial of React for Programmers by David Rodenas
Basic Tutorial of React for ProgrammersBasic Tutorial of React for Programmers
Basic Tutorial of React for Programmers
David Rodenas530 views
Lecture 5 JSTL, custom tags, maven by Fahad Golra
Lecture 5   JSTL, custom tags, mavenLecture 5   JSTL, custom tags, maven
Lecture 5 JSTL, custom tags, maven
Fahad Golra2K views

Similar to What's Coming in Spring 3.0

Migrating from Struts 1 to Struts 2 by
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Matt Raible
8.1K views46 slides
ActiveWeb: Chicago Java User Group Presentation by
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentationipolevoy
2K views28 slides
ASP.NET MVC introduction by
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introductionTomi Juhola
2.7K views37 slides
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3) by
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)Carles Farré
1K views37 slides
DWR, Hibernate and Dojo.E - A Tutorial by
DWR, Hibernate and Dojo.E - A TutorialDWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A Tutorialjbarciauskas
2K views34 slides
Retrofitting by
RetrofittingRetrofitting
RetrofittingTed Husted
1.3K views83 slides

Similar to What's Coming in Spring 3.0(20)

Migrating from Struts 1 to Struts 2 by Matt Raible
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2
Matt Raible8.1K views
ActiveWeb: Chicago Java User Group Presentation by ipolevoy
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
ipolevoy2K views
ASP.NET MVC introduction by Tomi Juhola
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introduction
Tomi Juhola2.7K views
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3) by Carles Farré
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
Carles Farré1K views
DWR, Hibernate and Dojo.E - A Tutorial by jbarciauskas
DWR, Hibernate and Dojo.E - A TutorialDWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A Tutorial
jbarciauskas2K views
Retrofitting by Ted Husted
RetrofittingRetrofitting
Retrofitting
Ted Husted1.3K views
Introducing Struts 2 by wiradikusuma
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
wiradikusuma2.6K views
Intro To Mvc Development In Php by funkatron
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
funkatron13.3K views
Asp.Net Mvc by micham
Asp.Net MvcAsp.Net Mvc
Asp.Net Mvc
micham3.1K views
Introduction To ASP.NET MVC by Alan Dean
Introduction To ASP.NET MVCIntroduction To ASP.NET MVC
Introduction To ASP.NET MVC
Alan Dean6K views
Annotation-Based Spring Portlet MVC by John Lewis
Annotation-Based Spring Portlet MVCAnnotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVC
John Lewis5.1K views
Introduction to JSF by SoftServe
Introduction toJSFIntroduction toJSF
Introduction to JSF
SoftServe1.3K views
Strutsjspservlet by Sagar Nakul
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
Sagar Nakul755 views
Strutsjspservlet by Sagar Nakul
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
Sagar Nakul757 views
Struts2 by yuvalb
Struts2Struts2
Struts2
yuvalb2.7K views
Bring the fun back to java by ciklum_ods
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
ciklum_ods640 views

More from Matt Raible

Micro Frontends for Java Microservices - Belfast JUG 2022 by
Micro Frontends for Java Microservices - Belfast JUG 2022Micro Frontends for Java Microservices - Belfast JUG 2022
Micro Frontends for Java Microservices - Belfast JUG 2022Matt Raible
26 views57 slides
Micro Frontends for Java Microservices - Dublin JUG 2022 by
Micro Frontends for Java Microservices - Dublin JUG 2022Micro Frontends for Java Microservices - Dublin JUG 2022
Micro Frontends for Java Microservices - Dublin JUG 2022Matt Raible
19 views56 slides
Micro Frontends for Java Microservices - Cork JUG 2022 by
Micro Frontends for Java Microservices - Cork JUG 2022Micro Frontends for Java Microservices - Cork JUG 2022
Micro Frontends for Java Microservices - Cork JUG 2022Matt Raible
7 views56 slides
Comparing Native Java REST API Frameworks - Seattle JUG 2022 by
Comparing Native Java REST API Frameworks - Seattle JUG 2022Comparing Native Java REST API Frameworks - Seattle JUG 2022
Comparing Native Java REST API Frameworks - Seattle JUG 2022Matt Raible
48 views87 slides
Reactive Java Microservices with Spring Boot and JHipster - Spring I/O 2022 by
Reactive Java Microservices with Spring Boot and JHipster - Spring I/O 2022Reactive Java Microservices with Spring Boot and JHipster - Spring I/O 2022
Reactive Java Microservices with Spring Boot and JHipster - Spring I/O 2022Matt Raible
105 views42 slides
Comparing Native Java REST API Frameworks - Devoxx France 2022 by
Comparing Native Java REST API Frameworks - Devoxx France 2022Comparing Native Java REST API Frameworks - Devoxx France 2022
Comparing Native Java REST API Frameworks - Devoxx France 2022Matt Raible
130 views86 slides

More from Matt Raible(20)

Micro Frontends for Java Microservices - Belfast JUG 2022 by Matt Raible
Micro Frontends for Java Microservices - Belfast JUG 2022Micro Frontends for Java Microservices - Belfast JUG 2022
Micro Frontends for Java Microservices - Belfast JUG 2022
Matt Raible26 views
Micro Frontends for Java Microservices - Dublin JUG 2022 by Matt Raible
Micro Frontends for Java Microservices - Dublin JUG 2022Micro Frontends for Java Microservices - Dublin JUG 2022
Micro Frontends for Java Microservices - Dublin JUG 2022
Matt Raible19 views
Micro Frontends for Java Microservices - Cork JUG 2022 by Matt Raible
Micro Frontends for Java Microservices - Cork JUG 2022Micro Frontends for Java Microservices - Cork JUG 2022
Micro Frontends for Java Microservices - Cork JUG 2022
Matt Raible7 views
Comparing Native Java REST API Frameworks - Seattle JUG 2022 by Matt Raible
Comparing Native Java REST API Frameworks - Seattle JUG 2022Comparing Native Java REST API Frameworks - Seattle JUG 2022
Comparing Native Java REST API Frameworks - Seattle JUG 2022
Matt Raible48 views
Reactive Java Microservices with Spring Boot and JHipster - Spring I/O 2022 by Matt Raible
Reactive Java Microservices with Spring Boot and JHipster - Spring I/O 2022Reactive Java Microservices with Spring Boot and JHipster - Spring I/O 2022
Reactive Java Microservices with Spring Boot and JHipster - Spring I/O 2022
Matt Raible105 views
Comparing Native Java REST API Frameworks - Devoxx France 2022 by Matt Raible
Comparing Native Java REST API Frameworks - Devoxx France 2022Comparing Native Java REST API Frameworks - Devoxx France 2022
Comparing Native Java REST API Frameworks - Devoxx France 2022
Matt Raible130 views
Lock That Sh*t Down! Auth Security Patterns for Apps, APIs, and Infra - Devne... by Matt Raible
Lock That Sh*t Down! Auth Security Patterns for Apps, APIs, and Infra - Devne...Lock That Sh*t Down! Auth Security Patterns for Apps, APIs, and Infra - Devne...
Lock That Sh*t Down! Auth Security Patterns for Apps, APIs, and Infra - Devne...
Matt Raible98 views
Java REST API Framework Comparison - PWX 2021 by Matt Raible
Java REST API Framework Comparison - PWX 2021Java REST API Framework Comparison - PWX 2021
Java REST API Framework Comparison - PWX 2021
Matt Raible148 views
Web App Security for Java Developers - PWX 2021 by Matt Raible
Web App Security for Java Developers - PWX 2021Web App Security for Java Developers - PWX 2021
Web App Security for Java Developers - PWX 2021
Matt Raible135 views
Mobile App Development with Ionic, React Native, and JHipster - Connect.Tech ... by Matt Raible
Mobile App Development with Ionic, React Native, and JHipster - Connect.Tech ...Mobile App Development with Ionic, React Native, and JHipster - Connect.Tech ...
Mobile App Development with Ionic, React Native, and JHipster - Connect.Tech ...
Matt Raible187 views
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Joker... by Matt Raible
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Joker...Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Joker...
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Joker...
Matt Raible140 views
Web App Security for Java Developers - UberConf 2021 by Matt Raible
Web App Security for Java Developers - UberConf 2021Web App Security for Java Developers - UberConf 2021
Web App Security for Java Developers - UberConf 2021
Matt Raible152 views
Java REST API Framework Comparison - UberConf 2021 by Matt Raible
Java REST API Framework Comparison - UberConf 2021Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021
Matt Raible150 views
Native Java with Spring Boot and JHipster - SF JUG 2021 by Matt Raible
Native Java with Spring Boot and JHipster - SF JUG 2021Native Java with Spring Boot and JHipster - SF JUG 2021
Native Java with Spring Boot and JHipster - SF JUG 2021
Matt Raible69 views
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Sprin... by Matt Raible
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Sprin...Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Sprin...
Lock That Shit Down! Auth Security Patterns for Apps, APIs, and Infra - Sprin...
Matt Raible182 views
Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021 by Matt Raible
Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021
Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021
Matt Raible182 views
Get Hip with JHipster - Colorado Springs Open Source User Group 2021 by Matt Raible
Get Hip with JHipster - Colorado Springs Open Source User Group 2021Get Hip with JHipster - Colorado Springs Open Source User Group 2021
Get Hip with JHipster - Colorado Springs Open Source User Group 2021
Matt Raible150 views
JHipster and Okta - JHipster Virtual Meetup December 2020 by Matt Raible
JHipster and Okta - JHipster Virtual Meetup December 2020JHipster and Okta - JHipster Virtual Meetup December 2020
JHipster and Okta - JHipster Virtual Meetup December 2020
Matt Raible226 views
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020 by Matt Raible
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
Matt Raible433 views
Security Patterns for Microservice Architectures - SpringOne 2020 by Matt Raible
Security Patterns for Microservice Architectures - SpringOne 2020Security Patterns for Microservice Architectures - SpringOne 2020
Security Patterns for Microservice Architectures - SpringOne 2020
Matt Raible329 views

Recently uploaded

TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc
77 views29 slides
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates by
Keynote Talk: Open Source is Not Dead - Charles Schulz - VatesKeynote Talk: Open Source is Not Dead - Charles Schulz - Vates
Keynote Talk: Open Source is Not Dead - Charles Schulz - VatesShapeBlue
119 views15 slides
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineShapeBlue
102 views19 slides
Business Analyst Series 2023 - Week 3 Session 5 by
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5DianaGray10
369 views20 slides
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueShapeBlue
131 views23 slides
Ransomware is Knocking your Door_Final.pdf by
Ransomware is Knocking your Door_Final.pdfRansomware is Knocking your Door_Final.pdf
Ransomware is Knocking your Door_Final.pdfSecurity Bootcamp
76 views46 slides

Recently uploaded(20)

TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by TrustArc
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc77 views
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates by ShapeBlue
Keynote Talk: Open Source is Not Dead - Charles Schulz - VatesKeynote Talk: Open Source is Not Dead - Charles Schulz - Vates
Keynote Talk: Open Source is Not Dead - Charles Schulz - Vates
ShapeBlue119 views
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by ShapeBlue
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online
ShapeBlue102 views
Business Analyst Series 2023 - Week 3 Session 5 by DianaGray10
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5
DianaGray10369 views
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue by ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
ShapeBlue131 views
"Surviving highload with Node.js", Andrii Shumada by Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays40 views
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ... by ShapeBlue
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
ShapeBlue65 views
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit... by ShapeBlue
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
Transitioning from VMware vCloud to Apache CloudStack: A Path to Profitabilit...
ShapeBlue57 views
Five Things You SHOULD Know About Postman by Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman40 views
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson133 views
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue by ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueVNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
ShapeBlue85 views
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
ShapeBlue50 views
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive by Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Why and How CloudStack at weSystems - Stephan Bienek - weSystems by ShapeBlue
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystems
ShapeBlue111 views
DRBD Deep Dive - Philipp Reisner - LINBIT by ShapeBlue
DRBD Deep Dive - Philipp Reisner - LINBITDRBD Deep Dive - Philipp Reisner - LINBIT
DRBD Deep Dive - Philipp Reisner - LINBIT
ShapeBlue62 views
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... by Moses Kemibaro
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Moses Kemibaro29 views

What's Coming in Spring 3.0

  • 1. What’s coming in Spring 3.0 Matt Raible Colorado Software Summit 2008 http://www.linkedin.com/in/mraible
  • 2. Agenda • Introductions • Spring History • Spring Overview • Choose Your Own Adventure • Q and A
  • 3. Introductions • Your experience with Spring? • Your experience with Java and J2EE? • What do you hope to learn today? • Open Source experience: Ant, Maven, Eclipse, Hibernate, Tomcat, JBoss? • Favorite IDE? Favorite OS?
  • 4. Who is Matt Raible? • Java Blogger since 2002 • Power user of Java Frameworks • Author of Spring Live and Pro JSP 2.0 • Founder of AppFuse (http://appfuse.org) • Lead UI Architect at LinkedIn • Father, Skier, Cyclist and Beer Connoisseur • http://www.linkedin.com/in/mraible
  • 5. The Spring Framework • Simplify J2EE • Manage Dependencies • Inversion of Control • À la carte framework
  • 9. Past Releases • March 24, 2004 - Spring 1.0 • October 5, 2006 - Spring 2.0 • November 19, 2007 - Spring 2.5 • January 2009 - Spring 3.0
  • 10. 3.0 Release Schedule • 3.0 M1 scheduled for September 2008 • 3.0 RC1 scheduled for December 2008 • 3.0 Final in January 2009
  • 11. New in Spring 2.5 • Extended Platform Support • Java SE 6, Java EE 5 and OSGi • Enhanced AspectJ support • Comprehensive support for Annotations • Bean lifecycle • Autowiring • Spring MVC enhancements
  • 12. Annotation Examples @Repository(value = quot;userDaoquot;) public class UserDaoHibernate implements UserDao { HibernateTemplate hibernateTemplate; @Autowired public UserDaoHibernate(SessionFactory sessionFactory) { this.hibernateTemplate = new HibernateTemplate(sessionFactory); } public List getUsers() { return hibernateTemplate.find(quot;from Userquot;); } @Transactional public void saveUser(User user) { hibernateTemplate.saveOrUpdate(user); } } @Service(value = quot;userManagerquot;) public class UserManagerImpl implements UserManager { @Autowired UserDao dao; public List getUsers() { return dao.getUsers(); } }
  • 13. Annotation Examples @Repository(value = quot;userDaoquot;) public class UserDaoHibernate implements UserDao { HibernateTemplate hibernateTemplate; @Autowired public UserDaoHibernate(SessionFactory sessionFactory) { this.hibernateTemplate = new HibernateTemplate(sessionFactory); } public List getUsers() { return hibernateTemplate.find(quot;from Userquot;); } @Transactional public void saveUser(User user) { hibernateTemplate.saveOrUpdate(user); } } @Service(value = quot;userManagerquot;) public class UserManagerImpl implements UserManager { @Autowired UserDao dao; public List getUsers() { return dao.getUsers(); } }
  • 14. XML Configuration Annotation Scanning <!-- Replaces ${...} placeholders with values from a properties file --> <!-- (in this case, JDBC-related settings for the dataSource definition below) --> <context:property-placeholder location=quot;classpath:jdbc.propertiesquot;/> <!-- Enable @Transactional support --> <tx:annotation-driven/> <!-- Enable @AspectJ support --> <aop:aspectj-autoproxy/> <!-- Scans for @Repository, @Service and @Component --> <context:component-scan base-package=quot;org.appfusequot;/>
  • 15. XML Configuration Declarative Transactions <aop:config> <aop:advisor id=quot;managerTxquot; advice-ref=quot;txAdvicequot; pointcut=quot;execution(* *..service.*Manager.*(..))quot;/> </aop:config> <tx:advice id=quot;txAdvicequot;> <tx:attributes> <tx:method name=quot;get*quot; read-only=quot;truequot;/> <tx:method name=quot;*quot;/> </tx:attributes> </tx:advice>
  • 16. Testing package org.appfuse.service; import org.appfuse.model.User; import static org.junit.Assert.*; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.annotation.Transactional; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration public class UserManagerTest { @Autowired UserManager userManager; @Test @Transactional public void testGetUsers() { } }
  • 17. Spring MVC Improvements @Controller public class UserController { @Autowired UserManager userManager; @RequestMapping(quot;/usersquot;) public String execute(ModelMap model) { model.addAttribute(userManager.getUsers()); return quot;userListquot;; } } <!-- Activates mapping of @Controller --> <context:component-scan base-package=quot;org.appfuse.webquot;/> <!-- Activates @Autowired for Controllers --> <context:annotation-config/> <!-- View Resolver for JSPs --> <bean id=quot;viewResolverquot; class=quot;org.springframework.web.servlet.view.InternalResourceViewResolverquot;> <property name=quot;viewClassquot; value=quot;org.springframework.web.servlet.view.JstlViewquot;/> <property name=quot;prefixquot; value=quot;/quot;/> <property name=quot;suffixquot; value=quot;.jspquot;/> </bean>
  • 18. ModelMap Naming • Automatically generates a key name • o.a.m.User ➟ ‘user’ • java.util.HashMap ➟ ‘hashMap’ • o.a.m.User[] ➟ ‘userList’ • ArrayList, HashSet ➟ ‘userList’
  • 19. @RequestMapping • Methods with @RequestMapping are allowed very flexible signatures • Arguments supported: • ServletRequest and ServletResponse • HttpSession • Locale • ModelMap • http://is.gd/2wly
  • 22. Other Spring Technologies • Spring Security 2.x with OpenID Support • Spring Web Flow 2.x • Spring Remoting (HttpInvoker) • Spring Web Services • Spring Batch • Spring Dynamic Modules • SpringSource Application Platform
  • 23. New in Spring 3.0 • Java 5+ • Spring Expression Language • New Spring MVC Features • REST • Ajax • Declarative Validation • Backwards compatible with Spring 2.5
  • 24. Spring Expression Language • Unified EL++ • Deferred evaluation of expressions • Support for expressions that can set values and invoke methods • Pluggable API for resolving Expressions • Unified EL Reference: http://is.gd/2xqF • Spring 3.0 allows usage in XML files and @Value annotations
  • 25. REST Support http://infoq.com/articles/rest-introduction
  • 26. REST with @PathParam http://myserver/myapp/show/123 @RequestMapping(method = RequestMethod.GET) public User show(@PathParam Long id) { return userManager.getUser(id); }
  • 27. REST with RestController @Controller public class ResumesController implements RestController<Resume, Long> { GET http://myserver/myapp/resumes public List<Resume> index() {} POST http://myserver/myapp/resumes public void create(Resume resume) {} GET http://myserver/myapp/resumes/1 public Resume show(Long id) {} DELETE http://myserver/myapp/resumes/1 public void delete(Long id) {} PUT http://myserver/myapp/resumes/1 public void update(Resume resume) {} }
  • 28. JAX-RS Annotations • JAX-RS: Java API for RESTful Web Services • http://jcp.org/en/jsr/detail?id=311 • http://www.infoq.com/news/2008/10/jaxrs- comparison • @Path, @GET, @PUT, @POST, @DELETE • @DefaultValue, @PathParam, @QueryParam
  • 29. Dropping Support For... • Commons Attributes • TopLink (EclipseLink instead) • MVC Controller hierarchy • JUnit 3.8 Test classes import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests; public class UserManagerTest extends AbstractTransactionalDataSourceSpringContextTests { private UserManager userManager; public void setUserManager(UserManager userManager) { this.userManager = userManager; } protected String[] getConfigLocations() { setAutowireMode(AUTOWIRE_BY_NAME); return new String[] {quot;classpath*:/WEB-INF/applicationContext*.xmlquot;}; } protected void onSetUpInTransaction() throws Exception { deleteFromTables(new String[] {quot;app_userquot;}); }
  • 30. 2.5 Community Feedback • Most common requests for Spring MVC: • Add REST Support • Add EL Support • Add Conversation Support • 3.0 Targeted Issues: • http://snurl.com/3ob7o
  • 31. Choose Your Own Adventure • Create a new Spring 3.0 Application with JPA and Spring MVC • Upgrade an existing Spring 2.0 Application to Spring 3.0
  • 32. Get the Source http://raibledesigns.com/rd/entry/the_colorado_software_summit_and
  • 33. Spring 3.0 Kickstart http://spring-kickstart.googlecode.com