SlideShare una empresa de Scribd logo
1 de 86
PrettyFaces Client-facing JSF – Lincoln Baxter, III
SiteMap ,[object Object]
basics
navigation
SEO
examples
PrettyFaces is: Url Rewriting http://example.com/faces/store .jsf http://example.com/ store
PrettyFaces is: Url Parameterization http://example.com/store/item/ Z34SD498
PrettyFaces is: Declarative Data Loading <action>  #{storeBean.loadItem}  </action>
PrettyFaces is: Simplified Navigation “ viewStore ” -> http://example.com/store
SiteMap ,[object Object]
basics
navigation
SEO
examples
The PrettyFaces Story Lincoln Baxter, III PrettyFaces/PrettyTime Founder of  O cpSoft
The PrettyFaces Story Lincoln Baxter, III Founder of  O cpSoft @lincolnthree http://ocpsoft.com http://scrumshark.com http://ocpsoft.com/prettyfaces http://ocpsoft.com/prettytime
The Problem ,[object Object]
Had usability issues, pitfalls
Navigation was a pain...
No bookmarks? Not entirely true.
What about Pretty URLs / SEO?
The Result ,[object Object]
Applied the 80/20 rule
Destroyed Thanksgiving 2008
The Result ,[object Object]
Faces-config practically gone
Data loading easy & declarative Easy, Bookmarkable JSF
:) Life is good
Why do we need Pretty URLs? ,[object Object]
Enhance User Experience
Self-Promote
SiteMap ,[object Object]
basics
navigation
SEO
examples
Rethinking Navigation The Basics Keep it simple...
SiteMap ,[object Object]
basics
navigation
SEO
examples ,[object Object]
parameterize
validate
load
Keep URLs Clean Build trust by reducing clutter Before: http://example.com/news.xhtml?p=my-new-post After:  http://example.com/news/my-new-post/
Keep URLs Clean Real Life: Should have been: http://www.llbean.com/webapp/wcs/stores/servlet/CategoryDisplay?categoryId=28&storeId=1&catalogId=1&langId=-1&nav=hp-gndp http://llbean.com/kids http://www.llbean.com/webapp/wcs/stores/servlet/CategoryDisplay? categoryId=28 & storeId=1 & catalogId=1 & langId=-1 & nav=hp-gndp Vulnerable!
Keep URLs Clean Why don't more people buy used cars?
Keep URLs Clean They don't trust the last owner. They're afraid of getting a bad deal.
Keep URLs Clean ,[object Object]
Trust me. http:// www.linkedin.com/in/lincolnthree http://ocpsoft.com/prettyfaces http://sourceforge.net/projects/resteasy/ http://www.youtube.com/watch?v=ZOU8GIRUd_g
Keep URLs Clean ,[object Object]
Are self-promoting, benefit SEO
Reduce vulnerability
Root the user
SiteMap ,[object Object]
basics
navigation
SEO
examples ,[object Object]
parameterize
validate
load
Parameterization (p14n) / root / the / user ,[object Object]
Be general, progress to specific
Keep the query string optional
Parameterization (p14n) ,[object Object]
where I am & what I'm looking at
user accessible
Parameterization (p14n) Examples: ,[object Object],http://scrumshark.com/project/PrettyFaces http://scrumshark.com/project/PrettyFaces /s7 http://scrumshark.com/project/PrettyFaces /iterations http://scrumshark.com/project/PrettyFaces /iterations/Sprint1 http://scrumshark.com/PrettyFaces/Sprint1/iterations/project
Problem solved <pretty-config> ... <url-mapping id=”viewProject”> <pattern> / project / #{currentProjectBean.project} </pattern> <view-id>/faces/project/view.xhtml</view-id> </url-mapping> … </pretty-config> PrettyFaces
SiteMap ,[object Object]
basics
navigation
SEO
examples ,[object Object]
parameterize
validate
load
Validation ,[object Object]
End-users have  DIRECT ACCESS
Validate everything
Validation @FacesValidator(“ projectName ”) public class ProjectNameValidator { public void validate(...) } <url-mapping id=”viewProject”> <pattern value=”/project/#{currentProjectBean.project}”> <validate param=&quot;0&quot; validatorIds=” projectName ... ” /> </pattern> <view-id>/faces/project/view.xhtml</view-id> </url-mapping> pretty-config.xml
Validation Yes – pretty:id or empty PrettyFaces Validation Send 404 Is onError handler  defined? Handler returned Successfully? Inject values & continue or redirect to “pretty:id”  Throw Exception
SiteMap ,[object Object]

