I am studying tapestry recently. The tutorial is enjoying web developmentenjoying development.
The development tool is netbeans 5.5 (with the tapestry plug-in installed, supporting tapestry4.0)
§ 1
1. CID indicates that the Java Web component ID corresponds to the ID attribute of. Page component.
2, ognl object graph Navigation language
Is the default prefix and can be left unspecified.
3. In a page property file, there is a <binding name = "value" value = "ognl: username"/>
The corresponding Java class that extends the basepage class on this page must have the GetUserName () method.
Ognl: 'linzp' this is a String constant. The String constant can also be like this: literal: Judy
4. The class attribute of <page-Specification> indicates a page class corresponding to this page. It is an extended basepage class.
The first chapter is about these knowledge points. Below is a simple example.
Tapestry is supported in myeclipse, but the supported version is a little lower, only 3.0. In the tutorial, 4.0 is used. Some things cannot run in 3.0 as if ..
Intellij idea has the tapestry plug-in, but I want to collect the money. I just want to download it and check whether the web site I provided on the Internet cannot be opened ..
You can also use the netbeans tapestry plug-in ..
In the web-INF folder, IDE generates
Home.html
Home. Page
Tapestryapplication. Application
Hivemodule. xml
Web. xml
Tapestryapplication. Application, hivemodule. XML, what are the two files? I don't know yet.
The URL interception of tapestry is written in Web. XML, and the generated web. XML has been written ..
Home.html
<HTML>
<Head>
<Title> </title>
</Head>
<Body>
Hello, <span cid = "subject"> </span>
</Body>
</Html>
Home. Page
<Page-specification class = "com. helloworld. pages. Home">
<Component id = "subject" type = "insert">
<Binding name = "value" value = "ognl: subject"/>
</Component>
</Page-Specification>
Write a corresponding page class home. Java
Package com. helloworld. pages;
Import org.apache.tapestry.html. basepage;
Public class home extends basepage ...{
Public String getsubject ()
...{
Return "linzp? Yeah, it's me ...";
}
}
Deploy the file and run ..
Or enter http: // localhost: 8084/helloworld/APP/in the address bar of the browser/
Running result:
Hello, linzp? Yeah, it's me...