web.xml中加入
<context-param>
<param-name>tapestry.app-package</param-name>
<param-value>t5tutorial</param-value>
</context-param>
<filter>
<filter-name>app</filter-name>
<filter-class>org.apache.tapestry5.TapestryFilter</filter-class>
</filter>
lib下加入
antlr-runtime-3.1.1.jar
javassist-3.9.0.GA.jar
log4j-1.2.14.jar
slf4j-api-1.5.2.jar
slf4j-log4j12-1.5.2.jar
stax2-api-3.0.1.jar
stax-api-1.0.1.jar
tapestry5-annotations-5.1.0.5.jar
tapestry-core-5.1.0.5.jar
tapestry-ioc-5.1.0.5.jar
woodstox-core-asl-4.0.3.jar
Start.java
/**
* Start page of application app.
*/
public class Start
{
public Date getCurrentTime()
{
return new Date();
}
}
Start.tml
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<head>
<title>app Start Page</title>
</head>
<body>
<h1>app Start Page</h1>
<p> This is the start page for this application, a good place to start your modifications.
Just to prove this is live: </p>
<p> The current time is: ${currentTime}. </p>
<p>
[<t:pagelink t:page="Start">refresh</t:pagelink>]
</p>
</body>
</html>