[CONF] Apache Tapestry > Class Reloading
Class Reloading Page edited by Bob Harner Comment: Simplifed lead paragraphs, fixed broken links Changes (5) h1. Live Class and Template Reloading One of the great new features of Tapestry 5 is automatic reloading of changed classes and templates. _Page and component_ classes will automatically reload when changed. Likewise, changes to component templates and other related resources will also be picked up immediately. In addition, starting in version 5.2, your service classes will also be reloaded automatically after changes (if you're using [Tapestry IoC|IoC]). In previous versions of Tapestry, reloading of templates was supported in development mode only. Reloading of classes required a restart of the servlet container (or a redeploy of the web application). In Tapestry 5, _page and component_ classes will automatically reload when changed. Likewise, changes to component templates and other related resources will also be picked up immediately. h2. Template Reloading When a template changes, all page instances (as well as the hierarchy of components below them) are discarded and reconstructed with the new template. However, classes are not reloaded in this case. h2. Class Reloading ... On a change to _any_ loaded class from inside a controlled package (or any sub-package of a controlled package), Tapestry will discard all page instances, and discard the class loader. [Persistent field data|#persist.html] data|Persistent Page Data] on the pages will usually not be affected (as it is stored separately, in the session). This allows you to make fairly significant changes to a component class even while the application continues to run. h1. Page and Component Packages ... Only page and component classes are subject to reload. Reloading is based on package name; the packages that are reloaded are derived from the [application configuration|#conf.html]. configuration|Configuration]. If your root package is _code_org.example.myapp_/code_, then only classes in the following packages will be scanned for automatic reloads: ... Full Content Live Class and Template Reloading One of the great features of Tapestry 5 is automatic reloading of changed classes and templates. Page and component classes will automatically reload when changed. Likewise, changes to component templates and other related resources will also be picked up immediately. In addition, starting in version 5.2, your service classes will also be reloaded automatically after changes (if you're using Tapestry IoC). Template Reloading When a template changes, all page instances (as well as the hierarchy of components below them) are discarded and reconstructed with the new template. However, classes are not reloaded in this case. Class Reloading On a change to any loaded class from inside a controlled package (or any sub-package of a controlled package), Tapestry will discard all page instances, and discard the class loader. Persistent field data on the pages will usually not be affected (as it is stored separately, in the session). This allows you to make fairly significant changes to a component class even while the application continues to run. Page and Component Packages Only page and component classes are subject to reload. Reloading is based on package name; the packages that are reloaded are derived from the application configuration. If your root package is code_org.example.myapp/code_, then only classes in the following packages will be scanned for automatic reloads: org.example.myapp.pages org.example.myapp.components org.example.myapp.mixins org.example.myapp.base File System Only Reloading of classes and other files applies only to files that are actually on the file system, and not files obtained from JAR files. This is perfect during development, where the files in question are in your local workspace. In a deployed application, you are somewhat subject to the implementation of your servlet container or application server. Class Loader Issues Tapestry uses an extra class loader to load page and component classes. When a change to an underlying Java class file is detected, Tapestry discards the class loader and any pooled page instances. You should be careful to not hold any references to Tapestry pages or components in other code, such as Tapestry IoC services. Holding such references can cause significant memory leaks, as they can prevent the class loader from being reclaimed by the garbage collector. ClassCastExceptions Tapestry's class loader architecture can cause minor headaches when you ma
[CONF] Apache Tapestry > IndexV2
IndexV2 File attached by Katia Aresti plugin.png (2 kB image/png) Change Notification Preferences View Attachments
[CONF] Apache Tapestry > IndexV2
IndexV2 File attached by Katia Aresti plugin.png (2 kB image/png) - adaptable Change Notification Preferences View Attachments
[CONF] Apache Tapestry > Introduction
Introduction Page edited by Bob Harner Comment: Removed "Principles" section, an almost exact duplicate of the newer/better Principles page. Changes (4) ... h2. Third Party Libraries, Tutorials and Resources A number of Third Party Libraries, Tutorials and Resources are listed on the Tapestry Home Page. A number of third party libraries, tutorials and resources are listed on the Tapestry Home page. h2. Adaptive API A key feature of Tapestry 5 is its adaptive API. In traditional Java frameworks, including Tapestry 4, user code is expected to conform to the framework. You create classes that extend from framework-provided base classes, or implement framework-provided interfaces. This works well until you upgrade to the next release of the framework: with the new features of the upgrade, you will more often than not experience breaks in backwards compatibility. Interfaces or base classes will have changed and your existing code will need to be changed to match. In Tapestry 5, the framework adapts to your code. You have control over the names of the methods, the parameters they take, and the value that is returned. This is driven by annotations, which tell Tapestry under what circumstances your methods are to be invoked. For example, you may have a login form and have a method that gets invoked when the form is submitted: {code:JAVA} public class Login { @Persist @Property private String userId; @Property private String password; @Component private Form form; @Inject private LoginAuthenticator authenticator; void onValidateForm() { if (! authenticator.isValidLogin(userId, password)) { form.recordError("Invalid user name or password."); } } Object onSuccess() { return PostLogin.class; } } {code} This short snippet demonstrates a bit about how Tapestry operates. Pages and services within the application are injected with the @Inject annotation. The method names, onValidateForm() and onSuccess(), inform Tapestry about when the method is to be invoked. The two events validateForm and success occur when a form is submitted; "validateForm" is triggered to perform cross-field validations, and "success" is only triggered when there are no validation errors. The onSuccess() method's return value directs Tapestry on what to do next: jump to another page within the application (here identified as the class for the page, but many other options exist). When there are exceptions, the page will be redisplayed to the user. This also represents a distinct change from Tapestry 4. In earlier versions of Tapestry, the Form component's listener parameter would be bound to the method to invoke, by name. Further, the listener method had to be public. This new approach not only supports multiple listeners, but provides an improved separation of view concerns (inside the page's HTML template) and logic concerns (inside the Java class). In many cases, additional information about the event is available, and it can be passed into the method by adding parameters to the method. Again, Tapestry will adapt to your parameters, in whatever order you supply them. Tapestry also saves you effort: the @Property annotation marks a field as readable and writable; Tapestry will provide the accessor methods automatically. Finally, Tapestry 5 explicitly separates actions (requests that change things) and rendering (requests that render pages) into two separate requests. Performing an action, such as clicking a link or submitting a form, results in a client side redirect to the new page. This approach, called "redirect after post", helps ensure that URLs in the browser are book-markable -- but it also requires that a bit more information be stored in the session between requests (using the @Persist annotation). h2. About Snapshots and Releases ... Documentation on this site usually refers to the latest snapshot ... that is, it is usually ahead of the last official release. In some cases, it is written as if the snapshot release is stable; if documentation refers to version 5.1.x.x and that doesn't work, try 5.1.x.x-SNAPSHOT. h2. Principle 1 -- Static Structure, Dynamic Behavior Main article: [Principles] Tapestry is designed to be extremely scalable in several dimensions: * Tapestry applications may contain large numbers of pages and many custom components. * Tapestry applications may contain very complex functionality. * Tapestry applications may be created by large, diverse teams. * Tapestry applications can service large numbers of concurrent users. One core architecture decision in Tapestry exists to service many of the above goals (and others that a
[CONF] Apache Tapestry > IndexV2
IndexV2 File attached by Katia Aresti bug.png (2 kB image/png) - exceptions Change Notification Preferences View Attachments
[CONF] Apache Tapestry > IndexV2
IndexV2 File attached by Katia Aresti Chat.png (2 kB image/png) - polyglote Change Notification Preferences View Attachments
[CONF] Apache Tapestry > Download
Download Page edited by Howard M. Lewis Ship Changes (14) ... See [Release Notes] for differences between versions. h3. Beta Releases h1. Stable Releases Beta releases represent code that is close to the final stable version. In general, new features (especially disruptive or non-backwards compatible features) are not introduced during the beta release stage. After a series of beta releases (to find and correct any bugs) a release will be voted up to stable status. See [Release Notes] on specific changes in each beta release. Stable releases should be relatively free of critical bugs and are considered the _safest_ option if stability is a requirement. h4. Tapestry 5.2.4 (beta) h2. Tapestry 5.2.4 Tapestry 5.2.4 is the stable release for Tapestry 5.2. Largely a drop-in replacement for 5.1, it adds new features and extends Tapestry's scalability. See the [release notes|Release Notes] for more details about features and upgrade information. | | Mirrors | Checksum | Signature | | tapestry-bin 5.2.4 binary (tar.bz2) | [Download|http://www.apache.org/dyn/closer.cgi/tapestry/tapestry-bin-5.2.4.tar.bz2] | [MD5|http://www.apache.org/dist/tapestry/tapestry-bin-5.2.4.tar.bz2.md5] | [ASC|http://www.apache.org/dist/tapestry/tapestry-bin-5.2.4.tar.bz2.asc] | ... h3. Stable Releases Stable releases should be relatively free of critical bugs and are considered the _safest_ option if stability is a requirement. h2. Tapestry 5.1.0.5 h4. Tapestry 5.1.0.5 (Stable) Tapestry 5.1.0.5 is the stable release for [Tapestry 5.1|http://tapestry.apache.org/tapestry5.1/]. Released Apr 23, 2009, Tapestry 5.1 addresses some limitations in 5.0 and improves performance and scalability. ... | tapestry-src 5.1.0.5 binary (zip) | [Download|http://www.apache.org/dyn/closer.cgi/tapestry/tapestry-src-5.1.0.5.zip] | [MD5|http://www.apache.org/dist/tapestry/tapestry-src-5.1.0.5.zip.md5] | [ASC|http://www.apache.org/dist/tapestry/tapestry-src-5.1.0.5.zip.asc] | h4. Tapestry 4.1.6 (Stable) h2. Tapestry 4.1.6 Tapestry 4.1.6 is the final version of Tapestry 4. Released Sep 7, 2008, it improved upon early Tapestry 4 releases with bug fixes, AJAX support and performance enhancements. See [Tapestry 4 release notes|http://tapestry.apache.org/tapestry4/changes.html] ... | 4.1.6 source/docs (zip) | [Download|http://www.apache.org/dyn/closer.cgi/tapestry/tapestry-project-4.1.6-full.zip] | [MD5|http://www.apache.org/dist/tapestry/tapestry-project-4.1.6-full.zip.md5] | [ASC|http://www.apache.org/dist/tapestry/tapestry-project-4.1.6-full.zip.asc] | h21. Archives Looking for and older version of Tapestry? Try the [archives|http://archive.apache.org/dist/tapestry/]. ... Full Content Tapestry can be downloaded in either binary or source format. The easiest way to download Tapestry is with Maven, as described at Getting Started. See Release Notes for differences between versions. Stable Releases Stable releases should be relatively free of critical bugs and are considered the safest option if stability is a requirement. Tapestry 5.2.4 Tapestry 5.2.4 is the stable release for Tapestry 5.2. Largely a drop-in replacement for 5.1, it adds new features and extends Tapestry's scalability. See the release notes for more details about features and upgrade information. Mirrors Checksum Signature tapestry-bin 5.2.4 binary (tar.bz2) Download MD5 ASC tapestry-bin 5.2.4 binary (tar.gz) Download MD5 ASC tapestry-bin 5.2.4 binary (zip) Download MD5 ASC tapestry-src 5.2.4 binary (tar.bz2) Download MD5 ASC tapestry-src 5.2.4 binary (tar.gz) Download MD5 ASC tapestry-src 5.2.4 binary (zip) Download MD5 ASC Tapestry 5.1.0.5 Tapestry 5.1.0.5 is the stable release for Tapestry 5.1. Released Apr 23, 2009, Tapestry 5.1 addresses some limitations in 5.0 and improves performance and scalability. Mirrors Checksum Signature tapestry-bin 5.1.0.5 binary (tar.bz2) Download MD5 ASC tapestry-bin 5.1.0.5 binary (tar.gz) Download MD5 ASC tapestry-bin 5.1.0.5 binary (zip) Download MD5 ASC tapestry-src 5.1.0.5 binary (tar.bz2) Download MD5 ASC tapestry-src 5.1.0.5 binary (tar.gz) Download MD5 ASC tapestry-src 5.1.0.5 binary (zip) Download MD5 ASC Tapestry 4.1.6 Tapestry 4.1.6 is the final version of Tapestry 4. Released Sep 7, 2008, i
[CONF] Apache Tapestry > Tapestry 5.2 Released
Tapestry 5.2 Released Blog post added by Howard M. Lewis Ship As expected, Tapestry 5.2.4 has been voted up as the stable version for Tapestry 5.2; we can now recommend that all users upgrade from 5.1.0.5 to 5.2.4. With minor exceptions, noted in the release notes, the upgrade should be as simple as changing version numbers in your POM (or otherwise dropping the latest version of the JARs into your project). There is always a flurry of frantic help requests on the mailing list when people upgrade; more often than not, this is caused by a build process that leaves the old version JARs lying around rather than replacing them with the new version JARs. Please check your WARs carefully, and make sure that your servlet container is cleaning things up properly. Tapestry 5.2.4 has been available to all users for nearly a month; only one important bug, TAP5-1372, was reported in that time (and at the last minute); this will be addressed in a subsequent bug fix release. Tapestry can be downloaded from the Apache Mirrors, or via the central Maven repository: org.apache.tapestry tapestry-core 5.2.4 Change Notification Preferences View Online
[CONF] Apache Tapestry > Documentation
Documentation Page edited by Howard M. Lewis Ship Changes (3) ... h1. Tapestry 5 Reference and API * Current stable release 5.1.0.5 5.2.4 ** [API (Javadoc)|http://tapestry.apache.org/tapestry5.2-dev/apidocs/] ** [Component Reference|http://tapestry.apache.org/tapestry5.2-dev/tapestry-core/ref/] ** [Release Notes|Release Notes 5.2.4] * Previous stable release 5.1.0.5 ** [API (Javadoc)|http://tapestry.apache.org/tapestry5.1/apidocs/] ** [Component Reference|http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/] ... ** [Release Notes|http://tapestry.apache.org/tapestry5/release-notes-5.0.html] * Current beta release 5.2.4 ** [API (Javadoc)|http://tapestry.apache.org/tapestry5.2-dev/apidocs/] ** [Component Reference|http://tapestry.apache.org/tapestry5.2-dev/tapestry-core/ref/] ** [Release Notes|Release Notes 5.2.4] Along with the reference documentation, we provide a set of concise guides to help you in your everyday work with Tapestry. ... Full Content Welcome to Tapestry 5 Documentation root page. Overview Tapestry 5 Reference and API User Guides Published Articles on Tapestry Tapestry Developer and Community Blogs Books on Tapestry Tapestry Presentations Tapestry Wikis Getting help The Developer Corner Overview Introduction An overview of Tapestry's general approach and philosophy Getting Started A quick guide to creating your first Tapestry project, using Maven Tapestry Tutorial Picks up where Getting Started leaves off, explaining in greater detail how Tapestry works Community Getting support, mailing lists, JIRA, outside resources, and access to the source Cookbook A guide to common overrides and extensions to Tapestry FAQ A quick place to check for common problems and solutions Tapestry 5 Reference and API Current stable release 5.2.4 API (Javadoc) Component Reference Release Notes Previous stable release 5.1.0.5 API (Javadoc) Component Reference Release Notes Previous stable release 5.0.18 API (Javadoc) Component Reference Release Notes Along with the reference documentation, we provide a set of concise guides to help you in your everyday work with Tapestry. Component Cheat Sheet is a concise guide to component classes, methods and annotations Refcard A color, six page foldout guide to Tapestry 5.0 (PDF) User Guides We provide a collection of detailed references to the concepts behind Tapestry and beyond. Go to the main user guide's page to get access to the whole documentation stack Play with Tapestry's built-in _javascript_ and Ajax stuff Unit test your application with Tapestry test utilities Integrate Spring into your Tapestry application Use Tapestry Hibernate integration to build your data access layer Published Articles on Tapestry If you have any doubts, Tapestry 5 for Nonbelievers will demonstrate why you should choose Tapestry 5! This eBook published in 2009 contains a good introduction and analysis of Tapestry 5 More articles... Tapestry Developer and Community Blogs Tapestry Central is Howard Lewis Ship's blog. As the creator of Tapestry, he provides a lot of valuable information on Tapestry's latest features and future directions. Igor Drobiazko's blog contains a lot of fresh news on Tapestry development and will guide you through the most exciting parts of Tapestry. Igor is a Tapestry Committer and PMC member. Andreas Andreou's blog (committer & PMC) has lots of news and entries on Tapestry 4 and 5. Spread the source's blog (Christophe Cordenier and Robin Komiwes committers's blog) has lots of news and advanced tutorials on Tapestry 5. More blogs ... Books on Tapestry There are at least 8 published books on Tapestry, including two on Tapestry 5 — and more on the way. Tapestry Presentations JavaServer Faces 2.0 vs. Tapestry 5: A Head-to-Head Comparison by Igor Drobiazko at Jazoon 2010 Tapestry 5: Java power, Scripting Ease by Howard Lewis Ship at Devoxx 2009 More presentations ... Tapestry Wikis Community's Wiki (Moin Moin) contains a lot of user-generated information on different concrete web application use cases. Documentation Source wiki (Confluence) – the wiki used as the content editor for the official Tapestry documentation Getting help Mailing Lists The primary method of discussion is on the Tapestry users mailing list: us...@tapestry.apache.org. You can subscribe by sending e-mail to users-subscr...@tapestry.apache.org. This is the appropriate mailing list to learn more about Tapestry, to request help, and to socialize. The second mailing list is d...@tapestry.apache.org. You
[jira] Commented: (TAP5-1372) BaseURLSource uses getLocalPort() rather than getServerPort()
[ https://issues.apache.org/jira/browse/TAP5-1372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12972148#action_12972148 ] Andy Blower commented on TAP5-1372: --- Have you seen Igor's comment on the release vote thread? "I see another issue here: Request interface is a generic version of HttpServletRequest and PortletRequest. As of 5.2.0 Request has the getLocalPort() method which is not available in PortletRequest. " Just in case that makes a difference to your decision. It's fixed in our product, so it's not urgent for us, I just don't want anyone else hitting the same issue and thinking less of Tapestry. > BaseURLSource uses getLocalPort() rather than getServerPort() > - > > Key: TAP5-1372 > URL: https://issues.apache.org/jira/browse/TAP5-1372 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-core >Affects Versions: 5.2.4 >Reporter: Andy Blower >Priority: Critical > > Line 31 of BaseURLSourceImpl: > int port = request.getLocalPort(); > Which calls same method in the underlying ServletRequest. > getLocalPort javadoc: "Returns the Internet Protocol (IP) port number of the > interface on which the request was received." > getServerPort javadoc: "Returns the port number to which the request was > sent. It is the value of the part after ":" in the Host header, > if any, or the server port where the client connection was accepted on." > I think that the second is the one that should be used and since this port > number is paired with the host returned from getServerName() rather than > getLocalName(), this seems like a bug to me. Admittedly one that only causes > problems in clustered & load balanced environments, but it's just affected > our site so it would be great if it could be fixed for 5.2 final release. A > final release of Tapestry should not have a bug like this in it! > Unless anyone has a convincing argument why it should be this way, of > course... -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Moved: (TAP5-1375) TAPESTRY-2173 have side effect
[ https://issues.apache.org/jira/browse/TAP5-1375?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Howard M. Lewis Ship moved TAPESTRY-2773 to TAP5-1375: -- Component/s: (was: tapestry-core) tapestry-core Key: TAP5-1375 (was: TAPESTRY-2773) Project: Tapestry 5 (was: Tapestry) > TAPESTRY-2173 have side effect > -- > > Key: TAP5-1375 > URL: https://issues.apache.org/jira/browse/TAP5-1375 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-core >Reporter: Mihail Slobodyanuk >Priority: Critical > > Example: > @Entity > public class Ingredient > { > public Ingredient(){} > public Ingredient(String amount, String name) > { > . > } > .. > } > When sombody invoke BeanModel.newInstance for Ingredient entity it call > ObjectLicator.autobuild and they try sustitute services as parametrs for > non-default constructor Ingredient(String amount, String name). This > operation leads to failure, and non sence for entities. > To resolve it i can mark default constructor @Inject annotation, but this way > add dependency for entities library bu tapestry-annotation library. > Other way - improve Registry.autobuild method for trying all constructors, > while instantiation do successfull. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Closed: (TAP5-1375) TAPESTRY-2173 have side effect
[ https://issues.apache.org/jira/browse/TAP5-1375?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Howard M. Lewis Ship closed TAP5-1375. -- Resolution: Invalid If you can't bear to but the annotation on the correct constructor, you can always explicitly instantiate the object using the constructor of your choice; letting Tapestry instantiate it is an optimization designed to minimize code but not a necessity. > TAPESTRY-2173 have side effect > -- > > Key: TAP5-1375 > URL: https://issues.apache.org/jira/browse/TAP5-1375 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-core >Reporter: Mihail Slobodyanuk >Priority: Critical > > Example: > @Entity > public class Ingredient > { > public Ingredient(){} > public Ingredient(String amount, String name) > { > . > } > .. > } > When sombody invoke BeanModel.newInstance for Ingredient entity it call > ObjectLicator.autobuild and they try sustitute services as parametrs for > non-default constructor Ingredient(String amount, String name). This > operation leads to failure, and non sence for entities. > To resolve it i can mark default constructor @Inject annotation, but this way > add dependency for entities library bu tapestry-annotation library. > Other way - improve Registry.autobuild method for trying all constructors, > while instantiation do successfull. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (TAP5-1372) BaseURLSource uses getLocalPort() rather than getServerPort()
[ https://issues.apache.org/jira/browse/TAP5-1372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12972146#action_12972146 ] Howard M. Lewis Ship commented on TAP5-1372: I can see this being important, but not quite important enough to hold off on the stable 5.2 release. It does warrant a 5.2.5 bug fix release IMO. > BaseURLSource uses getLocalPort() rather than getServerPort() > - > > Key: TAP5-1372 > URL: https://issues.apache.org/jira/browse/TAP5-1372 > Project: Tapestry 5 > Issue Type: Bug > Components: tapestry-core >Affects Versions: 5.2.4 >Reporter: Andy Blower >Priority: Critical > > Line 31 of BaseURLSourceImpl: > int port = request.getLocalPort(); > Which calls same method in the underlying ServletRequest. > getLocalPort javadoc: "Returns the Internet Protocol (IP) port number of the > interface on which the request was received." > getServerPort javadoc: "Returns the port number to which the request was > sent. It is the value of the part after ":" in the Host header, > if any, or the server port where the client connection was accepted on." > I think that the second is the one that should be used and since this port > number is paired with the host returned from getServerName() rather than > getLocalName(), this seems like a bug to me. Admittedly one that only causes > problems in clustered & load balanced environments, but it's just affected > our site so it would be great if it could be fixed for 5.2 final release. A > final release of Tapestry should not have a bug like this in it! > Unless anyone has a convincing argument why it should be this way, of > course... -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (TAPESTRY-2773) TAPESTRY-2173 have side effect
TAPESTRY-2173 have side effect -- Key: TAPESTRY-2773 URL: https://issues.apache.org/jira/browse/TAPESTRY-2773 Project: Tapestry Issue Type: Bug Components: tapestry-core Reporter: Mihail Slobodyanuk Priority: Critical Example: @Entity public class Ingredient { public Ingredient(){} public Ingredient(String amount, String name) { . } .. } When sombody invoke BeanModel.newInstance for Ingredient entity it call ObjectLicator.autobuild and they try sustitute services as parametrs for non-default constructor Ingredient(String amount, String name). This operation leads to failure, and non sence for entities. To resolve it i can mark default constructor @Inject annotation, but this way add dependency for entities library bu tapestry-annotation library. Other way - improve Registry.autobuild method for trying all constructors, while instantiation do successfull. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.