SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Downloaden Sie, um offline zu lesen
Chicago, October 19 - 22,
2010
Next Generation Spring MVC
with Spring Roo
Stefan Schmidt & Keith Donald
Agenda
•  Mastering Spring MVC with Spring Roo
•  Keeping up with project domain changes
•  View scaffolding & customization
•  How social is your application?
•  Does your application speak Spanish?
•  How secure is your application?
•  Going with the flow
Mastering Spring MVC
with Spring ROO
Master Spring MVC with Spring Roo
•  Best-practice Spring MVC out of the box
–  REST support
–  Round tripping of View artifacts
–  Strong Templating support
–  Theming support
–  Pagination support
–  i18n & i11n built-in
–  Form validation based on JSR 303
–  Tested on popular Web browsers & Web containers
REST Support - Form Handling
Resource GET PUT POST DELETE
Collection URI such as
http://tld.com/pizzashop/
toppings
List members of
the collection
(pagination
possible)
Not used. Create
new
resource
Not used.
Member URI such as
http://tld.com/pizzashop/
toppings/5
Retrieve addressed
resource
Update the
addressed
resource
Not used. Delete the
addressed
resource
Member URI such as
http://tld.com/pizzashop/
toppings?form
Creates a initialized
but empty form for
the resource
(create use-case)
Not used. Not used. Not used.
Member URI such as
http://tld.com/pizzashop/
toppings/5?form
Creates an
initialized form pre-
populated with data
of resource (update
use-case)
Not used. Not used. Not used.
REST Support - Customizable JSON Binding
•  Roo offers two methods for integrating JSON binding:
–  Option 1: Spring MVC detects Jackson
•  @RequestBody & @ResponseBody
•  ContentNegotiatingViewResolver
–  Option 2: Built-in JSON handling managed in domain layer
•  Customizable FlexJson integration
Spring Roo MVC Scaffolding Options
•  Generation of Web artifacts
–  controller scaffold
•  generate a controller for a given entity
–  controller all
•  generate controllers for all entities without an existing
controller
–  controller class
•  generate a simple Spring @MVC controller with a post and a
get method
DEMO
View scaffolding
Keeping up with project
domain changes
Keeping up with project domain changes
Past: Roo 1.0.x all-or-nothing approach
–  either manage view templates manually after initial scaffold,
–  or abstain from customization of JSP view artifacts
Future: Roo 1.1.x intelligent round-tripping
–  introduction of customizable tag library
–  reduction of JSP code by ~90%
–  JSPs are now user editable
JSP View Round-Tripping
•  Customizable Tag libraries
–  every tag has three common attributes
•  ‘id’ is used by Roo to identify tags via Xpath (required)
•  ‘z’ is used to store a hash code which determines who ‘owns’
the tag (required)
•  ‘render’ can be used to omit form rendering of the tag
JSP View Round Tripping Cont.
Example jspx file:
<form:update	
  id="fu_com_foo_Person"	
  modelAttribute="person"	
  path="/people"	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  z="3lX+WZW4CQVBb7OlvB0AvdgbGRQ=">	
  
	
  	
  <field:datetime	
  dateTimePattern="${person_birthday_date_format}"	
  field="birthDay"	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  id="c_com_foo_Person_birthDay"	
  z="dXnEoWaz4rI4CKD9mlz+clbSUP4="/>	
  
	
  	
  <field:select	
  field="car"	
  id="c_com_foo_Person_car"	
  itemValue="id"	
  items="${cars}"	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  path="/cars"	
  z="z2LA3LvNKRO9OISmZurGjEczHkc="/>	
  
	
  	
  <field:select	
  field="cars"	
  id="c_com_foo_Person_cars"	
  itemValue="id"	
  items="${cars}"	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  multiple="true"	
  path="/cars"	
  z="c0rdAISxzHsNvJPFfAmEEGz2LU4="/>	
  
</form:update>	
  