Más contenido relacionado

La actualidad más candente

Fundamentals of web_design_v2
Fundamentals of web_design_v2Fundamentals of web_design_v2
Fundamentals of web_design_v2hussain534
 
Advanced Data-Driven SEO
Advanced Data-Driven SEOAdvanced Data-Driven SEO
Advanced Data-Driven SEOHamlet Batista
 
HTML5 workshop, part 1
HTML5 workshop, part 1HTML5 workshop, part 1
HTML5 workshop, part 1Robert Nyman
 
Advanced Technical SEO - Index Bloat & Discovery: from Facets to Javascript F...
Advanced Technical SEO - Index Bloat & Discovery: from Facets to Javascript F...Advanced Technical SEO - Index Bloat & Discovery: from Facets to Javascript F...
Advanced Technical SEO - Index Bloat & Discovery: from Facets to Javascript F...Kahena Digital Marketing
 
Optimizing with Server Logs | Jamie Alberico @ #TechSEO Boost 2018
Optimizing with Server Logs | Jamie Alberico @ #TechSEO Boost 2018Optimizing with Server Logs | Jamie Alberico @ #TechSEO Boost 2018
Optimizing with Server Logs | Jamie Alberico @ #TechSEO Boost 2018Jamie Indigo
 
Challenges of building a search engine like web rendering service
Challenges of building a search engine like web rendering serviceChallenges of building a search engine like web rendering service
Challenges of building a search engine like web rendering serviceGiacomo Zecchini
 
SEO AJAX Crawlability in a Responsive Publisher World
SEO AJAX Crawlability in a Responsive Publisher WorldSEO AJAX Crawlability in a Responsive Publisher World
SEO AJAX Crawlability in a Responsive Publisher WorldEric Wu
 
GTM Clowns, fun and hacks - Search Elite - May 2017 Gerry White
GTM Clowns, fun and hacks - Search Elite - May 2017 Gerry WhiteGTM Clowns, fun and hacks - Search Elite - May 2017 Gerry White
GTM Clowns, fun and hacks - Search Elite - May 2017 Gerry WhiteGerry White
 
Dreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile designDreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile designDee Sadler
 
Real World Web Standards
Real World Web StandardsReal World Web Standards
Real World Web Standardsgleddy
 
BDD - Writing better scenario
BDD - Writing better scenarioBDD - Writing better scenario
BDD - Writing better scenarioArnauld Loyer
 
Search Engines and Flash: Secrets, Tricks, and Black Magic
Search Engines and Flash: Secrets, Tricks, and Black MagicSearch Engines and Flash: Secrets, Tricks, and Black Magic
Search Engines and Flash: Secrets, Tricks, and Black Magicguestb1f3a
 
State of jQuery '09
State of jQuery '09State of jQuery '09
State of jQuery '09jeresig
 
Traxo Presentation - Facebook Garage Dallas 09
Traxo Presentation - Facebook Garage Dallas 09Traxo Presentation - Facebook Garage Dallas 09
Traxo Presentation - Facebook Garage Dallas 09Chris Stevens
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX DesignersAshlimarie
 
Real-World AJAX with ASP.NET
Real-World AJAX with ASP.NETReal-World AJAX with ASP.NET
Real-World AJAX with ASP.NETgoodfriday
 

La actualidad más candente (19)

Fundamentals of web_design_v2
Fundamentals of web_design_v2Fundamentals of web_design_v2
Fundamentals of web_design_v2
 
Sq li
Sq liSq li
Sq li
 
Advanced Data-Driven SEO
Advanced Data-Driven SEOAdvanced Data-Driven SEO
Advanced Data-Driven SEO
 
HTML5 workshop, part 1
HTML5 workshop, part 1HTML5 workshop, part 1
HTML5 workshop, part 1
 
