Your SlideShare is downloading. ×
0
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
PrettyFaces: SEO, Dynamic, Parameters, Bookmarks, Navigation for JSF / JSF2 (UrlRewrite)
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

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

10,403

Published on

PrettyFaces: SEO, Dynamic Parameters, Bookmarks, and Navigation for JSF / JSF2 - As presented at JSFSummit2009 in Orlando Florida. …

PrettyFaces: SEO, Dynamic Parameters, Bookmarks, and Navigation for JSF / JSF2 - As presented at JSFSummit2009 in Orlando Florida.

Why should we use PrettyFaces?

Published in: Technology, Design
1 Comment
3 Likes
Statistics
Notes
No Downloads
Views
Total Views
10,403
On Slideshare
0
From Embeds
0
Number of Embeds
38
Actions
Shares
0
Downloads
135
Comments
1
Likes
3
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Thank everyone for attending Tell them who you are Tell them where you are from and some of your hobbies
  • 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'm talking about this because... scrumshark started prettyfaces
  • Client Facing Applications You've got a stunning user interface, but your URLs are ugly... put in the extra effort
  • Transcript

    • 1. PrettyFaces Client-facing JSF – Lincoln Baxter, III
    • 2. SiteMap <ul><li>PrettyFaces </li><ul><li>background
    • 3. basics
    • 4. navigation
    • 5. SEO
    • 6. examples </li></ul></ul>
    • 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 &lt;action&gt; #{storeBean.loadItem} &lt;/action&gt;
    • 10. PrettyFaces is: Simplified Navigation “ viewStore ” -&gt; http://example.com/store
    • 11. SiteMap <ul><li>PrettyFaces </li><ul><li>background
    • 12. basics
    • 13. navigation
    • 14. SEO
    • 15. examples </li></ul></ul>
    • 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. The Problem <ul><li>JSF1.x </li><ul><li>Good separation between M &amp; V of MVC
    • 19. Had usability issues, pitfalls
    • 20. Navigation was a pain...
    • 21. No bookmarks? Not entirely true.
    • 22. What about Pretty URLs / SEO? </li></ul></ul>
    • 23. The Result <ul><li>Took a while </li><ul><li>Tried a few other tools
    • 24. Applied the 80/20 rule
    • 25. Destroyed Thanksgiving 2008 </li></ul></ul>
    • 26. The Result <ul><li>Came out with a Gem: PrettyFaces </li><ul><li>URLs were clean, search optimized
    • 27. Faces-config practically gone
    • 28. Data loading easy &amp; declarative </li></ul></ul>Easy, Bookmarkable JSF
    • 29. :) Life is good
    • 30. Why do we need Pretty URLs? <ul><li>Build Trust
    • 31. Enhance User Experience
    • 32. Self-Promote </li></ul>
    • 33. SiteMap <ul><li>PrettyFaces </li><ul><li>background
    • 34. basics
    • 35. navigation
    • 36. SEO
    • 37. examples </li></ul></ul>
    • 38. Rethinking Navigation The Basics Keep it simple...
    • 39. SiteMap <ul><li>PrettyFaces </li><ul><li>background
    • 40. basics
    • 41. navigation
    • 42. SEO
    • 43. examples </li></ul></ul><ul><ul><li>clean
    • 44. parameterize
    • 45. validate
    • 46. load </li></ul></ul>
    • 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&amp;storeId=1&amp;catalogId=1&amp;langId=-1&amp;nav=hp-gndp http://llbean.com/kids http://www.llbean.com/webapp/wcs/stores/servlet/CategoryDisplay? categoryId=28 &amp; storeId=1 &amp; catalogId=1 &amp; langId=-1 &amp; nav=hp-gndp Vulnerable!
    • 49. Keep URLs Clean Why don&apos;t more people buy used cars?
    • 50. Keep URLs Clean They don&apos;t trust the last owner. They&apos;re afraid of getting a bad deal.
    • 51. Keep URLs Clean <ul><li>Trust me?
    • 52. Trust me. </li></ul>http:// www.linkedin.com/in/lincolnthree http://ocpsoft.com/prettyfaces http://sourceforge.net/projects/resteasy/ http://www.youtube.com/watch?v=ZOU8GIRUd_g
    • 53. Keep URLs Clean <ul><li>Clean, readable URLs: </li><ul><li>Build trust
    • 54. Are self-promoting, benefit SEO
    • 55. Reduce vulnerability
    • 56. Root the user </li></ul></ul>
    • 57. SiteMap <ul><li>PrettyFaces </li><ul><li>background
    • 58. basics
    • 59. navigation
    • 60. SEO
    • 61. examples </li></ul></ul><ul><ul><li>clean
    • 62. parameterize
    • 63. validate
    • 64. load </li></ul></ul>
    • 65. Parameterization (p14n) / root / the / user <ul><ul><li>Be consistent... always
    • 66. Be general, progress to specific
    • 67. Keep the query string optional </li></ul></ul>
    • 68. Parameterization (p14n) <ul><li>P14N is: </li><ul><li>a “Scope”
    • 69. where I am &amp; what I&apos;m looking at
    • 70. user accessible </li></ul></ul>
    • 71. Parameterization (p14n) Examples: <ul><li>No! </li></ul>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
    • 72. Problem solved &lt;pretty-config&gt; ... &lt;url-mapping id=”viewProject”&gt; &lt;pattern&gt; / project / #{currentProjectBean.project} &lt;/pattern&gt; &lt;view-id&gt;/faces/project/view.xhtml&lt;/view-id&gt; &lt;/url-mapping&gt; … &lt;/pretty-config&gt; PrettyFaces
    • 73. SiteMap <ul><li>PrettyFaces </li><ul><li>background
    • 74. basics
    • 75. navigation
    • 76. SEO
    • 77. examples </li></ul></ul><ul><ul><li>clean
    • 78. parameterize
    • 79. validate
    • 80. load </li></ul></ul>
    • 81. Validation <ul><li>P14n is a “Scope”
    • 82. End-users have DIRECT ACCESS
    • 83. Validate everything </li></ul>
    • 84. Validation @FacesValidator(“ projectName ”) public class ProjectNameValidator { public void validate(...) } &lt;url-mapping id=”viewProject”&gt; &lt;pattern value=”/project/#{currentProjectBean.project}”&gt; &lt;validate param=&amp;quot;0&amp;quot; validatorIds=” projectName ... ” /&gt; &lt;/pattern&gt; &lt;view-id&gt;/faces/project/view.xhtml&lt;/view-id&gt; &lt;/url-mapping&gt; pretty-config.xml
    • 85. Validation Yes – pretty:id or empty PrettyFaces Validation Send 404 Is onError handler defined? Handler returned Successfully? Inject values &amp; continue or redirect to “pretty:id” Throw Exception
    • 86. SiteMap <ul><li>PrettyFaces </li><ul><li>background
    • 87. basics
    • 88. navigation
    • 89. SEO
    • 90. examples </li></ul></ul><ul><ul><li>clean
    • 91. parameterize
    • 92. validate
    • 93. load </li></ul></ul>
    • 94. Data Loading A few ways to do it: <ul><ul><li>Always Load (On construction)
    • 95. Lazy Loading (On access)
    • 96. Declarative Loading (On event) </li></ul></ul>
    • 97. Data Loading <ul><li>Declarative Loading </li><ul><li>JSF1.x traditionally sticky with this
    • 98. Enables deterministic behavior
    • 99. JSF2 helps a lot </li><ul><li>More on that later </li></ul></ul></ul>
    • 100. Nothing fancy &lt;pretty-config&gt; ... &lt;url-mapping id=”viewProject”&gt; &lt;pattern&gt; /project/#{currentProjectBean.project} &lt;/pattern&gt; &lt;view-id&gt;/faces/project/view.xhtml&lt;/view-id&gt; &lt;action&gt; #{currentProjectBean.load} &lt;/action&gt; &lt;/url-mapping&gt; … &lt;/pretty-config&gt; PrettyFaces
    • 101. Action Methods RESTORE_VIEW APPLY_REQUEST_VALUES PROCESS_VALIDATION … ANY_PHASE CurrentProjectBean + load() PrettyFaces Action Invocation &lt;action&gt;#{currentProjectBean.load}&lt;/action&gt; 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. The Basics <ul><li>Keep URLs clean – Build trust, self promote
    • 104. Logical Parameter Order – Root the User
    • 105. Validate everything
    • 106. Load data declaratively </li></ul>
    • 107. SiteMap <ul><li>PrettyFaces </li><ul><li>background
    • 108. basics
    • 109. navigation
    • 110. SEO
    • 111. examples </li></ul></ul><ul><ul><li>clean
    • 112. parameterize
    • 113. validate
    • 114. load </li></ul></ul>
    • 115. Rethinking Navigation Rethinking Navigation so many channels, so little time...
    • 116. SiteMap <ul><li>PrettyFaces </li><ul><li>background
    • 117. basics
    • 118. navigation
    • 119. SEO
    • 120. examples </li></ul></ul><ul><ul><li>history
    • 121. mappingId
    • 122. de-coupling
    • 123. GET </li></ul></ul>
    • 124. History: the old &lt;h:commandLink action=”viewProject” /&gt; &lt;navigation-rule&gt; &lt;from-view-id&gt; * &lt;/from-view-id&gt; &lt;navigation-case&gt; &lt;from-action&gt; * &lt;/from-action&gt; &lt;from-outcome&gt;viewProject&lt;/from-outcome&gt; &lt;to-view-id&gt;/faces/project/view.xhtml&lt;/to-view-id&gt; &lt;/navigation-case&gt; &lt;/navigation-rule&gt;
    • 125. History: the new &lt;h:link outcome=”/view”&gt; &lt;f:param name=”project” value=”prettyfaces”/&gt; &lt;/h:link&gt; &lt;f:metadata&gt; &lt;f:viewParam name=”project” value=”...” /&gt; &lt;/f:metadata&gt;
    • 126. History: Navigation Cases <ul><li>Complex logic can be pulled into XML
    • 127. Conditional evaluation and outcomes
    • 128. Selectively pass page-params </li><ul><li>… sounds like code? </li></ul></ul>
    • 129. How often do we need them? pretty:hospital “ The baby&apos;s coming!” “ It might be a late night, Should we get some coffee?” No... “ What if we don&apos;t remember This? Let&apos;s get a video Camera!” NO! “ Should I pick up my mother?” DRIVE!!
    • 130. SiteMap <ul><li>PrettyFaces </li><ul><li>background
    • 131. basics
    • 132. navigation
    • 133. SEO
    • 134. examples </li></ul></ul><ul><ul><li>history
    • 135. mappingId
    • 136. de-coupling
    • 137. GET </li></ul></ul>
    • 138. pretty:mappingId private String actionMethod() { if(user.isMember) { return “ pretty:viewProject ”; } return “ pretty:joinProject ”; } &lt; p:link mappingId=” hospital ”&gt; &lt;f:param value=”delivery”/&gt; &lt; /p:link &gt;
    • 139. That Same Configuration The mapping ID &lt;pretty-config&gt; ... &lt;url-mapping id=” viewProject ”&gt; &lt;pattern&gt; /project/ #{currentProjectBean.project} &lt;/pattern&gt; &lt;view-id&gt;/faces/project/view.xhtml&lt;/view-id&gt; &lt;action&gt; #{currentProjectBean.load} &lt;/action&gt; &lt;/url-mapping&gt; … &lt;/pretty-config&gt; 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. SiteMap <ul><li>PrettyFaces </li><ul><li>background
    • 142. basics
    • 143. navigation
    • 144. SEO
    • 145. examples </li></ul></ul><ul><ul><li>history
    • 146. mappingId
    • 147. de-coupling
    • 148. GET </li></ul></ul>
    • 149. But what about coupling? <ul><li>PrettyFaces - Coupling pretty:ids to action methods
    • 150. JSF2 - Coupling view locations to action methods </li></ul>(what happens when you need to refactor?) Take your pick...
    • 151. But what about coupling? JSF2 /WebContent /faces /project view.xhtml Action Methods &lt;h:link&gt; &lt;h:commandLink&gt; faces-config.xml
    • 152. But what about coupling? PrettyFaces /WebContent /faces /project view.xhtml Action Methods &lt;p:link&gt; &lt;h:commandLink&gt; faces-config.xml pretty:viewProject
    • 153. But what about coupling? <ul><li>PrettyFaces – pretty:ids abstract resource locations, lowers maintenance cost.
    • 154. “You GET what you ask for” </li></ul>
    • 155. SiteMap <ul><li>PrettyFaces </li><ul><li>background
    • 156. basics
    • 157. navigation
    • 158. SEO
    • 159. examples </li></ul></ul><ul><ul><li>history
    • 160. mappingId
    • 161. de-coupling
    • 162. GET </li></ul></ul>
    • 163. “You GET what you ask for” GET /project/scrumshark Create Project Action #{bean.create} GET /newproject Invoke Navigation “pretty:viewProject” &lt;action&gt; 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 &lt;action&gt; Load Project Data ?
    • 165. Can I still use JSF navigation? <ul>Yes – PrettyFaces extends, does not interfere with, JSF navigation. </ul>
    • 166. In summary <ul><li>PrettyFaces offers: </li><ul><li>Declarative navigation via GET
    • 167. Encapsulation, de-coupling from view-location
    • 168. Extension to existing JSF navigation </li></ul></ul>
    • 169. SiteMap <ul><li>PrettyFaces </li><ul><li>background
    • 170. basics
    • 171. navigation
    • 172. SEO
    • 173. examples </li></ul></ul><ul><ul><li>history
    • 174. mappingId
    • 175. de-coupling
    • 176. GET </li></ul></ul>
    • 177. Search Engine Optimization
    • 178. SiteMap <ul><li>PrettyFaces </li><ul><li>background
    • 179. basics
    • 180. navigation
    • 181. SEO
    • 182. examples </li></ul></ul><ul><ul><li>keywords
    • 183. basics
    • 184. change </li></ul></ul>
    • 185. Keywords <ul><li>PUT KEYWORDS IN THE URL </li></ul>#1 Self-promoting Links
    • 186. Keywords examples Poor: http://example.com/shop.jsf?catId=23&amp;itemId=Z34FK94SE Partly there: http://example.com/shop.jsf?cat=books&amp;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 &lt;url-mapping id=&amp;quot;viewItem&amp;quot;&gt; &lt;pattern&gt; /shop/#{catBean.item} &lt;/pattern&gt; &lt;query-param name=” item ”&gt; {itemBean.itemName} &lt;/query-param&gt; &lt;view-id&gt;/faces/shop.jsf&lt;/view-id&gt; &lt;action&gt; #{itemBean.load} &lt;/action&gt; &lt;/url-mapping&gt;
    • 188. Why do we need Pretty URLs? <ul><li>Build Trust, Transparency
    • 189. Enhance User Experience
    • 190. Self-Promote, SEO </li></ul>
    • 191. SiteMap <ul><li>PrettyFaces </li><ul><li>background
    • 192. basics
    • 193. navigation
    • 194. SEO
    • 195. examples </li></ul></ul><ul><ul><li>keywords
    • 196. basics
    • 197. change </li></ul></ul>
    • 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. Three Fundamentals <ul><li>Actually provide information
    • 201. Get people to say they believe you
    • 202. Get search engines to believe you both </li></ul>
    • 203. That means... <ul><li>Content: </li></ul>Choose your keywords, make sure they are appropriate for your content.
    • 204. That means... <ul><li>Credibility: </li></ul>Get other people to link back to your site, or create those links yourself.
    • 205. That means... <ul><li>Context:
    • 206. Make sure your external links appear on pages relevant to your content. </li></ul>
    • 207. SiteMap <ul><li>PrettyFaces </li><ul><li>background
    • 208. basics
    • 209. navigation
    • 210. SEO
    • 211. examples </li></ul></ul><ul><ul><li>keywords
    • 212. basics
    • 213. change </li></ul></ul>
    • 214. Plan for Change .jsf .jsp .php .do .cgi .asp
    • 215. Clean up your URLs Technology changes... be agnostic. /
    • 216. SiteMap <ul><li>PrettyFaces </li><ul><li>background
    • 217. basics
    • 218. navigation
    • 219. SEO
    • 220. examples </li></ul></ul><ul><ul><li>keywords
    • 221. basics
    • 222. change </li></ul></ul>
    • 223. Examples what a “view”
    • 224. Setup Add Pretty Filter in web.xml &lt;filter&gt; &lt;filter-name&gt;Pretty Filter&lt;/filter-name&gt; &lt;filter-class&gt;com.ocpsoft.pretty.PrettyFilter&lt;/filter-class&gt; &lt;/filter&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;Pretty Filter&lt;/filter-name&gt; &lt;url-pattern&gt;/*&lt;/url-pattern&gt; &lt;dispatcher&gt;REQUEST&lt;/dispatcher&gt; &lt;dispatcher&gt;FORWARD&lt;/dispatcher&gt; &lt;/filter-mapping&gt;
    • 225. Map your first pages Create /WEB-INF/pretty-config.xml &lt;pretty-config xmlns=&amp;quot;http://ocpsoft.com/prettyfaces-xsd&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; xsi:schemaLocation=&amp;quot;http://ocpsoft.com/prettyfaces-xsd http://ocpsoft.com/xml/ns/prettyfaces/pretty-1.0.xsd&amp;quot; &gt; &lt;url-mapping id=&amp;quot;home&amp;quot;&gt; &lt;pattern&gt; /home &lt;/pattern&gt; &lt;view-id&gt; /faces/home.jsf &lt;/view-id&gt; &lt;/url-mapping&gt; &lt;url-mapping id=&amp;quot;viewComment&amp;quot;&gt; &lt;pattern value=”/story/#{myBean.currentStoryId}/#{myBean.commentId}” /&gt; &lt;view-id&gt;/faces/story/comment.jsf&lt;/view-id&gt; &lt;/url-mapping&gt; &lt;/pretty-config&gt;
    • 226. Add some actions Take action ;) &lt;pretty-config xmlns=&amp;quot;http://ocpsoft.com/prettyfaces-xsd&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; xsi:schemaLocation=&amp;quot;http://ocpsoft.com/prettyfaces-xsd http://ocpsoft.com/xml/ns/prettyfaces/pretty-1.0.xsd&amp;quot; &gt; &lt;url-mapping id=&amp;quot;home&amp;quot;&gt; &lt;pattern&gt; /home &lt;/pattern&gt; &lt;view-id&gt; /faces/home.jsf &lt;/view-id&gt; &lt;action&gt; #{homeBean.loadUserLayout} &lt;/action&gt; &lt;/url-mapping&gt; &lt;url-mapping id=&amp;quot;viewComment&amp;quot;&gt; &lt;pattern value=”/story/#{myBean.currentStoryId}/#{myBean.commentId}” /&gt; &lt;view-id&gt;/faces/story/comment.jsf&lt;/view-id&gt; &lt;action&gt; #{myBean.load} &lt;/action&gt; &lt;/url-mapping&gt; &lt;/pretty-config&gt;
    • 227. Validate (2.0.x series only) &lt;pretty-config xmlns=&amp;quot;http://ocpsoft.com/prettyfaces-xsd&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; xsi:schemaLocation=&amp;quot;http://ocpsoft.com/prettyfaces-xsd http://ocpsoft.com/xml/ns/prettyfaces/pretty-1.0.xsd&amp;quot; &gt; &lt;url-mapping id=&amp;quot;home&amp;quot;&gt; &lt;pattern&gt; /home &lt;/pattern&gt; &lt;view-id&gt; /faces/home.jsf &lt;/view-id&gt; &lt;action&gt; #{homeBean.loadUserLayout} &lt;/action&gt; &lt;/url-mapping&gt; &lt;url-mapping id=&amp;quot;viewComment&amp;quot;&gt; &lt;pattern value=”/story/#{myBean.currentStoryId}/#{myBean.commentId}”&gt; &lt;validate param=”0” validatorIds=”integerValidator” /&gt; &lt;validate param=”1” validatorIds=”integerValidator” /&gt; &lt;/pattern&gt; &lt;view-id&gt;/faces/story/comment.jsf&lt;/view-id&gt; &lt;action&gt;#{myBean.load}&lt;/action&gt; &lt;/url-mapping&gt; &lt;/pretty-config&gt;
    • 228. Navigate viewComment.xhtml &lt;%@ taglib prefix=&amp;quot;pretty&amp;quot; uri=&amp;quot;http://ocpsoft.com/prettyfaces&amp;quot; %&gt;   &lt;pretty:link mappingId=&amp;quot;comment&amp;quot;&gt; &lt;f:param value=&amp;quot;23&amp;quot; /&gt; &lt;f:param value=&amp;quot;5&amp;quot; /&gt; Go to Comment. (This is Link Text) &lt;/pretty:link&gt;   &lt;pretty:link mappingId=&amp;quot;comment&amp;quot;&gt; &lt;f:param value=&amp;quot;#{myBean.storyId}&amp;quot; /&gt; &lt;f:param value=&amp;quot;#{myBean.nextCommentId}&amp;quot; /&gt; View next comment. (This is Link Text) &lt;/pretty:link&gt;
    • 229. The SiteMap If this presentation were a website... &lt;pretty-config xmlns=&amp;quot;http://ocpsoft.com/prettyfaces-xsd&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; xsi:schemaLocation=&amp;quot;http://ocpsoft.com/prettyfaces-xsd http://ocpsoft.com/xml/ns/prettyfaces/pretty-1.0.xsd&amp;quot; &gt; &lt;url-mapping id=&amp;quot;home&amp;quot;&gt; &lt;pattern&gt; /prettyfaces &lt;/pattern&gt; &lt;view-id&gt; /faces/home.jsf &lt;/view-id&gt; &lt;/url-mapping&gt; &lt;url-mapping id=&amp;quot;levelOne&amp;quot;&gt; &lt;pattern&gt; /prettyfaces/#{presBean.levelOne} &lt;/pattern&gt; &lt;view-id&gt; /faces/present.jsf &lt;/view-id&gt; &lt;/url-mapping&gt; &lt;url-mapping id=&amp;quot;levelTwo&amp;quot;&gt; &lt;pattern&gt; /prettyfaces/#{presBean.levelOne}/#{presBean.levelTwo} &lt;/pattern&gt; &lt;view-id&gt; /faces/present.jsf &lt;/view-id&gt; &lt;/url-mapping&gt; &lt;/pretty-config&gt;
    • 230. Questions? Lincoln Baxter, III Founder of O cpSoft @lincolnthree http://ocpsoft.com http://scrumshark.com http://ocpsoft.com/prettyfaces http://ocpsoft.com/prettytime

    ×