Hash Key Calculation
Things included in hash code
calulation
Things not included in hash key
calculation
Element name (name only, not
namespace)
Name space of element names
Attribute names present in element White spaces used in the element
Attribute values present in the element Potential child elements
The ‘z’ attribute and its value
Any attribute (and value) whose name
starts with '_'
The order of the attributes does not
contribute to the value of a hash key
DEMO
View round-tripping
View Scaffolding &
Customization
View Scaffolding & Customization
•  Roo MVC views offer numerous customization points:
–  Spring Theming support via CSS (and graphics)
–  Global template structural adjustments via Tiles
–  Page structure changes in JSP pages
–  Portable templates through JSP tag library
– 
Roo Default Tag Library
•  Spring JavaScript
•  Dojo Toolkit
•  Easy XML-based tags (no .java required)
•  Tags for
–  form handling
–  field rendering
–  util (pagination, page decoration, language selection, …)
DEMO
View customization
How social is your application?
Embedding Social Features
Embedding Social Features
Roo offers two shell commands to install features:
•  Option 1
–  web mvc embed generic --url http://www.youtube.com/watch?v=Gb1Z0lfl52I
–  automatic detection of social feature based on domain name
–  easiest way to get a feature embedded
•  Option 2
–  web mvc embed map --provider GOOGLE_MAPS --location "Sydney,
Australia”
–  web mvc embed finances --stockSymbol VMW
–  specification of type of social feature
–  better supported through tab completion
DEMO
Embedding Social Features
Does your app speak
Spanish?
i18n & l11n Support
•  Roo MVC scaffolding now defaults to locale ‘en’
–  install more languages with ‘web mvc install --language es’
command
–  choice between 6 languages
–  very easy publishing of new languages
•  addon create i18n --topLevelPackage com.foo.ru --locale ru --messageBundle
<path-to>/messages_fr.properties
•  see slides for session ‘Hello, RooBot: Writing and Distributing Your Own
Spring Roo Add-Ons’
i18n & l11n Support
•  Roo MVC scaffolding uses two artifacts for managing
localization (l11n) & internationalization (i18n)
–  application.properties
•  application / domain specific messages
•  managed by Roo round tripping
–  messages_XX.properties
•  non- application / domain specific messages
•  never touched by Roo after initial install
How secure is your
application?
Integrating Spring Security
•  One simple command
–  security setup
–  URL-based security with applicationContext-security.xml
<http	
  auto-­‐config="true"	
  use-­‐expressions="true">	
  
	
  	
  <form-­‐login	
  login-­‐processing-­‐url="/resources/j_spring_security_check"	
  login-­‐	
  	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  page="/login"	
  authentication-­‐failure-­‐url="/login?login_error=t"/>	
  
	
  	
  <logout	
  logout-­‐url="/resources/j_spring_security_logout"/>	
  
	
  	
  <intercept-­‐url	
  pattern="/choices/**"	
  access="hasRole('ROLE_ADMIN')”/>	
  	
  
	
  	
  <intercept-­‐url	
  pattern="/resources/**"	
  access="permitAll"	
  />	
  
	
  	
  <intercept-­‐url	
  pattern="/**"	
  access="permitAll"	
  />	
  
</http>	
  
Going with the Flow
Spring Web Flow
•  One simple command
–  web flow
–  integrates Spring Web Flow into application
DEMO
Securing Your Application
Spring Web Flow
Selenium Tests
Resources & Links
•  Home → http://www.springsource.org/roo
–  Contains links to all other resources
•  Forum → http://forum.springsource.org
–  Roo team actively monitor forum and answer queries
•  Issues → http://jira.springframework.org/browse/ROO
•  Twitter → @SpringRoo
–  Follow for updates, or include in tweets so we see them
•  Contact details
–  Keith Donald @kdonald, kdonald@vmware.com
–  Stefan Schmidt @schmidtstefan, schmidts@vmware.com
Q&A

Weitere ähnliche Inhalte

Was ist angesagt? (20)

Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
 
Laravel introduction
Laravel introductionLaravel introduction
Laravel introduction
 
Asp.net
Asp.netAsp.net
Asp.net
 
ASP.NET Basics
ASP.NET Basics ASP.NET Basics
ASP.NET Basics
 
ASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVCASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVC
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
Be project ppt asp.net
Be project ppt asp.netBe project ppt asp.net
Be project ppt asp.net
 
Yii 2.0 overview - 1 of 2
Yii 2.0 overview - 1 of 2Yii 2.0 overview - 1 of 2
Yii 2.0 overview - 1 of 2
 
MVC - Introduction
MVC - IntroductionMVC - Introduction
MVC - Introduction
 
Integrating Alfresco with Portals
Integrating Alfresco with PortalsIntegrating Alfresco with Portals
Integrating Alfresco with Portals
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
Single Page Applications on JavaScript and ASP.NET MVC4
Single Page Applications on JavaScript and ASP.NET MVC4Single Page Applications on JavaScript and ASP.NET MVC4
Single Page Applications on JavaScript and ASP.NET MVC4
 
Introduction to laravel framework
Introduction to laravel frameworkIntroduction to laravel framework
Introduction to laravel framework
 
