Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

So ... why is the class named "CreateAddress" and not simply "Create"? Actually, we could have named it "Create", and the application would still work, but the longer class name is equally valid. Tapestry noticed the redundancy in the class name: }} org.apache.tapestry5.tutorial.pages.address.Create{{Address and just stripped it out.

Eventually, your application will probably have more entities: perhaps you'll have a "user/Create" page and a "payment/Create" page and an "account/Create" page. Now, you could have a bunch of different classes named }} Create {{ spread across a number of different packages. That's legal Java, but it isn't ideal. You may find yourself accidentally editing the Java code for creating an Account when your really want to be editting editing the code for creating a Payment.

Tapestry is encouraging you to use a more descriptive name: }} Create{{Address not just }} Create{{, but it isn't making you pay the cost (in terms of longer, uglier URLs). The URL to access the page will still be http://localhost:8080/tutorial1/address/create.

...

When you refresh the page, you'll see the following:

Initial version of the create address form

...

Refresh the page and submit again:

Regexp validation with corrected message

...