Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Igor Drobiazko on Tapestry5
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Enterprise Java User Group Austria
November 02, 2010
Technology
80
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Igor Drobiazko on Tapestry5
Enterprise Java User Group Austria
November 02, 2010
More Decks by Enterprise Java User Group Austria
See All by Enterprise Java User Group Austria
Gerrit Grunwald on What the CRaC... SUPERFAST JVM STARTUP
ejug
2
200
Spring Framework 5.2 - Core Container Revisited
ejug
0
190
Andreas Caternberg on Jenkins Pipelines
ejug
1
800
Martin Ahrer on Continuous Delivery Infrastructure With Docker
ejug
0
170
Dirk Mahler on Software Analyse mit jQAssistant & Neo4j
ejug
1
310
Christoph Strobl on Spring Data & Hypermedia
ejug
0
160
Stefan Armbruster on Graph Modelling Antipatterns
ejug
1
140
Stefan Armbruster on Introduction into Neo4J
ejug
1
100
Michael Nitschinger on Building a reactive Couchbase driver for the JVM
ejug
0
160
Other Decks in Technology
See All in Technology
41歳でAWSが好きすぎてITエンジニアになったおっさんの話
yama3133
1
780
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
110k
クラウドを使う側から、作る側へ / 大吉祥寺.pm 2026前夜祭
fujiwara3
7
1.6k
システム監視を 「システムを監視するだけ」で 終わらせないために
seiud
0
120
変更し続けられるシステムをどう保つか — AI時代のSSoTという設計原則
kawauso
1
1.4k
VPCセキュリティ対応の最新事情
nagisa53
1
340
エンタープライズデータへ安全につなぐ Production-ready なエージェント設計 ― AI × MCP リファレンスアーキテクチャ ― #AIDevDay
cdataj
1
170
CloudWatchから始めるAWS監視
butadora
0
250
オートマトンと字句解析でRoslynを読む
tomokusaba
0
100
書籍セキュアAPIについて
riiimparm
0
360
MCPをつなげて作る組織横断のAIエージェント基盤
tsubakimoto_s
0
190
人とエージェントが高め合う協業設計
kintotechdev
0
1k
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
640
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Scaling GitHub
holman
464
140k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6k
Designing for humans not robots
tammielis
254
26k
The Invisible Side of Design
smashingmag
301
52k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.3k
Paper Plane
katiecoart
PRO
2
52k
Transcript
by Igor Drobiazko
About Me • Apache Tapestry Committer • Project Management Committee
• Tapestry Evangelist • Book author & Speaker • http://tapestry5.de •
[email protected]
Books
Books
History of Web Frameworks 2000 2001 2002 2003 2004 2005
2006 2007 2008 2009 2010 2011
History of Web Frameworks 2000 2001 2002 2003 2004 2005
2006 2007 2008 2009 2010 2011 1.0
History of Web Frameworks 2000 2001 2002 2003 2004 2005
2006 2007 2008 2009 2010 2011 1.0 1.0
History of Web Frameworks 2000 2001 2002 2003 2004 2005
2006 2007 2008 2009 2010 2011 3.0 1.0 1.0
History of Web Frameworks 2000 2001 2002 2003 2004 2005
2006 2007 2008 2009 2010 2011 3.0 1.0 1.0 1.0
History of Web Frameworks 2000 2001 2002 2003 2004 2005
2006 2007 2008 2009 2010 2011 3.0 1.0 1.0 1.0 1.0
History of Web Frameworks 2000 2001 2002 2003 2004 2005
2006 2007 2008 2009 2010 2011 3.0 1.0 1.0 1.0 1.0 1.0
History of Web Frameworks 2000 2001 2002 2003 2004 2005
2006 2007 2008 2009 2010 2011 3.0 1.0 1.0 4.0 1.0 1.0 1.0
History of Web Frameworks 2000 2001 2002 2003 2004 2005
2006 2007 2008 2009 2010 2011 3.0 1.0 1.0 4.0 1.0 2.0 1.0 1.0
History of Web Frameworks 2000 2001 2002 2003 2004 2005
2006 2007 2008 2009 2010 2011 3.0 1.0 1.0 4.0 5.0 1.0 2.0 1.0 1.0
History of Web Frameworks 2000 2001 2002 2003 2004 2005
2006 2007 2008 2009 2010 2011 3.0 1.0 1.0 4.0 5.0 1.0 2.0 2.0 1.0 1.0
History of Web Frameworks 2000 2001 2002 2003 2004 2005
2006 2007 2008 2009 2010 2011 3.0 1.0 1.0 4.0 5.0 1.0 2.0 2.0 1.0 5.1 5.2 1.0
Why Tapestry?
Tapestry is ... a web framework for Java
Tapestry is ... JSP-less
Tapestry is ... easy to deploy
Tapestry is ... easy to deploy
JSR 303: Bean Validation Tapestry is ... adaptable
Tapestry is ... powerful
Tapestry is ... highly productive
Performance & Scalability
Quality
Tapestry is ... fun
Tapestry Elements
Application Structure Page Application Component Page Component Component Component Component
Component Component
Package Structure org.example pages components services mixins
Tapestry Pages MyPage.java MyPage.tml
RESTful URLs MyPage.java
RESTful URLs MyPage.java
RESTful URLs http://localhost:8080/app/mypage MyPage.java
RESTful URLs http://localhost:8080/app/mypage MyPage.java
RESTful URLs http://localhost:8080/app/mypage MyPage.java HTTP/1.1 200 OK
Tapestry Templates <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> </body> </html> ${hello} Index.tml
Tapestry Templates public class Index { ! ! public String
getHello() { ! ! return "Hello, World!"; ! } } <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> </body> </html> ${hello} Index.tml Index.java
Tapestry Templates public class Index { ! ! public String
getHello() { ! ! return "Hello, World!"; ! } } <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> </body> </html> ${hello} Index.tml Index.java
Tapestry Templates public class Index { ! ! public String
getHello() { ! ! return "Hello, World!"; ! } } <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> </body> </html> Index.tml Index.java
Tapestry Templates public class Index { ! ! public String
getHello() { ! ! return "Hello, World!"; ! } } <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> </body> </html> ${prop:hello} Index.tml Index.java
Invisible Instrumentation <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <t:pagelink page="MyPage">Go to MyPage</t:pagelink> </body>
</html>
Invisible Instrumentation <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <t:pagelink page="MyPage">Go to MyPage</t:pagelink> </body>
</html> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <a t:type="pagelink" page="MyPage">Go to MyPage</a> </body> </html>
Meta Programming public class Login { ! @Property @Persist private
String username; @Property @Persist private String password; @Inject private Session session; @CommitAfter @DiscardAfter public Object onSuccess() { User user = (User) session.createCriteria(User.class) .add(Restrictions.eq("username", username)); ... user.setLastLogin(new Date()); ! return UserProfile.class; } }
State Management public class MyPage { @Persist private String value;
! @SessionState private User user; ... } Persistent field Session State Object
Demo Developer Productivity
Tapestry Components
Tapestry Components MyComponent.java MyComponent.tml
Tapestry Components <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <t:helloComponent name="literal:Igor"/> </body> </html> MyPage.tml
Tapestry Components public class HelloComponent { @Parameter private String name;
public String getHello(){ return "Hello, " + name; } } <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <t:helloComponent name="literal:Igor"/> </body> </html> MyPage.tml HelloComponent.java
Tapestry Components public class HelloComponent { @Parameter private String name;
public String getHello(){ return "Hello, " + name; } } <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <t:helloComponent name="literal:Igor"/> </body> </html> MyPage.tml HelloComponent.java
Tapestry Components public class HelloComponent { @Parameter private String name;
public String getHello(){ return "Hello, " + name; } } <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <t:helloComponent name="literal:Igor"/> </body> </html> <div xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> ${hello} </div> MyPage.tml HelloComponent.java HelloComponent.tml
Tapestry Components public class HelloComponent { @Parameter private String name;
public String getHello(){ return "Hello, " + name; } } <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <t:helloComponent name="literal:Igor"/> </body> </html> <div xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> ${hello} </div> MyPage.tml HelloComponent.java HelloComponent.tml
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <t:helloComponent name="literal:Igor"/> </body> </html> MyPage.tml Tapestry Components
public class HelloComponent { @Parameter private String name; void beginRender(MarkupWriter
writer){ writer.element("div"); writer.write("Hello, " + name); writer.end(); } } <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <t:helloComponent name="literal:Igor"/> </body> </html> HelloComponent.java MyPage.tml Tapestry Components
public class HelloComponent { @Parameter private String name; void beginRender(MarkupWriter
writer){ writer.element("div"); writer.write("Hello, " + name); writer.end(); } } <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <t:helloComponent name="literal:Igor"/> </body> </html> HelloComponent.java MyPage.tml Tapestry Components
Component Rendering
Component Rendering public class HelloComponent { @Parameter private String name;
boolean beginRender(MarkupWriter writer){ writer.element("div"); writer.write("Hello, " + name); writer.end(); return false; } }
Component Rendering
Component Rendering public class HelloComponent { @Parameter private String name;
void beginRender(MarkupWriter writer){ writer.element("div"); } void beforeRenderBody(MarkupWriter writer){ writer.write("Hello, " + name); } void afterRender(MarkupWriter writer){ writer.end(); } }
UI for JavaBeans
BeanEditForm
Grid
Demo User Interfaces for JavaBeans
Component Events
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <a t:type="actionlink">Click me</a> </body> </html> Index.tml Component
Events 1/3
public class Index { ! ! void onAction() { !
! ... ! } } <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <a t:type="actionlink">Click me</a> </body> </html> Index.tml Index.java Component Events 1/3
public class Index { ! ! void onAction() { !
! ... ! } } <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <a t:type="actionlink">Click me</a> </body> </html> Index.tml Index.java Component Events 1/3
Component Events 2/3 <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <a t:type="actionlink" t:id="first">Click me</a>
<a t:type="actionlink" t:id="second">Click me too</a> </body> </html> Index.tml
Component Events 2/3 public class Index { ! ! void
onActionFromFirst(){...} void onActionFromSecond(){...} } <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <a t:type="actionlink" t:id="first">Click me</a> <a t:type="actionlink" t:id="second">Click me too</a> </body> </html> Index.tml Index.java
Component Events 2/3 public class Index { ! ! void
onActionFromFirst(){...} void onActionFromSecond(){...} } <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <a t:type="actionlink" t:id="first">Click me</a> <a t:type="actionlink" t:id="second">Click me too</a> </body> </html> Index.tml Index.java
Component Events 2/3 public class Index { ! ! void
onActionFromFirst(){...} void onActionFromSecond(){...} } <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <a t:type="actionlink" t:id="first">Click me</a> <a t:type="actionlink" t:id="second">Click me too</a> </body> </html> Index.tml Index.java
Component Events 2/3 public class Index { ! ! void
onActionFromFirst(){...} void onActionFromSecond(){...} } <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <a t:type="actionlink" t:id="first">Click me</a> <a t:type="actionlink" t:id="second">Click me too</a> </body> </html> public class Index { ! @OnEvent(component="first", event="action") ! void foo() {...} @OnEvent(component="second", event="action") void bar() {...} } Index.tml Index.java Index.java
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <t:form> <t:texfield value="username"/> <t:passwordfield value="password"/> <input type="submit">
</t:form> </body> </html> Login.tml Component Events 3/3
public class Login { ! void onValidateForm() { ... }
void onSuccess() { ... } void onFailure() { ... } } <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> <t:form> <t:texfield value="username"/> <t:passwordfield value="password"/> <input type="submit"> </t:form> </body> </html> Login.tml Login.java Component Events 3/3
Events & Page Navigation
Events & Page Navigation public class Index { @InjectPage private
MyPage myPage; ! ! Object onAction(){ return myPage; } }
Events & Page Navigation
Events & Page Navigation public class Index { ! Object
onAction(){ return „MyPage“; } }
Events & Page Navigation
Events & Page Navigation public class Index { ! Object
onAction(){ return MyPage.class; } }
Events & Page Navigation
Events & Page Navigation public class Index { ! Object
onAction() throws MalformedURLException { return new URL(“http://www.google.com“); } }
Events & Page Navigation
Internationalization
Message Catalog MyPage.java MyPage.tml MyPage.properties MyPage_de.properties app.properties
Accessing Messages <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> </body> </html> ${message:welcome-message} MyPage.tml
Accessing Messages welcome-message=Welcome <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> </body> </html> ${message:welcome-message} MyPage.tml
MyPage.properties
Accessing Messages welcome-message=Welcome <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> </body> </html> ${message:welcome-message} welcome-message=Willkommen
MyPage.tml MyPage.properties MyPage_de.properties
Accessing Messages welcome-message=Welcome <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> </body> </html> ${message:welcome-message} welcome-message=Willkommen
welcome-message="#$%# &#'()#*(+, MyPage.tml MyPage.properties MyPage_de.properties MyPage_ru.properties
Accessing Messages welcome-message=Welcome <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> </body> </html> ${message:welcome-message} welcome-message=Willkommen
welcome-message="#$%# &#'()#*(+, MyPage.tml MyPage.properties MyPage_de.properties MyPage_ru.properties
Accessing Messages welcome-message=Welcome <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> </body> </html> ${message:welcome-message} welcome-message=Willkommen
welcome-message="#$%# &#'()#*(+, de MyPage.tml MyPage.properties MyPage_de.properties MyPage_ru.properties
Accessing Messages welcome-message=Welcome <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> </body> </html> ${message:welcome-message} welcome-message=Willkommen
welcome-message="#$%# &#'()#*(+, de MyPage.tml MyPage.properties MyPage_de.properties MyPage_ru.properties
Accessing Messages welcome-message=Welcome <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> </body> </html> ${message:welcome-message} welcome-message=Willkommen
welcome-message="#$%# &#'()#*(+, de en MyPage.tml MyPage.properties MyPage_de.properties MyPage_ru.properties
Accessing Messages welcome-message=Welcome <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> </body> </html> ${message:welcome-message} welcome-message=Willkommen
welcome-message="#$%# &#'()#*(+, de en MyPage.tml MyPage.properties MyPage_de.properties MyPage_ru.properties
Accessing Messages welcome-message=Welcome <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"> <body> </body> </html> ${message:welcome-message} welcome-message=Willkommen
welcome-message="#$%# &#'()#*(+, de en ru MyPage.tml MyPage.properties MyPage_de.properties MyPage_ru.properties
Localizable Templates MyPage.java MyPage.tml MyPage_iw.tml MyPage_jp.tml
None
Localizable Images MyPage.java MyPage.tml Logo.jpg Logo_de.jpg Logo_ru.jpg
Ajax & Tapestry
Partial Updates 0
Partial Updates 0
Partial Updates Click 0
Partial Updates Click
Partial Updates Click 1
Demo Ajax
Around Tapestry Tapestry JumpStart Tapestry360
http://tapestry.apache.org/
Coming Soon
http://tapestry.zones.apache.org:8180/tapestry5- hotel-booking/
http://jumpstart.doublenegative.com.au
http://tynamo.org
http://chenillekit.org
http://tapestry5.de
Thank You