A Tour Through Spring 3 - Developing Web Applications

29
© 2010 SpringSource, A division of VMware. All rights reserved CONFIDENTIAL © 2010 SpringSource, A division of VMware. All rights reserved CONFIDENTIAL A Tour through Spring 3 Keith Donald, Principal Engineer

Transcript of A Tour Through Spring 3 - Developing Web Applications

Page 1: A Tour Through Spring 3 - Developing Web Applications

© 2010 SpringSource, A division of VMware. All rights reserved

CONFIDENTIAL

© 2010 SpringSource, A division of VMware. All rights reserved

CONFIDENTIAL

A Tour through Spring 3

Keith Donald, Principal Engineer

Page 2: A Tour Through Spring 3 - Developing Web Applications

2

CONFIDENTIALCONFIDENTIAL

2

Topics

MVC

Ajax

Web Flow

Security

Integration

Flex

Tools and Getting Started

Page 4: A Tour Through Spring 3 - Developing Web Applications

I ♥ spring

Page 5: A Tour Through Spring 3 - Developing Web Applications

I ♥ spring

Page 6: A Tour Through Spring 3 - Developing Web Applications

6

CONFIDENTIALCONFIDENTIAL

6

MVC

Page 7: A Tour Through Spring 3 - Developing Web Applications

7

CONFIDENTIALCONFIDENTIAL

7

Key Features

@Controller programming model

• For developing web applications and web services

• Configuration namespace

REST support

• URI Templates

• HTML, JSON, XML, ATOM/RSS representations

• Content Negotiation

• Support for PUT and DELETE requests

Data Binding and Type Conversion

Declarative Validation

• JSR-303

Page 8: A Tour Through Spring 3 - Developing Web Applications

© 2010 SpringSource, A division of VMware. All rights reserved

CONFIDENTIAL

© 2010 SpringSource, A division of VMware. All rights reserved

CONFIDENTIAL

MVC Demo

Page 9: A Tour Through Spring 3 - Developing Web Applications

9

CONFIDENTIALCONFIDENTIAL

9

Ajax

Page 10: A Tour Through Spring 3 - Developing Web Applications

10

CONFIDENTIALCONFIDENTIAL

10

Key Features

Integrates well with leading JavaScript toolkits

• jQuery

• Dojo

Integrates well with popular CSS frameworks

• Blueprint CSS

• 960 Grid

Spring JavaScript Module (part of Web Flow)

• Server-side partial page rendering built on Tiles composite view system

• Client-side progressive enhancement API built on Dojo

• Widget decorations

• Ajax event decorations

• Client-side validation

Page 11: A Tour Through Spring 3 - Developing Web Applications

© 2010 SpringSource, A division of VMware. All rights reserved

CONFIDENTIAL

© 2010 SpringSource, A division of VMware. All rights reserved

CONFIDENTIAL

Ajax Demo

Page 12: A Tour Through Spring 3 - Developing Web Applications

12

CONFIDENTIALCONFIDENTIAL

12

Web Flow

Page 13: A Tour Through Spring 3 - Developing Web Applications

13

CONFIDENTIALCONFIDENTIAL

13

Key Features

Lets you define flows that guide users through business processes

• Single module, e.g. “Loan Application”, encapsulating all process steps

• Navigation rules strictly enforced server-side

Manages conversational state

• Isolated from other users

• Local to current window, tab, or dialog

• Cleaned up when flow completes or expires

Agile development experience

• Change flows without restarting the server

Page 14: A Tour Through Spring 3 - Developing Web Applications

© 2010 SpringSource, A division of VMware. All rights reserved

CONFIDENTIAL

© 2010 SpringSource, A division of VMware. All rights reserved

CONFIDENTIAL

Web Flow Demo

Page 15: A Tour Through Spring 3 - Developing Web Applications

15

CONFIDENTIALCONFIDENTIAL

15

Security

Page 16: A Tour Through Spring 3 - Developing Web Applications

16

CONFIDENTIALCONFIDENTIAL

16

Key Features

Multiple authentication mechanisms

• Basic, Form, OpenID

Pluggable user data stores

• In Memory, Database, LDAP

Multiple levels of security

• Web (URL-based, enforced by ServletFilter)

• @Secured method (enforced by AOP)

Role-based authorization

• Flexible security expressions with Spring EL

