Dear Wiki user, You have subscribed to a wiki page or wiki category on "Tapestry Wiki" for change notification.
The "Tapestry5HowTos" page has been changed by LeonardLu. http://wiki.apache.org/tapestry/Tapestry5HowTos?action=diff&rev1=190&rev2=191 -------------------------------------------------- == How to get started == In order to quickly get up to speed on Tapestry 5, there are numerous information sources besides this Wiki available: + * [[http://tapestry.apache.org/tapestry5/screencast.html|Howard's screencasts]] * [[http://tapestry.apache.org/tapestry5/tutorial1/|Howard's tutorial (in progress)]] * [[http://www.infoq.com/articles/tapestry5-intro|Tapestry for Nonbelievers]] @@ -31, +32 @@ * [[http://tapestry5.ideascale.com|Tapestry 5 Caffe (Post your new ideas here. Check out other people's ideas and vote on the ones you like best. Talk about ideas.)]] == Code snippets == - ==== Selection Objects ==== - - * [[Tapestry5DisplayableSelectionModel]] - A selection model for objects that implement an interface. Used for select components and more. + * Tapestry5DisplayableSelectionModel - A selection model for objects that implement an interface. Used for select components and more. - * [[Tapestry5SelectObject]] - An alternative implementation of the Select core component based on the Daniel Jue's !GenericSelectionModel and !GenericValueEncoder classes. + * Tapestry5SelectObject - An alternative implementation of the Select core component based on the Daniel Jue's !GenericSelectionModel and !GenericValueEncoder classes. - * [[Tapestry5MultipleSelectOnObjects]] - Explains how to build a multiple select component based on Daniel Jue's !GenericValueEncoder classes. + * Tapestry5MultipleSelectOnObjects - Explains how to build a multiple select component based on Daniel Jue's !GenericValueEncoder classes. - * [[Tapestry5HowtoSelectWithObjects]] - another example on how to make <SELECT> filled with objects + * Tapestry5HowtoSelectWithObjects - another example on how to make <SELECT> filled with objects - * [[Tapestry5AnotherSelectWithObjects]] - One more example with on how to make <SELECT> on objects, now with annotations. + * Tapestry5AnotherSelectWithObjects - One more example with on how to make <SELECT> on objects, now with annotations. ==== Inversion of Control (IOC) ==== - * [[Tapestry5HowToIocOnly]] - Example of using tapestry-oc standalone (without web part). And the same, but with tapestry-hibernate added [[Tapestry5HowToIocAndHibernate]] + * Tapestry5HowToIocOnly - Example of using tapestry-oc standalone (without web part). And the same, but with tapestry-hibernate added Tapestry5HowToIocAndHibernate * [[Tapestry5HowToCreateADispatcher]] - How to create a completely transparent access control system by implementing a Dispatcher. * [[Tapestry5HowToCreateADispatcher2]] - A supplemental article showing how to access request-specific data (ASOs) from a singleton service. To demonstrate we expand on the code shown in the first article. - * [[Tapestry5HowToDecorateService]] - An example of a simple service decorator + * Tapestry5HowToDecorateService - An example of a simple service decorator ===== Binding Prefixes ===== - Bindings are used in templates ''${message:myMessageKey}'' or as attribute to components ''<t:mycomponent value="literal:Hello world"/>'' to access message in resource bundles, properties, pass String literals and many more. + Bindings are used in templates ''${message:myMessageKey}'' or as attribute to components ''<t:mycomponent value="literal:Hello world"/>'' to access message in resource bundles, properties, pass String literals and many more. The following pages explain how to write your own bindings. - The following pages explain how to write your own bindings. + - * [[Tapestry5HowToAddBindingPrefix]] - An example of a list: binding prefix. Useful for Action/Event/!PageLink context etc. + * Tapestry5HowToAddBindingPrefix - An example of a list: binding prefix. Useful for Action/Event/!PageLink context etc. - * [[Tapestry5HowToAddMapBindingPrefix]] - An example of a map: binding prefix. Useful for supplying key=value pairs to components. + * Tapestry5HowToAddMapBindingPrefix - An example of a map: binding prefix. Useful for supplying key=value pairs to components. - * [[Tapestry5HowToAddBindingPrefixCycle]] - An example of an cycle: binding prefix. Makes zebra effect simple to do {{{<t:grid .... rowClass="cycle:line1,line2">}}} + * Tapestry5HowToAddBindingPrefixCycle - An example of an cycle: binding prefix. Makes zebra effect simple to do {{{<t:grid .... rowClass="cycle:line1,line2">}}} - * [[Tapestry5HowToAddMessageFormatBindingPrefix]] - Describes how to add a messageformat prefix for specifying values for use in messages inline. + * Tapestry5HowToAddMessageFormatBindingPrefix - Describes how to add a messageformat prefix for specifying values for use in messages inline. ===== Localization ===== - - * [[Tapestry5HowToDomainLevelLocalization]] - An example of how to overwrite the Locale domain-dependent + * Tapestry5HowToDomainLevelLocalization - An example of how to overwrite the Locale domain-dependent ==== General ==== - * [[Tapestry5HowToFormatDateTimeEtc]] - How to format Date, Time, timestamps, Decimals, Numbers, Currencies + * Tapestry5HowToFormatDateTimeEtc - How to format Date, Time, timestamps, Decimals, Numbers, Currencies - * [[Tapestry5LocalizedDateField]] - How to create a localized !DateField for !BeanModel. + * Tapestry5LocalizedDateField - How to create a localized !DateField for !BeanModel. - * [[Tapestry5OutputtingRawHtml]] - How to output raw, unfiltered HTML + * Tapestry5OutputtingRawHtml - How to output raw, unfiltered HTML * [[Tapestry5LinkingToNonTapestryURIs]] - How to link to non-Tapestry URIs (useful for Acegi integration) - * [[Tapestry5ObtainingHttpServletRequest]] - How to obtain the !HttpServletRequest, !HttpServletResponse and !HttpSession if you really need them + * Tapestry5ObtainingHttpServletRequest - How to obtain the !HttpServletRequest, !HttpServletResponse and !HttpSession if you really need them * [[Tapestry5HowToCreateAPropertyEditBlock]] - Explains how to create a property editor and contribute it to the [[http://tapestry.apache.org/tapestry5/tapestry-core/guide/beaneditform.html|BeanEditForm]]. - * [[Tapestry5HowToUseForms]] - Examples of how forms are connected to methods in your code. + * Tapestry5HowToUseForms - Examples of how forms are connected to methods in your code. - * [[Tapestry5ExceptionPage]] - How to display your own exception page. + * Tapestry5ExceptionPage - How to display your own exception page. - * [[Tapestry5RedirectException]] - Redirect to another URL from anywhere inside a page or component. + * Tapestry5RedirectException - Redirect to another URL from anywhere inside a page or component. - * [[Tapestry5HowToChangeLocale]] - Change the locale of the user. + * Tapestry5HowToChangeLocale - Change the locale of the user. - * [[Tapestry5HowToIncludeJavaScript]] - Explains how to add your own custom !JavaScript functions. + * Tapestry5HowToIncludeJavaScript - Explains how to add your own custom !JavaScript functions. * [[Tapestry5HowToIntegrateJQuery]] - Include jQuery and it's plugins to spice up your pages! * [[Tapestry5How_to_make_a_basic_crud]] show you how easy is the conception of a CRUD cycle with Tapestry 5 - * [[Tapestry5HowToRunTaskInThread]] - run a task (Runnable) in a separate thread + * Tapestry5HowToRunTaskInThread - run a task (Runnable) in a separate thread - * [[Tapestry5HowToWorkQueue]] - run multiple task through a !WorkQueue with one or more threads + * Tapestry5HowToWorkQueue - run multiple task through a !WorkQueue with one or more threads - * [[Tapestry5HowToUsePersistentFieldStrategy]] - How to create a !PersistentFieldStrategy for the Persist annotation. working cookie example + * Tapestry5HowToUsePersistentFieldStrategy - How to create a !PersistentFieldStrategy for the Persist annotation. working cookie example - * [[Tapestry5HowToAddValidators]] - How to add your own validators to tapestry + * Tapestry5HowToAddValidators - How to add your own validators to tapestry - * [[Tapestry5HowToXhtml]] - How to override the default markup model to always use XHTML compliant tags + * Tapestry5HowToXhtml - How to override the default markup model to always use XHTML compliant tags - * [[Tapestry5HowToReadSymbolsFromPropertiesFile]] - How to have symbols coming from a properties file and how to use them in your pages/components + * Tapestry5HowToReadSymbolsFromPropertiesFile - How to have symbols coming from a properties file and how to use them in your pages/components - * [[Tapestry5HowToUseTapestryForCustomErrorPages]] - How to serve a custom 404 page, or other error, using Tapestry + * Tapestry5HowToUseTapestryForCustomErrorPages - How to serve a custom 404 page, or other error, using Tapestry - * [[Tapestry5HowToWebappFullPath]] - How to get the real path of the webapp directory. + * Tapestry5HowToWebappFullPath - How to get the real path of the webapp directory. * [[Tapestry5HowToReadAFileFromContext]] - How a service reads a file from web app context folder - * [[Tapestry5HowToUseTapestryTest]] - How to actually use Tapestry test + * Tapestry5HowToUseTapestryTest - How to actually use Tapestry test - * [[Tapestry5HowToVisualizeComponentHierarchy]] - How to visualize the component hierarchy just on your pages in the browser + * Tapestry5HowToVisualizeComponentHierarchy - How to visualize the component hierarchy just on your pages in the browser == Streaming Data == * [[Tapestry5HowToCreatePieChartsInAPage]] - An example of dynamic charts inside a page (Using StreamResponse) * [[Tapestry5HowToCreateASimpleGraphComponent]] - An example of simple pie chart component (Using StreamResponse) * [[Tapestry5HowToCreateADynamicPDF]] - A simple example of how to return a dynamically generated PDF from an event (Using StreamResponse) - * [[Tapestry5HowToStreamAnExistingBinaryFile]] - A simple example of how to stream an existing file, like an image. (Using StreamResponse) + * Tapestry5HowToStreamAnExistingBinaryFile - A simple example of how to stream an existing file, like an image. (Using StreamResponse) == Integration with other web frameworks == - ==== Spring ==== - * [[Tapestry5SpringIntegration]] - How to inject Spring beans into Tapestry pages and components + * Tapestry5SpringIntegration - How to inject Spring beans into Tapestry pages and components - * [[Tapestry51SpringJpaIntegration]] - Quick tutorial on using Tapestry with Spring Transactions and JPA + * Tapestry51SpringJpaIntegration - Quick tutorial on using Tapestry with Spring Transactions and JPA - * [[Tapestry5_How_To_Integrate_Components_With_Spring_Transactions]] - brief tutorial of how to integrate Tapestry5 components with Spring transactions. + * [[Tapestry5_How_To_Integrate_Components_With_Spring_Transactions]] - brief tutorial of how to integrate Tapestry5 components with Spring transactions. * [[Tapestry5-TestWithTapestry-Spring]] - How to test Tapestry pages which use Spring Beans ==== Google Web Toolkit (GWT) ==== * [[http://www.pmdit.se/blog/2008/04/03/tapestry_5_and_gwt_part_1.html|Tapestry 5 and GWT]] [[http://www.pmdit.se/blog/2008/04/08/tapestry_5_and_gwt_part_2.html|Part 2]] - * [[Tapestry5GWTIntegration]] - An example based heavily on Pär Dahlberg's blog example on [[http://www.pmdit.se/blog]], with generalized design tips. + * [[Tapestry5GWTIntegration]] - An example based heavily on Pär Dahlberg's blog example on http://www.pmdit.se/blog, with generalized design tips. + ==== Adobe Flash ==== * [[http://knol.google.com/k/toby-hobson/tapestry-5-flash-integration/|Tapestry5 Adobe Flash integration]] - Explains how to create reusable Tapestry components which render swf's == Authentication and Authorization related == - * [[http://wiki.interldap.objectweb.org/xwiki/bin/view/Main/Tapestry5HowToAcegiCas|How to use T5 with Acegi Security and CAS]] - Francois Armand explains how he combines T5, Acegi Security and CAS (A Central Authentication Service, providing intranet single sign-on). - * [[Tapestry5Acegi]] How to secure Tapestry5 pages with Java5 annotations using the Acegi security framework + * Tapestry5Acegi How to secure Tapestry5 pages with Java5 annotations using the Acegi security framework - * [[Tapestry5AcegiNoAnnotations]] How to use Acegi Security with Tapestry 5, in the classical way (no annotations, some XML) + * Tapestry5AcegiNoAnnotations How to use Acegi Security with Tapestry 5, in the classical way (no annotations, some XML) - * [[Tapestry5HowToControlAccess]] - Another supplemental article based on [[Tapestry5HowToCreateADispatcher2]] showing how to control access to pages based on an annotation. + * Tapestry5HowToControlAccess - Another supplemental article based on [[Tapestry5HowToCreateADispatcher2]] showing how to control access to pages based on an annotation. * [[Tapestry5HowToSecureWithAcegiAndLDAP]] - How to protect you application using Acegi and LDAP * [[Tapestry5HowToSecureWithSpringAndLDAP]] - How to protect you application using Spring Security and LDAP * Tapestry5HowToSpringSecurityAndOpenId - How to provide OpenID authentication to your clients using tapestry-spring-security - * [[Tapestry5HowToMitigateLoginAttacks]] - How to track failed logins and mitigate brute force or dictionary attacks + * Tapestry5HowToMitigateLoginAttacks - How to track failed logins and mitigate brute force or dictionary attacks == Security related == - Security is the condition of being protected against danger, loss, and criminals. * [[Tapestry5CSRF]] - How to protect against 'Cross-site request forgeries' (CSRF) - * [[Tapestry5PreventClientSideChanges]] - How to protect server side generated values against client side changes using a HMAC + * Tapestry5PreventClientSideChanges - How to protect server side generated values against client side changes using a HMAC == Hibernate related == + * Tapestry5HowToUseTapestryHibernate - Example/Tutorial of how to use Tapestry-Hibernate in your code. + * [Tapestry5HowToIocAndHibernate] - Example of using tapestry-oc+tapestry-hibernate standalone (without web part). + * [[Tapstry5First_project_with_Tapestry5,_Spring_and_Hibernate]] - A translation of a french article about integrating Spring, Hibernate and Tapestry + * Tapestry5ManipulateClassesAtRuntime show you how easy is to add class methodes at runtime. + * Tapestry5HibernateGridDatasource simple hibernated grid datasource using HQL (Hibernate Query Language). + * Tapestry5HibernateGridDatasource2 simple hibernated grid datasource using hibernate criteria API. + * Tapestry5HibernateGridDatasource3 very flexible abstract GridDataSource for using any org.hibernate.Query object, so you can use HQL, SQL, Criteria, DaO, etc. + * Tapestry5BrainlessEntityTimestamping How to have entities automatically time stamped using tapestry-hibernate, simply by adding certain fields! - * [[Tapestry5HowToUseTapestryHibernate]] - Example/Tutorial of how to use Tapestry-Hibernate in your code. - * [Tapestry5HowToIocAndHibernate] - Example of using tapestry-oc+tapestry-hibernate standalone (without web part). - * [[Tapstry5First_project_with_Tapestry5,_Spring_and_Hibernate]] - A translation of a french article about integrating Spring, Hibernate and Tapestry - * [[Tapestry5ManipulateClassesAtRuntime]] show you how easy is to add class methodes at runtime. - * [[Tapestry5HibernateGridDatasource]] simple hibernated grid datasource using HQL (Hibernate Query Language). - * [[Tapestry5HibernateGridDatasource2]] simple hibernated grid datasource using hibernate criteria API. - * [[Tapestry5HibernateGridDatasource3]] very flexible abstract GridDataSource for using any org.hibernate.Query object, so you can use HQL, SQL, Criteria, DaO, etc. - * [[Tapestry5BrainlessEntityTimestamping]] How to have entities automatically time stamped using tapestry-hibernate, simply by adding certain fields! - - * [[Tapestry5AvoidingLazyInitializationExceptions]] How to avoid "Lazy Initialization" exceptions + * Tapestry5AvoidingLazyInitializationExceptions How to avoid "Lazy Initialization" exceptions * [[Tapestry5AvoidingDifferentObjectWithSameIDExceptions]] How to avoid "Different Object with same ID" exceptions - - == Components == - * [[Tapestry5CheckOutTheSourceCode]] - Examples and Demos of many components in the source code, like the Palette, Grid, !BeanEditForm, etc. + * Tapestry5CheckOutTheSourceCode - Examples and Demos of many components in the source code, like the Palette, Grid, !BeanEditForm, etc. - * [[Tapestry5HowToCreateYourOwnComponents]] - Creating your own components is really simple, and fun to do as well. (This example implements a www.dhtmlgoodies.com drag-and-drop-folder tree component) + * Tapestry5HowToCreateYourOwnComponents - Creating your own components is really simple, and fun to do as well. (This example implements a www.dhtmlgoodies.com drag-and-drop-folder tree component) - * [[Tapestry5HowToCreateYourOwnComponentLibrary]] - Steps to create a reusable library (JAR) of T5 components. + * Tapestry5HowToCreateYourOwnComponentLibrary - Steps to create a reusable library (JAR) of T5 components. - * [[Tapestry5OutputLocaleNumber]] - Creating a new component for formatting (numbers) according to locale, using literals (integer, decimal or currency). It's based on Output component. + * Tapestry5OutputLocaleNumber - Creating a new component for formatting (numbers) according to locale, using literals (integer, decimal or currency). It's based on Output component. * [[Tapestry5HowToCreateATabPanel]] - Explains how to create a tab panel. - * [[Tapestry5SubmitContextComponent]] - A Submit component that passes a context + * Tapestry5SubmitContextComponent - A Submit component that passes a context - * [[Tapestry5SubmitContextWithNavigationComponent]] - A Submit component that passes a context and allows event handler to return navigational object. + * Tapestry5SubmitContextWithNavigationComponent - A Submit component that passes a context and allows event handler to return navigational object. - * [[Tapestry5AnyComponent]] - A deprecated but still useful component that does ... nothing (by default) + * Tapestry5AnyComponent - A deprecated but still useful component that does ... nothing (by default) - * [[Tapestry5ImageComponent]] - Another deprecated component that's useful for making "previewable" templates + * Tapestry5ImageComponent - Another deprecated component that's useful for making "previewable" templates * [[http://lombok.demon.co.uk/tapestry5Demo/|Tapestry 5 components]] By Shing Hing Man * Several projects with [[http://code.google.com/hosting/search?q=label:tapestry5|Tapestry 5 components at Google Code]], share your components here. - * [[Tapestry5TreeComponent]] - A tree component based on DHTMLgoodies.com's drag 'n drop folder tree + * Tapestry5TreeComponent - A tree component based on DHTMLgoodies.com's drag 'n drop folder tree - * [[Tapestry5EnhancedPalette]] - Based heavily on the existing core palette and uses Matt Kruse's Option Transfer javascript (Works in IE!) + * Tapestry5EnhancedPalette - Based heavily on the existing core palette and uses Matt Kruse's Option Transfer javascript (Works in IE!) - * [[Tapestry5Layoutcomponent]] A sophisticated Layout component + * Tapestry5Layoutcomponent A sophisticated Layout component - * [[Tapestry5PaletteEvents]] How to invoke a Javascript function when the selected items are added/removed/reordered in a Palette + * Tapestry5PaletteEvents How to invoke a Javascript function when the selected items are added/removed/reordered in a Palette - * [[Tapestry5GridComponent]] Some tricks using the Grid component + * Tapestry5GridComponent Some tricks using the Grid component - * [[Tapestry5AndJavaScriptExplained]] - A detailed look at how Tapestry 5 integrates javascript into your application. In this article we create a mixin for adding a javascript confirmation box to link components, explaining each step. Full source included. + * Tapestry5AndJavaScriptExplained - A detailed look at how Tapestry 5 integrates javascript into your application. In this article we create a mixin for adding a javascript confirmation box to link components, explaining each step. Full source included. - * [[Tapestry5SimpleAndPowerfulLayouts]] - Creates flexible layouts, using a simple reusable component. + * Tapestry5SimpleAndPowerfulLayouts - Creates flexible layouts, using a simple reusable component. - * [[Tapestry5LayoutWithMenu]] - Layout with added menu bar + * Tapestry5LayoutWithMenu - Layout with added menu bar + * Tapestry5EnumAsComponentParameter - Defining a new enum as a component parameter, and adding the string -> enum type coercion for it + == Bug workarounds / patches == - - * [[Tapestry5Utf8Encoding]] - How to use UTF-8 encoding to support foreign characters + * Tapestry5Utf8Encoding - How to use UTF-8 encoding to support foreign characters - * [[Tapestry5RootPathEmptyResponse]] - A runtime patch for the root path empty response bug + * Tapestry5RootPathEmptyResponse - A runtime patch for the root path empty response bug * [[https://issues.apache.org/jira/browse/TAPESTRY-1745|Tapestry5.0.5 Palette Component IE Bug Patch]] * [[HowToRunTapestry5OnJBoss5]] - How to run Tapestry 5 on JBoss 5 == Meta info == - - * [[Tapestry5HowToCreateYourQuickstartWithMaven206]] - If you've had some trouble getting maven2.0.6 to compile the quickstart, here's how to do it. + * Tapestry5HowToCreateYourQuickstartWithMaven206 - If you've had some trouble getting maven2.0.6 to compile the quickstart, here's how to do it. - * [[Tapestry5WhereToStoreExternalResources]] - Where to store resources like CSS, JS and Images in your application + * Tapestry5WhereToStoreExternalResources - Where to store resources like CSS, JS and Images in your application - * [[Tapestry5WhereToStoreConfigurationResources]] - Where to store resources like Hibernate configuration files, logging properties, and web application context information in your application + * Tapestry5WhereToStoreConfigurationResources - Where to store resources like Hibernate configuration files, logging properties, and web application context information in your application - * [[Tapestry5HowToSearchTheMailingLists]] - Force Google to only search the mailing list (results found in these lists are often hidden due to the limited #links) + * Tapestry5HowToSearchTheMailingLists - Force Google to only search the mailing list (results found in these lists are often hidden due to the limited #links) - * [[Tapestry5HowToOverrideTheDefaultErrorMessageBanner]] - How to override the default error message banner + * Tapestry5HowToOverrideTheDefaultErrorMessageBanner - How to override the default error message banner - * [[Tapestry5Trolls]] - How to deal with trolls on the list, and one in particular + * Tapestry5Trolls - How to deal with trolls on the list, and one in particular == Coding traps == - * [[Tapestry5HowToNotMakeCustomComponent]] - If you are making a custom component, there are few things you shouldn't do... + * Tapestry5HowToNotMakeCustomComponent - If you are making a custom component, there are few things you shouldn't do... - * [[Tapestry5ComponentClassResolverError]] - When organizing your component (or page) directories, pay special attention! + * Tapestry5ComponentClassResolverError - When organizing your component (or page) directories, pay special attention! - * [[Tapestry5Caveats]] - or more literally, "let him beware". + * Tapestry5Caveats - or more literally, "let him beware". == IRC == Chris Lewis mentioned Tapestry's IRC: #tapestry AT irc.freenode.net: "There's usually 5 ~ 8 of us in there, and we work/talk about Tapestry." --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