OpenCms Days 2015 Advanced Solr Searching
OpenCms Days 2015 Advanced Solr SearchingOpenCms Days 2015 Advanced Solr Searching
OpenCms Days 2015 Advanced Solr Searching
 
What Is Hobo ?
What Is Hobo ?What Is Hobo ?
What Is Hobo ?
 
Sightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVASightly - AEM6 UI Development using JS and JAVA
Sightly - AEM6 UI Development using JS and JAVA
 
Building RESTful applications using Spring MVC
Building RESTful applications using Spring MVCBuilding RESTful applications using Spring MVC
Building RESTful applications using Spring MVC
 
Asp .net folders and web.config
Asp .net folders and web.configAsp .net folders and web.config
Asp .net folders and web.config
 
Java server pages
Java server pagesJava server pages
Java server pages
 
20jsp
20jsp20jsp
20jsp
 

Andere mochten auch (20)

Växjö13
Växjö13Växjö13
Växjö13
 
InternetiskolanSETT2012
InternetiskolanSETT2012InternetiskolanSETT2012
InternetiskolanSETT2012
 
Dr. Catherine Kilfedder
Dr. Catherine KilfedderDr. Catherine Kilfedder
Dr. Catherine Kilfedder
 
Extreme Fat Loss
Extreme Fat LossExtreme Fat Loss
Extreme Fat Loss
 
Internet-webbstjärnan
Internet-webbstjärnanInternet-webbstjärnan
Internet-webbstjärnan
 
ccws12
ccws12ccws12
ccws12
 
Cv John Smits 101212
Cv John Smits   101212Cv John Smits   101212
Cv John Smits 101212
 
RCSS General Slides Low Res
RCSS General Slides Low ResRCSS General Slides Low Res
RCSS General Slides Low Res
 
Geekgirls_creativecommons
Geekgirls_creativecommonsGeekgirls_creativecommons
Geekgirls_creativecommons
 
Västerås, om webbstjärnan
Västerås, om webbstjärnanVästerås, om webbstjärnan
Västerås, om webbstjärnan
 
Humanely Speaking
Humanely SpeakingHumanely Speaking
Humanely Speaking
 
cciskolan
cciskolancciskolan
cciskolan
 
Adab Menjaga Fitrah Lelaki & Perempuan
Adab Menjaga Fitrah Lelaki & PerempuanAdab Menjaga Fitrah Lelaki & Perempuan
Adab Menjaga Fitrah Lelaki & Perempuan
 
Twelve Hotel 2007 Press Book
Twelve Hotel 2007 Press BookTwelve Hotel 2007 Press Book
Twelve Hotel 2007 Press Book
 
Sociala medier läromedel
Sociala medier läromedelSociala medier läromedel
Sociala medier läromedel
 
Question four
Question fourQuestion four
Question four
 
upphovsrätt och elever
upphovsrätt och eleverupphovsrätt och elever
upphovsrätt och elever
 
Pandemics Week 3 Presentation Summary 1 D
Pandemics Week 3 Presentation Summary 1 DPandemics Week 3 Presentation Summary 1 D
Pandemics Week 3 Presentation Summary 1 D
 
kreativitetggm12
kreativitetggm12kreativitetggm12
kreativitetggm12
 
1263482098bsb00000533
1263482098bsb000005331263482098bsb00000533
1263482098bsb00000533
 

Ähnlich wie Next Generation Spring MVC with Spring Roo

Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Ganesh Kondal
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...Mark Leusink
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...Mark Roden
 
web2py:Web development like a boss
web2py:Web development like a bossweb2py:Web development like a boss
web2py:Web development like a bossFrancisco Ribeiro
 
Seven Versions of One Web Application
Seven Versions of One Web ApplicationSeven Versions of One Web Application
Seven Versions of One Web ApplicationYakov Fain
 
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpChalermpon Areepong
 
Nasdanika Foundation Server
Nasdanika Foundation ServerNasdanika Foundation Server
Nasdanika Foundation ServerPavel Vlasov
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Henry S
 
Crash Course HTML/Rails Slides
Crash Course HTML/Rails SlidesCrash Course HTML/Rails Slides
Crash Course HTML/Rails SlidesUdita Plaha
 
PLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfPLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfAlfresco Software
 
CFWheels - Pragmatic, Beautiful Code
CFWheels - Pragmatic, Beautiful CodeCFWheels - Pragmatic, Beautiful Code
CFWheels - Pragmatic, Beautiful Codeindiver
 
Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Lucas Jellema
 
Mobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best PracticesMobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best PracticesAndrew Ferrier
 
Building Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJSBuilding Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJSAntonio Peric-Mazar
 

Ähnlich wie Next Generation Spring MVC with Spring Roo (20)

Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Introduction to Flask Micro Framework
Introduction to Flask Micro FrameworkIntroduction to Flask Micro Framework
Introduction to Flask Micro Framework
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
 
Knolx session
Knolx sessionKnolx session
Knolx session
 
web2py:Web development like a boss
web2py:Web development like a bossweb2py:Web development like a boss
web2py:Web development like a boss
 
Seven Versions of One Web Application
Seven Versions of One Web ApplicationSeven Versions of One Web Application
Seven Versions of One Web Application
 
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
 
Symfony2 and AngularJS
Symfony2 and AngularJSSymfony2 and AngularJS
Symfony2 and AngularJS
 
Nasdanika Foundation Server
Nasdanika Foundation ServerNasdanika Foundation Server
Nasdanika Foundation Server
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
 
Crash Course HTML/Rails Slides
Crash Course HTML/Rails SlidesCrash Course HTML/Rails Slides
Crash Course HTML/Rails Slides
 
PLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring SurfPLAT-8 Spring Web Scripts and Spring Surf
PLAT-8 Spring Web Scripts and Spring Surf
 
CFWheels - Pragmatic, Beautiful Code
CFWheels - Pragmatic, Beautiful CodeCFWheels - Pragmatic, Beautiful Code
CFWheels - Pragmatic, Beautiful Code
 
Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...
 
Angular js workshop
Angular js workshopAngular js workshop
Angular js workshop
 
Mobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best PracticesMobile and IBM Worklight Best Practices
Mobile and IBM Worklight Best Practices
 
Building Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJSBuilding Single Page Application (SPA) with Symfony2 and AngularJS
Building Single Page Application (SPA) with Symfony2 and AngularJS
 

Kürzlich hochgeladen

Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 

Kürzlich hochgeladen (20)

Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 

