Tapestry4 refused the injection (Inject) function
inject，JDK1.5,inject； 1. Configuration file to use inject, it is worth noting that even without the use of JDK1.5, inject also be able to work;
JDK1.5(annotation)。 2. JDK1.5 code to support the use of metadata tagging (annotation).
Function of the individual does not like to inject. Not because I am old, refuses to reform, but did not feel much need to use them.
，page，，。 First of all, page document, use it to increase the complexity of configuration, a bit over-suspicion configuration. page document with the template should only include the definition of dynamic content, such as injection of other types of content on there to do better.
Especially for the spring in support of the injection, and finally the use of inject in the page file configuration, not found directly in the code of the method of Bean.
I realized a Initializer, which provides for the open category page category WebApplicationContext visit, this is not more simple?
Howard Lewis Ship is strongly recommended for all types of inject inside in the class to provide direct access method.
，JDK1.5，JDK。 Second, the meta-data tagging is a feature introduced in JDK1.5 with low incompatible versions of the JDK. Now many applications are running under version 1.4.
,page，。 Finally, page features the use of injection is not conducive to reuse.
I now use the environment to develop JDK1.4.2, Tapestry4.0. After using the following method, page and inject the code did not use all the normal work.
Instead of injection (Inject) code
1. Meta injection
| <meta key="page.size" value="15"/> |
<inject property="pageSize" type="meta" object="page.size"/>
|this.getEngine (). getInfrastructure (). getApplicationPropertySource (). getPropertyValue ( "page.size")|
II. Object into
infrastructure types of binding, can such a visit
|cycle.getInfrastructure (). get ###()|
|<inject property="assetFactory" object="infrastructure:assetFactory"/>|
|cycle.getInfrastructure (). getAssetFactory ()|
III. Page into
|<inject property="detailsPage" type="page" object="Details"/>|
|this.getRequestCycle (). getPage ( "Details");|
IV. Script injection
|<inject property="script" type="script" object="Palette.script"/>|
| / / Not used the script, so this has not been tested for |
Resource s = this.getRequestCycle (). GetInfrastructure (). GetContextRoot (). GetRelativeResource ( "/ Palette / script");
this.getRequestCycle (). getInfrastructure (). getScriptSource (). getScript (s);
5. State injection
|<inject name="registration" type="state" object="registration-data"/>|
|this.getEngine (). getInfrastructure (). getApplicationStateManager (). get ( "registration-data");|
Visit and Global objects similar access methods:
| this.getEngine (). getInfrastructure (). getApplicationStateManager (). get ( "visit") |
this.getEngine (). getInfrastructure (). getApplicationStateManager (). get ( "global")
6. State-flag-depth study of the type that do not.
7. Attribute / parameter access methods
| this.getEngine (). getInfrastructure (). getGlobalPropertySource (). getPropertyValue ( "YourPropertyName") |
tapestry & hivemind Articles
- Tapestry Developer's Guide (6)
- Tapestry Developer's Guide (5)
- Tapestry Developer's Guide (3)
- Tapestry Developer's Guide (2)
- Tapestry Developer's Guide (1)
- Tapestry sub-page to identify and resolve issues
- 5 Cart tapestry, let us try to do some small
- tapestry Cart 4, the purchase of the amount of statistics
- 3 Cart tapestry to buy fruit
- 2 Cart tapestry, fruit shop
- 1 Cart tapestry, landing
- Wap Application Development Tapestry (Original)
- tapestry environmental structures
- Tapestry4 refused the injection (Inject) function
- Tapestry template technology into
- tapestry of research and application of binding
- Tapestry framework to expand research
- Exception Handling Tapestry modify page
- Tapestry data format conversion and storage of the study between the 2
- Tapestry data format conversion and storage of the study between 1
Can't Find What You're Looking For?
Rating: Not yet rated