You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by bu...@apache.org on 2014/12/15 00:19:42 UTC

svn commit: r932754 - in /websites/production/tapestry/content: cache/main.pageCache creating-the-skeleton-application.html tapestry-tutorial.html

Author: buildbot
Date: Sun Dec 14 23:19:42 2014
New Revision: 932754

Log:
Production update by buildbot for tapestry

Modified:
    websites/production/tapestry/content/cache/main.pageCache
    websites/production/tapestry/content/creating-the-skeleton-application.html
    websites/production/tapestry/content/tapestry-tutorial.html

Modified: websites/production/tapestry/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/tapestry/content/creating-the-skeleton-application.html
==============================================================================
--- websites/production/tapestry/content/creating-the-skeleton-application.html (original)
+++ websites/production/tapestry/content/creating-the-skeleton-application.html Sun Dec 14 23:19:42 2014
@@ -97,16 +97,16 @@ table.ScrollbarTable td.ScrollbarNextIco
 </div></div><p>Of course, adjust the <code>localRepository</code> element to match the correct path for your computer.</p>
                     </div>
     </div>
-<p>Okay, let's get started creating our new project.</p><p>In Eclipse, go to <strong>File &gt; New &gt;</strong> <strong>Project... &gt; Maven &gt; Maven Project</strong></p><p><img class="confluence-embedded-image" src="creating-the-skeleton-application.data/select-a-wizard.png" data-image-src="/confluence/download/attachments/23340356/select-a-wizard.png?version=1&amp;modificationDate=1416675284000&amp;api=v2"></p><p>Then click <strong>Next</strong>, <strong>Next</strong> (again), and then on the <strong>Select an Archetype</strong> page click the <strong>Configure</strong> button on the Catalog line. The <strong>Archetype</strong> preferences dialog should appear. Click the <strong>Add Remote Catalog...</strong> button:</p><p><img class="confluence-embedded-image" src="creating-the-skeleton-application.data/add-archetype-catalog.png" data-image-src="/confluence/download/attachments/23340356/add-archetype-catalog.png?version=1&amp;modificationDate=1416675354000&amp;api=v2"></p><p>
 As shown above, enter <span class="nolink"><span class="nolink">"http://tapestry.apache.org"</span></span> in the Catalog File field, and "Apache Tapestry" in the Description field.</p>    <div class="aui-message hint shadowed information-macro">
+<p>Okay, let's get started creating our new project.</p><p>In Eclipse, go to <strong>File &gt; New &gt;</strong> <strong>Project... &gt; Maven &gt; Maven Project</strong></p><p><img class="confluence-embedded-image" src="creating-the-skeleton-application.data/select-a-wizard.png" data-image-src="/confluence/download/attachments/23340356/select-a-wizard.png?version=1&amp;modificationDate=1416675284000&amp;api=v2"></p><p>Then click <strong>Next</strong>, <strong>Next</strong> (again), and then on the <strong>Select an Archetype</strong> page click the <strong>Configure</strong> button on the Catalog line. The <strong>Archetype</strong> preferences dialog should appear. Click the <strong>Add Remote Catalog...</strong> button, as shown below:</p><p><img class="confluence-embedded-image" src="creating-the-skeleton-application.data/add-archetype-catalog.png" data-image-src="/confluence/download/attachments/23340356/add-archetype-catalog.png?version=1&amp;modificationDate=1416675354000&amp
 ;api=v2"></p><p>As shown above, enter <span class="nolink"><span class="nolink">"http://tapestry.apache.org"</span></span> in the Catalog File field, and "Apache Tapestry" in the Description field.</p>    <div class="aui-message hint shadowed information-macro">
                             <span class="aui-icon icon-hint">Icon</span>
                 <div class="message-content">
-                            <p>If you want to try an unreleased (alpha or beta) version of Tapestry, use <span class="nolink">https://repository.apache.org/content/repositories/staging</span> archetype catalog file instead.</p>
+                            <p>If you want to try an unreleased (alpha or beta) version of Tapestry, use <span class="nolink">the https://repository.apache.org/content/repositories/staging</span> archetype catalog file instead.</p>
                     </div>
     </div>
