a tour through spring 3 - developing web applications
TRANSCRIPT
© 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
2
CONFIDENTIALCONFIDENTIAL
2
Topics
MVC
Ajax
Web Flow
Security
Integration
Flex
Tools and Getting Started
3
CONFIDENTIALCONFIDENTIAL
3
Getting Demo Source
Spring Samples Repository
• http://src.springsource.org/svn/spring-samples
Petcare
• http://src.springsource.org/svn/spring-samples/petcare/trunk
Spring Travel
• http://src.springsource.org/svn/spring-samples/travel/trunk
I ♥ spring
I ♥ spring
6
CONFIDENTIALCONFIDENTIAL
6
MVC
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
© 2010 SpringSource, A division of VMware. All rights reserved
CONFIDENTIAL
© 2010 SpringSource, A division of VMware. All rights reserved
CONFIDENTIAL
MVC Demo
9
CONFIDENTIALCONFIDENTIAL
9
Ajax
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
© 2010 SpringSource, A division of VMware. All rights reserved
CONFIDENTIAL
© 2010 SpringSource, A division of VMware. All rights reserved
CONFIDENTIAL
Ajax Demo
12
CONFIDENTIALCONFIDENTIAL
12
Web Flow
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
© 2010 SpringSource, A division of VMware. All rights reserved
CONFIDENTIAL
© 2010 SpringSource, A division of VMware. All rights reserved
CONFIDENTIAL
Web Flow Demo
15
CONFIDENTIALCONFIDENTIAL
15
Security
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
© 2010 SpringSource, A division of VMware. All rights reserved
CONFIDENTIAL
© 2010 SpringSource, A division of VMware. All rights reserved
CONFIDENTIAL
Security Demo
18
CONFIDENTIALCONFIDENTIAL
18
Integration
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
I ♥ spring
global appointments
Message
Gateway
Logger
appointment
message router
Admin
Client
Admin
Client
Admin
Client
asyncMailer
doctorMail
Transformer
Doctor
Integration Pipeline
© 2010 SpringSource, A division of VMware. All rights reserved
CONFIDENTIAL
© 2010 SpringSource, A division of VMware. All rights reserved
CONFIDENTIAL
Integration Demo
22
CONFIDENTIALCONFIDENTIAL
22
Flex
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
24
CONFIDENTIALCONFIDENTIAL
24
Tools and Getting Started
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
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
© 2010 SpringSource, A division of VMware. All rights reserved
CONFIDENTIAL
© 2010 SpringSource, A division of VMware. All rights reserved
CONFIDENTIAL
Roo Demo
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
29
CONFIDENTIALCONFIDENTIAL
Resources
Spring articles and documentation
• http://www.springsource.org/documentation
Roo webinar and video
• http://www.springsource.org/node/2479
• http://s3.springsource.com/MRKT/roo/2010-01-Five_Minutes_Roo.mov
Get involved
• Forums: http://forum.springsource.org
• JIRA: http://www.springframework.org
29