• JSP tag library for conditional rendering

SSL channels

Page 17: A Tour Through Spring 3 - Developing Web Applications

© 2010 SpringSource, A division of VMware. All rights reserved

CONFIDENTIAL

© 2010 SpringSource, A division of VMware. All rights reserved

CONFIDENTIAL

Security Demo

Page 18: A Tour Through Spring 3 - Developing Web Applications

18

CONFIDENTIALCONFIDENTIAL

18

Integration

Page 19: A Tour Through Spring 3 - Developing Web Applications

19

CONFIDENTIALCONFIDENTIAL

19

Key Features

Allows you to add an integration layer to your application

• Connect your application to other systems in a loosely coupled way

• Think messaging!

Comprehensive support for enterprise integration patterns

• Channel, Router, Filter, Transformer, Splitter, Channel Adapter

• High-level configuration DSL built around these patterns

Extensive library of channel adapters

• JMS, File, Mail, HTTP, FTP

Support for asynchronous / parallel workloads

Page 20: A Tour Through Spring 3 - Developing Web Applications

I ♥ spring

global appointments

Message

Gateway

Logger

appointment

message router

Admin

Client

Admin

Client

Admin

Client

asyncMailer

doctorMail

Transformer

Doctor

Mail

Integration Pipeline

Page 21: A Tour Through Spring 3 - Developing Web Applications

© 2010 SpringSource, A division of VMware. All rights reserved

CONFIDENTIAL

© 2010 SpringSource, A division of VMware. All rights reserved

CONFIDENTIAL

Integration Demo

Page 22: A Tour Through Spring 3 - Developing Web Applications

22

CONFIDENTIALCONFIDENTIAL

22

Flex

Page 23: A Tour Through Spring 3 - Developing Web Applications

23

CONFIDENTIALCONFIDENTIAL

23

Key Features

Export Spring Beans to Flex Clients

• Over AMF (RPC), HTTP (REST)

Security

• Utilizing Spring Integration

Integration

• Utilizing Spring Integration; push messages to Flex clients

Built on top of Spring MVC

• Configuration namespace simplifies setup and configuration

• Plugs into DispatcherServlet processing lifecycle

Spring ActionScript

• DI / MVC framework for Flex clients

Page 24: A Tour Through Spring 3 - Developing Web Applications

24

CONFIDENTIALCONFIDENTIAL

24

Tools and Getting Started

Page 25: A Tour Through Spring 3 - Developing Web Applications

25

CONFIDENTIALCONFIDENTIAL

25

Key Features

SpringSource Tool-Suite

• New Project Templates (can create your own)

• Essential plugins pre-integrated (Spring IDE, WTP, m2Eclipse, AJDT, Roo, etc)

• Convenient “Spring Extensions” Install

• e.g. install Groovy tooling add-on in one click!

• Content assist / auto-completion

• Visualization

• Embedded tc Server Developer Edition, including Spring Insight

Roo

• Code generation with round tripping

• Reduced Java ceremony (@RooJavaBean, @RooToString)

• Support for Active Record pattern (@RooEntity)

• UI Scaffolding

• Intelligent command-line shell interface

Page 26: A Tour Through Spring 3 - Developing Web Applications

26

CONFIDENTIALCONFIDENTIAL

Getting Started with Spring

Download SpringSource Tool Suite

• http://www.springsource.com/products/sts

Create your first Spring MVC Project

• New -> Spring Template Project -> Spring MVC Project

Experience Roo

• New -> Roo Project -> Open Roo Shell -> type “hint”

Study the sample applications

• Checkout Petcare, Spring Travel, import into STS and run on Tomcat

26

Page 27: A Tour Through Spring 3 - Developing Web Applications

© 2010 SpringSource, A division of VMware. All rights reserved

CONFIDENTIAL

© 2010 SpringSource, A division of VMware. All rights reserved

CONFIDENTIAL

Roo Demo

Page 28: A Tour Through Spring 3 - Developing Web Applications

28

CONFIDENTIALCONFIDENTIAL

Coming in Spring 3.1

Conversation Scope, Flash Map

Comet (long-polling) support

Java @Flow Definitions

Static resources handler

OAuth support

Roo Add-ons

• “Open Web” (HTML/CSS/JS) improvements

• Flex (new)

• GWT (new)

28