SiteMesh
SiteMeshSiteMesh
SiteMesh
 
Advanced Technical SEO - Index Bloat & Discovery: from Facets to Javascript F...
Advanced Technical SEO - Index Bloat & Discovery: from Facets to Javascript F...Advanced Technical SEO - Index Bloat & Discovery: from Facets to Javascript F...
Advanced Technical SEO - Index Bloat & Discovery: from Facets to Javascript F...
 
Optimizing with Server Logs | Jamie Alberico @ #TechSEO Boost 2018
Optimizing with Server Logs | Jamie Alberico @ #TechSEO Boost 2018Optimizing with Server Logs | Jamie Alberico @ #TechSEO Boost 2018
Optimizing with Server Logs | Jamie Alberico @ #TechSEO Boost 2018
 
Challenges of building a search engine like web rendering service
Challenges of building a search engine like web rendering serviceChallenges of building a search engine like web rendering service
Challenges of building a search engine like web rendering service
 
SEO AJAX Crawlability in a Responsive Publisher World
SEO AJAX Crawlability in a Responsive Publisher WorldSEO AJAX Crawlability in a Responsive Publisher World
SEO AJAX Crawlability in a Responsive Publisher World
 
GTM Clowns, fun and hacks - Search Elite - May 2017 Gerry White
GTM Clowns, fun and hacks - Search Elite - May 2017 Gerry WhiteGTM Clowns, fun and hacks - Search Elite - May 2017 Gerry White
GTM Clowns, fun and hacks - Search Elite - May 2017 Gerry White
 
Dreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile designDreamweaver CS6, jQuery, PhoneGap, mobile design
Dreamweaver CS6, jQuery, PhoneGap, mobile design
 
Real World Web Standards
Real World Web StandardsReal World Web Standards
Real World Web Standards
 
BDD - Writing better scenario
BDD - Writing better scenarioBDD - Writing better scenario
BDD - Writing better scenario
 
Search Engines and Flash: Secrets, Tricks, and Black Magic
Search Engines and Flash: Secrets, Tricks, and Black MagicSearch Engines and Flash: Secrets, Tricks, and Black Magic
Search Engines and Flash: Secrets, Tricks, and Black Magic
 
State of jQuery '09
State of jQuery '09State of jQuery '09
State of jQuery '09
 
Traxo Presentation - Facebook Garage Dallas 09
Traxo Presentation - Facebook Garage Dallas 09Traxo Presentation - Facebook Garage Dallas 09
Traxo Presentation - Facebook Garage Dallas 09
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX Designers
 
Real-World AJAX with ASP.NET
Real-World AJAX with ASP.NETReal-World AJAX with ASP.NET
Real-World AJAX with ASP.NET
 
SEARCH Y - Bastian Grimm - Migrations Best Practices
SEARCH Y - Bastian Grimm -  Migrations Best PracticesSEARCH Y - Bastian Grimm -  Migrations Best Practices
SEARCH Y - Bastian Grimm - Migrations Best Practices
 

Similar a PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)

Microformats HTML to API
Microformats HTML to APIMicroformats HTML to API
Microformats HTML to APIelliando dias
 
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]Chris Toohey
 
Fast Loading JavaScript
Fast Loading JavaScriptFast Loading JavaScript
Fast Loading JavaScriptAaron Peters
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax componentsIgnacio Coloma
 
Single Page WebApp Architecture
Single Page WebApp ArchitectureSingle Page WebApp Architecture
Single Page WebApp ArchitectureMorgan Cheng
 
Ajax to the Moon
Ajax to the MoonAjax to the Moon
Ajax to the Moondavejohnson
 
Getting More Traffic From Search Advanced Seo For Developers Presentation
Getting More Traffic From Search  Advanced Seo For Developers PresentationGetting More Traffic From Search  Advanced Seo For Developers Presentation
Getting More Traffic From Search Advanced Seo For Developers PresentationSeo Indonesia
 
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3Jamie Matthews
 
Using Ember to Make a Bazillion Dollars
Using Ember to Make a Bazillion DollarsUsing Ember to Make a Bazillion Dollars
Using Ember to Make a Bazillion DollarsMike Pack
 
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fastHow Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fastAtlassian
 
