Dear Wiki user, You have subscribed to a wiki page or wiki category on "Tapestry Wiki" for change notification.
The following page has been changed by michaelcourcy: http://wiki.apache.org/tapestry/Tapestry5How_to_make_a_basic_crud ------------------------------------------------------------------------------ === Basic CRUD with Tapestry 5 === - === Introduction === + === Introduction === This tutorials aims to present you how easy and elegant could be the conception of a Crud cycle in tapestry 5. @@ -35, +35 @@ we are ready to work. - === Create the model === + === Create the model === Create in the package org.apache.tapestry.tutorial.basiccrud.model our model class, as you can see I made it simple : @@ -89, +89 @@ * The id is going to identify a bean * The name is just a property for the only purpose of this tutorial - === Create the Service === + === Create the Service === - In this tutorial as explained at the beginning we just target the crud process, thus we're going to make a very simple BeanManager that hold a list of MyBean in memory, this service is going to be injected (more on this later) as a Singleon. Thus, as long a your application is deployed the list is still in memory, but every time you restart the server the list is reinitialized. There's no persistence between server reboot. + In this tutorial as explained at the beginning we just target the CRUD process, thus we're going to make a very simple BeanManager that hold a list of MyBean in memory, this service is going to be injected (more on this later) as a Singleton. Thus, as long a your application is deployed the list is still in memory, but every time you restart the server the list is reinitialized. There's no persistence between server reboot. To make a service we need an interface and an implementation. If you wonder why we could not only work with an implementation, you should read [http://tapestry.formos.com/nightly/tapestry5/tapestry-ioc/overview.html this]. @@ -206, +206 @@ === Inject the service === Injecting a service in Tapestry is really easy, just add a bind method to your AppModule.java + in org.apache.tapestry.tutorial.basiccrud.services.AppModule.java add this method {{{ @@ -222, +223 @@ === Display a list of beans in the Start page === - Change the Start.java to display a list of beans, and handles some Crud action + Change Start.java to display a list of beans and handle some CRUD actions {{{ package org.apache.tapestry.tutorial.basiccrud.pages; @@ -346, +347 @@ }}} - === Edit or create a bean === + === Edit or create a bean === To create or edit a bean we'll use Save.java : {{{ @@ -429, +430 @@ And just navigate to http://localhost:8080 you'll find your way ;-). - === Conclusion === + === Conclusion === As you can see building a CRUD cycle in Tapestry 5 is really easy. Instead of the other framework we didn't use a code generator or other magic un/ex-plicit rules, things are clear from the start and you know exactly what you do. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
