In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "what are the key points of learning Tapestry". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
I. pages and components
In the process of learning Tapestry, there are ten important knowledge points about pages and components. Tapestry pages and most custom components have a template, a special HTML file that defines the static and dynamic parts of the component (the page and custom components contain .html files and .page files)
The creator indicates which embedded component is active. (use jwcid in the tag of the .html file to apply the response part declared in the .page file)
Components do not have to have templates, and most components provide Tapestry with the response part of the generated code instead of using templates (standard components do not have .html files, you just need to use them in .html files)
Engine, service and friends
The engine (Engine) is a central object, and the understanding of the engine is very important in the process of learning Tapestry. By storing Engine into HttpSession, the engine is ultimately responsible for storing the persistence state of the application. (save persistence information for applications in a session)
The engine service is responsible for encoding the URLs, providing accurate query parameters passed to the framework and precisely generating the actions that should be performed when the URL is triggered.
Access object (visit object) an application-level object that is eventually persisted in HttpSession (similar to session)
Global object (global object) an application-level object that stores global information (similar to application)
Third, template positioning
The HTML template for a page is a simple HTML file, a page includes a HTML template for .html files in the root directory, a page specification file for .page files in the WEB-INF directory, and a class file in the Java package.
To learn Tapestry, you need to understand the HTML template process of the Tapstry search page:
◆ first knows the name of the page and the location of the page specification (.page).
The location of the ◆ search manual (.page)
◆ searches the root directory of the context of the web application
IV. Template content
Components can be placed anywhere in the template, just add the jwcid attribute to any existing tag, and the template contains two methods for components:
◆ declaration component: the type of the component is defined in the page specification
◆ Hidden components: defined in templates (Tapestry built-in components and custom components) with an "@" symbol before the component type
Configure the default attribute name (jwcid) org.apache.tapestry.jwcid-attribute-name
Add to the application file
5. The main parts of the components
The main part of a component is the part that is nested in the tag in the template file.
VI. Component ID
Learn Tapestry to know that each component can only appear once in the template, but you can use the copy-of property to create a cloned component with a new id.
7. Specify parameters
Components can have both formal and informal parameters. Formal parameters are defined by elements and use the element's allow-informal-parameters attribute to indicate whether it accepts or rejects informal parameters. Informal parameters default to string values unless they have a binding prefix.
Template parameters are usually converted to string values as additional attributes in the output. In a special case, when the value of the informal parameter is an IAsset, the value of the property will be URL.
VIII. Formal and informal parameters
Informal parameters can be prefixed with "ognl:" and "message:"
The component uses elements to declare its reserved names, which do not allow informal parameters because the component does not want informal parameters to override its values and will generate these named attributes itself.
IX. Localization
Hello
Hello
Raw= "true" blocks filtering, such as "
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.