Google Analytics: Measuring for results, a practical guide
Google Analytics: Measuring for results, a practical guideGoogle Analytics: Measuring for results, a practical guide
Google Analytics: Measuring for results, a practical guideMatter Solutions
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Phpfunkatron
 
Building a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profitBuilding a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profitBen Limmer
 
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesJBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesTikal Knowledge
 

Similar a PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite) (20)

Microformats HTML to API
Microformats HTML to APIMicroformats HTML to API
Microformats HTML to API
 
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]
 
SearchMonkey
SearchMonkeySearchMonkey
SearchMonkey
 
Fast Loading JavaScript
Fast Loading JavaScriptFast Loading JavaScript
Fast Loading JavaScript
 
Html5
Html5Html5
Html5
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax components
 
Single Page WebApp Architecture
Single Page WebApp ArchitectureSingle Page WebApp Architecture
Single Page WebApp Architecture
 
Ajax to the Moon
Ajax to the MoonAjax to the Moon
Ajax to the Moon
 
Getting More Traffic From Search Advanced Seo For Developers Presentation
Getting More Traffic From Search  Advanced Seo For Developers PresentationGetting More Traffic From Search  Advanced Seo For Developers Presentation
Getting More Traffic From Search Advanced Seo For Developers Presentation
 
สปริงเฟรมเวิร์ค4.1
สปริงเฟรมเวิร์ค4.1สปริงเฟรมเวิร์ค4.1
สปริงเฟรมเวิร์ค4.1
 
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
Five Pound App talk: hereit.is, Web app architecture, REST, CSS3
 
Using Ember to Make a Bazillion Dollars
Using Ember to Make a Bazillion DollarsUsing Ember to Make a Bazillion Dollars
Using Ember to Make a Bazillion Dollars
 
Fast by Default
Fast by DefaultFast by Default
Fast by Default
 
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fastHow Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
 
Mobile web with jQuery Mobile
Mobile web with jQuery MobileMobile web with jQuery Mobile
Mobile web with jQuery Mobile
 
Google Analytics: Measuring for results, a practical guide
Google Analytics: Measuring for results, a practical guideGoogle Analytics: Measuring for results, a practical guide
Google Analytics: Measuring for results, a practical guide
 
EPiServer Web Parts
EPiServer Web PartsEPiServer Web Parts
EPiServer Web Parts
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
 
