I recently studied tapestry and made some notes .. (1)

Source: Internet
Author: User
Tags netbeans

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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.