-<p>Click <strong>OK</strong>, then<strong> OK</strong> again.</p><p>On the Select an Archetype dialog, select the newly-added Apache Tapestry catalog, then select the "quickstart" artifact from the list and click <strong>Next</strong>.</p><p><img class="confluence-embedded-image" src="creating-the-skeleton-application.data/select-archetype.png" data-image-src="/confluence/download/attachments/23340356/select-archetype.png?version=1&amp;modificationDate=1416675447000&amp;api=v2"></p><p>Fill in the Group Id, Artifact Id, Version and Package&#160; as follows:</p><p><img class="confluence-embedded-image" src="creating-the-skeleton-application.data/specify-archetype-parameters.png" data-image-src="/confluence/download/attachments/23340356/specify-archetype-parameters.png?version=1&amp;modificationDate=1416675494000&amp;api=v2"></p><p>then click Finish.</p>    <div class="aui-message hint shadowed information-macro">
+<p>Click <strong>OK</strong>, then<strong> OK</strong> again.</p><p>On the Select an Archetype dialog (shown below), select the newly-added Apache Tapestry catalog, then select the "quickstart" artifact from the list and click <strong>Next</strong>.</p><p><img class="confluence-embedded-image" src="creating-the-skeleton-application.data/select-archetype.png" data-image-src="/confluence/download/attachments/23340356/select-archetype.png?version=1&amp;modificationDate=1416675447000&amp;api=v2"></p><p>Fill in the Group Id, Artifact Id, Version and Package&#160; as follows:</p><p><img class="confluence-embedded-image" src="creating-the-skeleton-application.data/specify-archetype-parameters.png" data-image-src="/confluence/download/attachments/23340356/specify-archetype-parameters.png?version=1&amp;modificationDate=1416675494000&amp;api=v2"></p><p>then click Finish.</p>    <div class="aui-message hint shadowed information-macro">
                             <span class="aui-icon icon-hint">Icon</span>
                 <div class="message-content">