Building a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profitBuilding a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profit
 
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesJBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Último (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)

  • 1. PrettyFaces Client-facing JSF – Lincoln Baxter, III
  • 2.
  • 5. SEO
  • 7. PrettyFaces is: Url Rewriting http://example.com/faces/store .jsf http://example.com/ store
  • 8. PrettyFaces is: Url Parameterization http://example.com/store/item/ Z34SD498
  • 9. PrettyFaces is: Declarative Data Loading <action> #{storeBean.loadItem} </action>
  • 10. PrettyFaces is: Simplified Navigation “ viewStore ” -> http://example.com/store
  • 11.
  • 14. SEO
  • 16. The PrettyFaces Story Lincoln Baxter, III PrettyFaces/PrettyTime Founder of O cpSoft
  • 17. The PrettyFaces Story Lincoln Baxter, III Founder of O cpSoft @lincolnthree http://ocpsoft.com http://scrumshark.com http://ocpsoft.com/prettyfaces http://ocpsoft.com/prettytime
  • 18.
  • 20. Navigation was a pain...
  • 21. No bookmarks? Not entirely true.
  • 22. What about Pretty URLs / SEO?
  • 23.
  • 26.
  • 28. Data loading easy & declarative Easy, Bookmarkable JSF
  • 29. :) Life is good
  • 30.
  • 33.
  • 36. SEO
  • 38. Rethinking Navigation The Basics Keep it simple...
  • 39.
  • 42. SEO
  • 43.
  • 46. load
  • 47. Keep URLs Clean Build trust by reducing clutter Before: http://example.com/news.xhtml?p=my-new-post After: http://example.com/news/my-new-post/
  • 48. Keep URLs Clean Real Life: Should have been: http://www.llbean.com/webapp/wcs/stores/servlet/CategoryDisplay?categoryId=28&storeId=1&catalogId=1&langId=-1&nav=hp-gndp http://llbean.com/kids http://www.llbean.com/webapp/wcs/stores/servlet/CategoryDisplay? categoryId=28 & storeId=1 & catalogId=1 & langId=-1 & nav=hp-gndp Vulnerable!
  • 49. Keep URLs Clean Why don't more people buy used cars?
  • 50. Keep URLs Clean They don't trust the last owner. They're afraid of getting a bad deal.
  • 51.
  • 52. Trust me. http:// www.linkedin.com/in/lincolnthree http://ocpsoft.com/prettyfaces http://sourceforge.net/projects/resteasy/ http://www.youtube.com/watch?v=ZOU8GIRUd_g
  • 53.
  • 57.
  • 60. SEO
  • 61.
  • 64. load
  • 65.
  • 66. Be general, progress to specific
  • 67. Keep the query string optional
  • 68.
  • 69. where I am & what I'm looking at
  • 71.
  • 72. Problem solved <pretty-config> ... <url-mapping id=”viewProject”> <pattern> / project / #{currentProjectBean.project} </pattern> <view-id>/faces/project/view.xhtml</view-id> </url-mapping> … </pretty-config> PrettyFaces
  • 73.
  • 76. SEO
  • 77.
  • 80. load
  • 81.
  • 82. End-users have DIRECT ACCESS
  • 84. Validation @FacesValidator(“ projectName ”) public class ProjectNameValidator { public void validate(...) } <url-mapping id=”viewProject”> <pattern value=”/project/#{currentProjectBean.project}”> <validate param=&quot;0&quot; validatorIds=” projectName ... ” /> </pattern> <view-id>/faces/project/view.xhtml</view-id> </url-mapping> pretty-config.xml
  • 85. Validation Yes – pretty:id or empty PrettyFaces Validation Send 404 Is onError handler defined? Handler returned Successfully? Inject values & continue or redirect to “pretty:id” Throw Exception
  • 86.
  • 89. SEO
  • 90.
  • 93. load
  • 94.
  • 95. Lazy Loading (On access)
  • 97.
  • 99.
  • 100. Nothing fancy <pretty-config> ... <url-mapping id=”viewProject”> <pattern> /project/#{currentProjectBean.project} </pattern> <view-id>/faces/project/view.xhtml</view-id> <action> #{currentProjectBean.load} </action> </url-mapping> … </pretty-config> PrettyFaces
  • 101. Action Methods RESTORE_VIEW APPLY_REQUEST_VALUES PROCESS_VALIDATION … ANY_PHASE CurrentProjectBean + load() PrettyFaces Action Invocation <action>#{currentProjectBean.load}</action> Trigger Navigation Continue Lifecycle
  • 102. Alternatives More Configuration +3 +8 +1+n +4 Lines: = ~4 :) PrettyFaces = ~17! 2.0 view params Url Rewrite Filter 2.0 event listeners 1.x: requires seam or other pretty-config.xml
  • 103.
  • 104. Logical Parameter Order – Root the User
  • 107.
  • 108. basics
  • 110. SEO
  • 111.
  • 114. load
  • 115. Rethinking Navigation Rethinking Navigation so many channels, so little time...
  • 116.
  • 117. basics
  • 119. SEO
  • 120.
  • 123. GET
  • 124. History: the old <h:commandLink action=”viewProject” /> <navigation-rule> <from-view-id> * </from-view-id> <navigation-case> <from-action> * </from-action> <from-outcome>viewProject</from-outcome> <to-view-id>/faces/project/view.xhtml</to-view-id> </navigation-case> </navigation-rule>
  • 125. History: the new <h:link outcome=”/view”> <f:param name=”project” value=”prettyfaces”/> </h:link> <f:metadata> <f:viewParam name=”project” value=”...” /> </f:metadata>
  • 126.
  • 128.
  • 129. How often do we need them? pretty:hospital “ The baby's coming!” “ It might be a late night, Should we get some coffee?” No... “ What if we don't remember This? Let's get a video Camera!” NO! “ Should I pick up my mother?” DRIVE!!
  • 130.
  • 131. basics
  • 133. SEO
  • 134.
  • 137. GET
  • 138. pretty:mappingId private String actionMethod() { if(user.isMember) { return “ pretty:viewProject ”; } return “ pretty:joinProject ”; } < p:link mappingId=” hospital ”> <f:param value=”delivery”/> < /p:link >
  • 139. That Same Configuration The mapping ID <pretty-config> ... <url-mapping id=” viewProject ”> <pattern> /project/ #{currentProjectBean.project} </pattern> <view-id>/faces/project/view.xhtml</view-id> <action> #{currentProjectBean.load} </action> </url-mapping> … </pretty-config> PrettyFaces
  • 140. P14N is a “Scope” “ P14N is a Scope” private String createProject() { if(dao.createProject(project)) { currentProjectBean.setProject( “scrumshark” ); return “pretty:viewProject”; } FacesUtils.addError(“Something went wrong! Try again.”); return null; } project.getName()
  • 141.
  • 142. basics
  • 144. SEO
  • 145.
  • 148. GET
  • 149.
  • 150. JSF2 - Coupling view locations to action methods (what happens when you need to refactor?) Take your pick...
  • 151. But what about coupling? JSF2 /WebContent /faces /project view.xhtml Action Methods <h:link> <h:commandLink> faces-config.xml
  • 152. But what about coupling? PrettyFaces /WebContent /faces /project view.xhtml Action Methods <p:link> <h:commandLink> faces-config.xml pretty:viewProject
  • 153.
  • 154. “You GET what you ask for”
  • 155.
  • 156. basics
  • 158. SEO
  • 159.
  • 162. GET
  • 163. “You GET what you ask for” GET /project/scrumshark Create Project Action #{bean.create} GET /newproject Invoke Navigation “pretty:viewProject” <action> Load Project Data Render Response ?
  • 164. “You GET what you ask for” Option to handle behavior up front, instead of “behind” a submit. GET /project/scrumshark <action> Load Project Data ?
  • 165.
  • 166.
  • 168. Extension to existing JSF navigation
  • 169.
  • 170. basics
  • 172. SEO
  • 173.
  • 176. GET
  • 178.
  • 179. basics
  • 181. SEO
  • 182.
  • 183. basics
  • 184. change
  • 185.
  • 186. Keywords examples Poor: http://example.com/shop.jsf?catId=23&itemId=Z34FK94SE Partly there: http://example.com/shop.jsf?cat=books&item=how-to-start-a-web-store Perfect: http://example.com/shop/books?item=how-to-start-a-web-store Self-promoting Links
  • 187. Keywords examples <url-mapping id=&quot;viewItem&quot;> <pattern> /shop/#{catBean.item} </pattern> <query-param name=” item ”> {itemBean.itemName} </query-param> <view-id>/faces/shop.jsf</view-id> <action> #{itemBean.load} </action> </url-mapping>
  • 188.
  • 191.
  • 192. basics
  • 194. SEO
  • 195.
  • 196. basics
  • 197. change
  • 198. SEO is all you need False
  • 199. Install Google Analytics http://ocpsoft.com July 2008: 0 Nov 2009: 13,287 views 68% from search
  • 200.
  • 201. Get people to say they believe you
  • 202. Get search engines to believe you both
  • 203.
  • 204.
  • 205.
  • 206. Make sure your external links appear on pages relevant to your content.
  • 207.
  • 208. basics
  • 210. SEO
  • 211.
  • 212. basics
  • 213. change
  • 214. Plan for Change .jsf .jsp .php .do .cgi .asp
  • 215. Clean up your URLs Technology changes... be agnostic. /
  • 216.
  • 217. basics
  • 219. SEO
  • 220.
  • 221. basics
  • 222. change
  • 223. Examples what a “view”
  • 224. Setup Add Pretty Filter in web.xml <filter> <filter-name>Pretty Filter</filter-name> <filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class> </filter> <filter-mapping> <filter-name>Pretty Filter</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping>
  • 225. Map your first pages Create /WEB-INF/pretty-config.xml <pretty-config xmlns=&quot;http://ocpsoft.com/prettyfaces-xsd&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://ocpsoft.com/prettyfaces-xsd http://ocpsoft.com/xml/ns/prettyfaces/pretty-1.0.xsd&quot; > <url-mapping id=&quot;home&quot;> <pattern> /home </pattern> <view-id> /faces/home.jsf </view-id> </url-mapping> <url-mapping id=&quot;viewComment&quot;> <pattern value=”/story/#{myBean.currentStoryId}/#{myBean.commentId}” /> <view-id>/faces/story/comment.jsf</view-id> </url-mapping> </pretty-config>
  • 226. Add some actions Take action ;) <pretty-config xmlns=&quot;http://ocpsoft.com/prettyfaces-xsd&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://ocpsoft.com/prettyfaces-xsd http://ocpsoft.com/xml/ns/prettyfaces/pretty-1.0.xsd&quot; > <url-mapping id=&quot;home&quot;> <pattern> /home </pattern> <view-id> /faces/home.jsf </view-id> <action> #{homeBean.loadUserLayout} </action> </url-mapping> <url-mapping id=&quot;viewComment&quot;> <pattern value=”/story/#{myBean.currentStoryId}/#{myBean.commentId}” /> <view-id>/faces/story/comment.jsf</view-id> <action> #{myBean.load} </action> </url-mapping> </pretty-config>
  • 227. Validate (2.0.x series only) <pretty-config xmlns=&quot;http://ocpsoft.com/prettyfaces-xsd&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://ocpsoft.com/prettyfaces-xsd http://ocpsoft.com/xml/ns/prettyfaces/pretty-1.0.xsd&quot; > <url-mapping id=&quot;home&quot;> <pattern> /home </pattern> <view-id> /faces/home.jsf </view-id> <action> #{homeBean.loadUserLayout} </action> </url-mapping> <url-mapping id=&quot;viewComment&quot;> <pattern value=”/story/#{myBean.currentStoryId}/#{myBean.commentId}”> <validate param=”0” validatorIds=”integerValidator” /> <validate param=”1” validatorIds=”integerValidator” /> </pattern> <view-id>/faces/story/comment.jsf</view-id> <action>#{myBean.load}</action> </url-mapping> </pretty-config>
  • 228. Navigate viewComment.xhtml <%@ taglib prefix=&quot;pretty&quot; uri=&quot;http://ocpsoft.com/prettyfaces&quot; %>   <pretty:link mappingId=&quot;comment&quot;> <f:param value=&quot;23&quot; /> <f:param value=&quot;5&quot; /> Go to Comment. (This is Link Text) </pretty:link>   <pretty:link mappingId=&quot;comment&quot;> <f:param value=&quot;#{myBean.storyId}&quot; /> <f:param value=&quot;#{myBean.nextCommentId}&quot; /> View next comment. (This is Link Text) </pretty:link>
  • 229. The SiteMap If this presentation were a website... <pretty-config xmlns=&quot;http://ocpsoft.com/prettyfaces-xsd&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://ocpsoft.com/prettyfaces-xsd http://ocpsoft.com/xml/ns/prettyfaces/pretty-1.0.xsd&quot; > <url-mapping id=&quot;home&quot;> <pattern> /prettyfaces </pattern> <view-id> /faces/home.jsf </view-id> </url-mapping> <url-mapping id=&quot;levelOne&quot;> <pattern> /prettyfaces/#{presBean.levelOne} </pattern> <view-id> /faces/present.jsf </view-id> </url-mapping> <url-mapping id=&quot;levelTwo&quot;> <pattern> /prettyfaces/#{presBean.levelOne}/#{presBean.levelTwo} </pattern> <view-id> /faces/present.jsf </view-id> </url-mapping> </pretty-config>
  • 230. Questions? Lincoln Baxter, III Founder of O cpSoft @lincolnthree http://ocpsoft.com http://scrumshark.com http://ocpsoft.com/prettyfaces http://ocpsoft.com/prettytime

Notas del editor

  1. Thank everyone for attending Tell them who you are Tell them where you are from and some of your hobbies
  2. Went to Northfield Mount Hermon, and Penn State I want to start my own company Went through a few ideas with friends, landed on scrumshark I&apos;m talking about this because... scrumshark started prettyfaces
  3. Client Facing Applications You&apos;ve got a stunning user interface, but your URLs are ugly... put in the extra effort