Next Generation Spring MVC with Spring Roo

  • 1. Chicago, October 19 - 22, 2010 Next Generation Spring MVC with Spring Roo Stefan Schmidt & Keith Donald
  • 2. Agenda •  Mastering Spring MVC with Spring Roo •  Keeping up with project domain changes •  View scaffolding & customization •  How social is your application? •  Does your application speak Spanish? •  How secure is your application? •  Going with the flow
  • 4. Master Spring MVC with Spring Roo •  Best-practice Spring MVC out of the box –  REST support –  Round tripping of View artifacts –  Strong Templating support –  Theming support –  Pagination support –  i18n & i11n built-in –  Form validation based on JSR 303 –  Tested on popular Web browsers & Web containers
  • 5. REST Support - Form Handling Resource GET PUT POST DELETE Collection URI such as http://tld.com/pizzashop/ toppings List members of the collection (pagination possible) Not used. Create new resource Not used. Member URI such as http://tld.com/pizzashop/ toppings/5 Retrieve addressed resource Update the addressed resource Not used. Delete the addressed resource Member URI such as http://tld.com/pizzashop/ toppings?form Creates a initialized but empty form for the resource (create use-case) Not used. Not used. Not used. Member URI such as http://tld.com/pizzashop/ toppings/5?form Creates an initialized form pre- populated with data of resource (update use-case) Not used. Not used. Not used.
  • 6. REST Support - Customizable JSON Binding •  Roo offers two methods for integrating JSON binding: –  Option 1: Spring MVC detects Jackson •  @RequestBody & @ResponseBody •  ContentNegotiatingViewResolver –  Option 2: Built-in JSON handling managed in domain layer •  Customizable FlexJson integration
  • 7. Spring Roo MVC Scaffolding Options •  Generation of Web artifacts –  controller scaffold •  generate a controller for a given entity –  controller all •  generate controllers for all entities without an existing controller –  controller class •  generate a simple Spring @MVC controller with a post and a get method
  • 9. Keeping up with project domain changes
  • 10. Keeping up with project domain changes Past: Roo 1.0.x all-or-nothing approach –  either manage view templates manually after initial scaffold, –  or abstain from customization of JSP view artifacts Future: Roo 1.1.x intelligent round-tripping –  introduction of customizable tag library –  reduction of JSP code by ~90% –  JSPs are now user editable
  • 11. JSP View Round-Tripping •  Customizable Tag libraries –  every tag has three common attributes •  ‘id’ is used by Roo to identify tags via Xpath (required) •  ‘z’ is used to store a hash code which determines who ‘owns’ the tag (required) •  ‘render’ can be used to omit form rendering of the tag
  • 12. JSP View Round Tripping Cont. Example jspx file: <form:update  id="fu_com_foo_Person"  modelAttribute="person"  path="/people"                                  z="3lX+WZW4CQVBb7OlvB0AvdgbGRQ=">      <field:datetime  dateTimePattern="${person_birthday_date_format}"  field="birthDay"                                            id="c_com_foo_Person_birthDay"  z="dXnEoWaz4rI4CKD9mlz+clbSUP4="/>      <field:select  field="car"  id="c_com_foo_Person_car"  itemValue="id"  items="${cars}"                                            path="/cars"  z="z2LA3LvNKRO9OISmZurGjEczHkc="/>      <field:select  field="cars"  id="c_com_foo_Person_cars"  itemValue="id"  items="${cars}"                                            multiple="true"  path="/cars"  z="c0rdAISxzHsNvJPFfAmEEGz2LU4="/>   </form:update>  
  • 13. Hash Key Calculation Things included in hash code calulation Things not included in hash key calculation Element name (name only, not namespace) Name space of element names Attribute names present in element White spaces used in the element Attribute values present in the element Potential child elements The ‘z’ attribute and its value Any attribute (and value) whose name starts with '_' The order of the attributes does not contribute to the value of a hash key
  • 16. View Scaffolding & Customization •  Roo MVC views offer numerous customization points: –  Spring Theming support via CSS (and graphics) –  Global template structural adjustments via Tiles –  Page structure changes in JSP pages –  Portable templates through JSP tag library – 
  • 17. Roo Default Tag Library •  Spring JavaScript •  Dojo Toolkit •  Easy XML-based tags (no .java required) •  Tags for –  form handling –  field rendering –  util (pagination, page decoration, language selection, …)
  • 19. How social is your application?
  • 21. Embedding Social Features Roo offers two shell commands to install features: •  Option 1 –  web mvc embed generic --url http://www.youtube.com/watch?v=Gb1Z0lfl52I –  automatic detection of social feature based on domain name –  easiest way to get a feature embedded •  Option 2 –  web mvc embed map --provider GOOGLE_MAPS --location "Sydney, Australia” –  web mvc embed finances --stockSymbol VMW –  specification of type of social feature –  better supported through tab completion
  • 23. Does your app speak Spanish?
  • 24. i18n & l11n Support •  Roo MVC scaffolding now defaults to locale ‘en’ –  install more languages with ‘web mvc install --language es’ command –  choice between 6 languages –  very easy publishing of new languages •  addon create i18n --topLevelPackage com.foo.ru --locale ru --messageBundle <path-to>/messages_fr.properties •  see slides for session ‘Hello, RooBot: Writing and Distributing Your Own Spring Roo Add-Ons’
  • 25. i18n & l11n Support •  Roo MVC scaffolding uses two artifacts for managing localization (l11n) & internationalization (i18n) –  application.properties •  application / domain specific messages •  managed by Roo round tripping –  messages_XX.properties •  non- application / domain specific messages •  never touched by Roo after initial install
  • 26. How secure is your application?
  • 27. Integrating Spring Security •  One simple command –  security setup –  URL-based security with applicationContext-security.xml <http  auto-­‐config="true"  use-­‐expressions="true">      <form-­‐login  login-­‐processing-­‐url="/resources/j_spring_security_check"  login-­‐                                    page="/login"  authentication-­‐failure-­‐url="/login?login_error=t"/>      <logout  logout-­‐url="/resources/j_spring_security_logout"/>      <intercept-­‐url  pattern="/choices/**"  access="hasRole('ROLE_ADMIN')”/>        <intercept-­‐url  pattern="/resources/**"  access="permitAll"  />      <intercept-­‐url  pattern="/**"  access="permitAll"  />   </http>  
  • 29. Spring Web Flow •  One simple command –  web flow –  integrates Spring Web Flow into application
  • 30. DEMO Securing Your Application Spring Web Flow Selenium Tests
  • 31. Resources & Links •  Home → http://www.springsource.org/roo –  Contains links to all other resources •  Forum → http://forum.springsource.org –  Roo team actively monitor forum and answer queries •  Issues → http://jira.springframework.org/browse/ROO •  Twitter → @SpringRoo –  Follow for updates, or include in tweets so we see them •  Contact details –  Keith Donald @kdonald, kdonald@vmware.com –  Stefan Schmidt @schmidtstefan, schmidts@vmware.com
  • 32. Q&A