SlideShare a Scribd company logo
1 of 32
Download to read offline
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

More Related Content

What's hot (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
 

Viewers also liked (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
 

Similar to 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
 

Similar to 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
 

Recently uploaded

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 

Recently uploaded (20)

WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 

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