-                            <p>The first time you use Maven, project creation may take several minutes as Maven downloads hundreds of JAR dependencies. These downloaded files are cached locally and will not need to be downloaded again, but you do have to be patient on first use.</p>
+                            <p>The first time you use Maven, project creation may take a while as Maven downloads a large number of JAR dependencies for Maven, Jetty and Tapestry. These downloaded files are cached locally and will not need to be downloaded again, but you do have to be patient on first use.</p>
                     </div>
     </div>
 <p>After Maven finishes, you'll see a new directory, <code>tutorial in your Package Explorer view in Eclipse.</code></p><h2 id="CreatingTheSkeletonApplication-RunningtheApplicationusingJetty">Running the Application using Jetty</h2><p>One of the first things you can do is use Maven to run Jetty directly.</p><p>Right-click on the tutorial project in your Package Explorer view and select <strong>Run As &gt; Maven Build... &gt;</strong>, enter a Goal of <strong>"jetty:run"</strong>. This creates a "Run Configuration" named "tutorial1" that we'll use throughout this tutorial to start the app:</p><p><img class="confluence-embedded-image" src="creating-the-skeleton-application.data/run-configuration.png" data-image-src="/confluence/download/attachments/23340356/run-configuration.png?version=2&amp;modificationDate=1416744425000&amp;api=v2"></p><p>Tapestry runs best with a couple of additional options; click the "JRE" tab and enter the following VM Arguments:</p><pre></pre><p>-XX:MaxPermSiz
 e=256M</p><p>-Xmx600m</p><p>-Dtapestry.execution-mode=development</p><p><code><em>(If you're using JDK 1.8 then you should omit the MaxPermSize argument.)</em></code></p><p><code>Here's how it looks:<br clear="none"></code></p><p><img class="confluence-embedded-image" src="creating-the-skeleton-application.data/run-configuration-jre.png" data-image-src="/confluence/download/attachments/23340356/run-configuration-jre.png?version=2&amp;modificationDate=1416744425000&amp;api=v2"></p><p>Finally, click <strong>Run</strong>.</p><p>Again, the first time, there's a dizzying number of downloads, but before you know it, the Jetty servlet container is up and running.</p><p>Once Jetty is initialized (which only takes a few seconds after the first time), you'll see the following in your console:</p><p><img class="confluence-embedded-image" src="creating-the-skeleton-application.data/console-startup.png" data-image-src="/confluence/download/attachments/23340356/console-startup.png?version=2&amp;m
 odificationDate=1416797756000&amp;api=v2"></p><p><em>Note the red square icon above. Later on you'll use that icon to stop Jetty before restarting the app.</em></p><p>You can now open a web browser to <a shape="rect" class="external-link" href="http://localhost:8080/tutorial1/" >http://localhost:8080/tutorial1/</a> to see the running application:</p><p>&#160;</p><p><img class="confluence-embedded-image confluence-content-image-border image-left" src="creating-the-skeleton-application.data/startpage.png" data-image-src="/confluence/download/attachments/23340356/startpage.png?version=7&amp;modificationDate=1416798158000&amp;api=v2"></p><p>&#160;</p><div style="clear: both"></div><p style="text-align: left;">The date and time in the middle of the page shows that this is a live application.</p><p>This is a complete little web app; it doesn't do much, but it demonstrate how to create a number of pages sharing a common layout, and demonstrates some simple navigation and link handling. You
  can see that it has several different pages that share a common layout. (<span style="line-height: 1.4285715;"><em>Layout</em> is a loose term meaning common look and feel and navigation across many or all of the pages of an application. Often an application will include a Layout component to provide that commonness.)</span></p><p>&#160;</p><style type="text/css">/*<![CDATA[*/

Modified: websites/production/tapestry/content/tapestry-tutorial.html
==============================================================================
--- websites/production/tapestry/content/tapestry-tutorial.html (original)
+++ websites/production/tapestry/content/tapestry-tutorial.html Sun Dec 14 23:19:42 2014
@@ -114,7 +114,7 @@
                 
                             </div>
         </li></ul>
-</div><h1 id="TapestryTutorial-TableofContents">Table of Contents</h1><p></p><ul class="childpages-macro"><li><a shape="rect" href="dependencies-tools-and-plugins.html">Dependencies, Tools and Plugins</a></li><li><a shape="rect" href="creating-the-skeleton-application.html">Creating The Skeleton Application</a></li><li><a shape="rect" href="exploring-the-project.html">Exploring the Project</a></li><li><a shape="rect" href="implementing-the-hi-lo-guessing-game.html">Implementing the Hi-Lo Guessing Game</a></li><li><a shape="rect" href="using-beaneditform-to-create-user-forms.html">Using BeanEditForm To Create User Forms</a></li><li><a shape="rect" href="using-tapestry-with-hibernate.html">Using Tapestry With Hibernate</a></li></ul><h1 id="TapestryTutorial-Introduction">Introduction</h1><p>Welcome to Tapestry!</p><p>This is a tutorial for people who will be creating Tapestry 5 applications. It doesn't matter whether you have experience with Tapestry 4 (or Tapestry 3, for that matter) 
 or whether you are completely new to Tapestry. In fact, in some ways, the less you know about web development in general, and older Tapestry versions in particular, the better off you may be ... that much less to unlearn!</p><p>You do need to have a reasonable understanding of HTML, a smattering of XML, and a good understanding of basic Java language features, including Annotations.</p><h1 id="TapestryTutorial-TheChallengesofWebApplicationDevelopment">The Challenges of Web Application Development</h1><p>If you're used to developing web applications using servlets and JSPs, or with Struts, you are simply used to a lot of pain. So much pain, you may not even understand the dire situation you are in! These are environments with no safety net; Struts and the Servlet API have no idea how your application is structured, or how the different pieces fit together. Any URL can be an action and any action can forward to any view (usually a JSP) to provide an HTML response to the web browser. T
 he pain is the unending series of small, yet important, decisions you have to make as a developer (and communicate to the rest of your team). What are the naming conventions for actions, for pages, for attributes stored in the HttpSession or HttpServletRequest? Where do cross-cutting concerns such as database transactions, caching and security get implemented (and do you have to cut-and-paste Java or XML to make it work?) How are your packages organized ... where to the user interface classes go, and where do the data and entity objects go? How do you share code from one part of your application to another?</p><p>On top of all that, the traditional approaches thrust something most unwanted in your face: <em>multi-threaded coding</em>. Remember back to Object Oriented Programming 101 where an object was defined as a bundle of data and operations on that data? You have to unlearn that lesson as soon as you build a traditional web application, because web applications are multi-threade
 d. An application server could be handling dozens or hundreds of requests from individual users, each in their own thread, and each sharing the exact same objects. Suddenly, you can't store data inside an object (a servlet or a Struts Action) because whatever data you store for one user will be instantly overwritten by some other user.</p><p>Worse, your objects each have only one operation: <code>doGet()</code> or <code>doPost()</code>.</p><p>Meanwhile, most of your day-to-day work involves deciding how to package up some data already inside a particular Java object and squeeze that data into a URL's query parameters, so that you can write more code to convert it back if the user clicks that particular link. And don't forget editing a bunch of XML files to keep the servlet container, or the Struts framework, aware of these decisions.</p><p>Just for laughs, remember that you have to rebuild, redeploy and restart your application after virtually any change. Is any of this familiar? Th
 en perhaps you'd appreciate something a little <em>less</em> familiar: Tapestry.</p><h1 id="TapestryTutorial-TheTapestryWay">The Tapestry Way</h1><p>Tapestry uses a very different model: a structured, organized world of pages, and components within pages. Everything has a very specific name (that you provide). Once you know the name of a page, you know the location of the Java class for that page, the location of the template for that page, and the total structure of the page. Tapestry knows all this as well, and can make things <strong>just work</strong>.</p><p>As we'll see in the following pages, Tapestry lets you code in terms of your objects. You'll barely see any Tapestry classes, outside of a few Java annotations. If you have information to store, store it as fields of your classes, not inside the HttpServletRequest or HttpSession. If you need some code to execute, it's just a simple annotation or method naming convention to get Tapestry to invoke that method, at the right tim
 e, with the right data. The methods don't even have to be public!</p><p>Tapestry also shields you from most of the multi-threaded aspects of web application development. Tapestry manages the life cycle of your page and components objects, and the fields of the pages and components, in a thread-safe way. Your page and component classes always look like simple, standard <a shape="rect" class="external-link" href="http://en.wikipedia.org/wiki/Plain_Old_Java_Object" >POJOs</a>.</p><p>Tapestry began in January 2000, and it now reflects over ten years of experience of the entire Tapestry community. Tapestry brings to the table all that experience about the best ways to build scalable, maintainable, robust, internationalized (and more recently) Ajax-enabled applications. Tapestry 5 represents a completely new code base (compared to Tapestry 4) designed to simplify the Tapestry coding model while at the same time extending the power of Tapestry and improving performance.</p><h1 id="Tapestry
 Tutorial-GettingTheTutorialSource">Getting The Tutorial Source</h1><p>The source code for the Tapestry tutorial is available on <a shape="rect" class="external-link" href="https://github.com/hlship/tapestry5-tutorial" >GitHub</a> (although you won't need it to complete the tutorial).</p><h1 id="TapestryTutorial-TimetoBegin">Time to Begin</h1><p>Okay, enough background. Now let's get started on the tutorial: <a shape="rect" href="dependencies-tools-and-plugins.html">Dependencies, Tools and Plugins</a></p><p>&#160;</p></div>
+</div><h1 id="TapestryTutorial-TableofContents">Table of Contents</h1><p></p><ul class="childpages-macro"><li><a shape="rect" href="dependencies-tools-and-plugins.html">Dependencies, Tools and Plugins</a></li><li><a shape="rect" href="creating-the-skeleton-application.html">Creating The Skeleton Application</a></li><li><a shape="rect" href="exploring-the-project.html">Exploring the Project</a></li><li><a shape="rect" href="implementing-the-hi-lo-guessing-game.html">Implementing the Hi-Lo Guessing Game</a></li><li><a shape="rect" href="using-beaneditform-to-create-user-forms.html">Using BeanEditForm To Create User Forms</a></li><li><a shape="rect" href="using-tapestry-with-hibernate.html">Using Tapestry With Hibernate</a></li></ul><h1 id="TapestryTutorial-Introduction">Introduction</h1><p>Welcome to Tapestry!</p><p>This is a tutorial for people who will be creating Tapestry 5 applications. It doesn't matter whether you have experience with Tapestry 4 (or Tapestry 3, for that matter) 
 or whether you are completely new to Tapestry. In fact, in some ways, the less you know about web development in general, and older Tapestry versions in particular, the better off you may be ... that much less to unlearn!</p><p>You do need to have a reasonable understanding of HTML, a smattering of XML, and a good understanding of basic Java language features, including Annotations.</p><h1 id="TapestryTutorial-TheChallengesofWebApplicationDevelopment">The Challenges of Web Application Development</h1><p>If you're used to developing web applications using servlets and JSPs, or with Struts, you are simply used to a lot of pain. So much pain, you may not even understand the dire situation you are in! These are environments with no safety net; Struts and the Servlet API have no idea how your application is structured, or how the different pieces fit together. Any URL can be an action and any action can forward to any view (usually a JSP) to provide an HTML response to the web browser. T
 he pain is the unending series of small, yet important, decisions you have to make as a developer (and communicate to the rest of your team). What are the naming conventions for actions, for pages, for attributes stored in the HttpSession or HttpServletRequest? Where do cross-cutting concerns such as database transactions, caching and security get implemented (and do you have to cut-and-paste Java or XML to make it work?) How are your packages organized ... where to the user interface classes go, and where do the data and entity objects go? How do you share code from one part of your application to another?</p><p>On top of all that, the traditional approaches thrust something most unwanted in your face: <em>multi-threaded coding</em>. Remember back to Object Oriented Programming 101 where an object was defined as a bundle of data and operations on that data? You have to unlearn that lesson as soon as you build a traditional web application, because web applications are multi-threade
 d. An application server could be handling dozens or hundreds of requests from individual users, each in their own thread, and each sharing the exact same objects. Suddenly, you can't store data inside an object (a servlet or a Struts Action) because whatever data you store for one user will be instantly overwritten by some other user.</p><p>Worse, your objects each have only one operation: <code>doGet()</code> or <code>doPost()</code>.</p><p>Meanwhile, most of your day-to-day work involves deciding how to package up some data already inside a particular Java object and squeeze that data into a URL's query parameters, so that you can write more code to convert it back if the user clicks that particular link. And don't forget editing a bunch of XML files to keep the servlet container, or the Struts framework, aware of these decisions.</p><p>Just for laughs, remember that you have to rebuild, redeploy and restart your application after virtually any change. Is any of this familiar? Th
 en perhaps you'd appreciate something a little <em>less</em> familiar: Tapestry.</p><h1 id="TapestryTutorial-TheTapestryWay">The Tapestry Way</h1><p>Tapestry uses a very different model: a structured, organized world of pages, and components within pages. Everything has a very specific name (that you provide). Once you know the name of a page, you know the location of the Java class for that page, the location of the template for that page, and the total structure of the page. Tapestry knows all this as well, and can make things <strong>just work</strong>.</p><p>As we'll see in the following pages, Tapestry lets you code in terms of your objects. You'll barely see any Tapestry classes, outside of a few Java annotations. If you have information to store, store it as fields of your classes, not inside the HttpServletRequest or HttpSession. If you need some code to execute, it's just a simple annotation or method naming convention to get Tapestry to invoke that method, at the right tim
 e, with the right data. The methods don't even have to be public!</p><p>Tapestry also shields you from most of the multi-threaded aspects of web application development. Tapestry manages the life cycle of your page and components objects, and the fields of the pages and components, in a thread-safe way. Your page and component classes always look like simple, standard <a shape="rect" class="external-link" href="http://en.wikipedia.org/wiki/Plain_Old_Java_Object" >POJOs</a>.</p><p>Tapestry began in January 2000, and it now reflects over fourteen years of experience of the entire Tapestry community. Tapestry brings to the table all that experience about the best ways to build scalable, maintainable, robust, internationalized, and Ajax-enabled applications. Tapestry 5 represents a completely new code base (compared to Tapestry 4) designed to simplify the Tapestry coding model while at the same time extending the power of Tapestry and improving performance.</p><h1 id="TapestryTutorial-G
 ettingTheTutorialSource">Getting The Tutorial Source</h1><p>The source code for the Tapestry tutorial is available on <a shape="rect" class="external-link" href="https://github.com/hlship/tapestry5-tutorial" >GitHub</a> (although you won't need it to complete the tutorial).</p><h1 id="TapestryTutorial-TimetoBegin">Time to Begin</h1><p>Okay, enough background. Now let's get started on the tutorial: <a shape="rect" href="dependencies-tools-and-plugins.html">Dependencies, Tools and Plugins</a></p><p>&#160;</p></div>
 </div>
 
 <div class="clearer"></div>