CVS: TapestryBook/examples/context JSP.html,NONE,1.1 CreditCard.html,NONE,1.1 Target.html,NONE,1.1 ExternalTagDemo.jsp,NONE,1.1 CreditCardResults.html,NONE,1.1 PageTagDemo.jsp,NONE,1.1 JSPForm.html,NONE,1.1 Home.html,1.9,1.10
Howard Lewis Ship <[email protected]> Sun, 22 Jun 2003 09:42:40 -0700
| Newsgroups | gmane.comp.java.tapestry.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/tapestry/TapestryBook/examples/context
In directory sc8-pr-cvs1:/tmp/cvs-serv27669/examples/context
Modified Files:
Home.html
Added Files:
JSP.html CreditCard.html Target.html ExternalTagDemo.jsp
CreditCardResults.html PageTagDemo.jsp JSPForm.html
Log Message:
Check in lots of updates, due to revisions and the new chapter 08.
--- NEW FILE: JSP.html ---
<span jwcid="@Border" title="Linking to JSP">
You may:
<ul>
<li><a href="#" jwcid="@DirectLink" listener="ognl:listeners.displayPageTagDemo">Page Tag Demo</a>:
View a page demonstrating the <tapestry:page> tag</li>
<li><a href="#" jwcid="@DirectLink" listener="ognl:listeners.displayExternalTagDemo">External Tag Demo</a>:
View a page demonstrating the <tapestry:external-url> tag</li>
</ul>
</span>
--- NEW FILE: CreditCard.html ---
<html jwcid="@Shell" title="Credit Card" stylesheet="ognl:assets.stylesheet">
<head jwcid="$remove$">
<link rel="stylesheet" type="text/css" href="css/style.css"/>
</head>
<body jwcid="@Body">
<span class="title">Credit Card</span>
<p>This page demonstrates the CreditCardField component.
</p>
<span jwcid="@lib:FormError" delegate="ognl:beans.delegate"/>
<form jwcid="@Form" listener="ognl:listeners.formSubmit" delegate="ognl:beans.delegate">
<table class="form">
<tr>
<th>Card Type</th>
<td><select jwcid="inputCardType"/></td>
</tr>
<tr>
<th><span jwcid="@FieldLabel" displayName="Credit Card Number"
field="ognl:components.inputNumber">Credit Card Number</span></th>
<td><input type="text" jwcid="inputNumber@CreditCardField" cardNumber="ognl:cardNumber" size="50"/></td>
</tr>
<tr>
<td></td>
<td><input type="image" src="images/continue.png" width="100" height="32"/>
</tr>
</table>
</form>
<hr/>
<p><a href="#" jwcid="@PageLink" page="Home">Return to Home page</a>.</p>
</body>
</html>
--- NEW FILE: Target.html ---
<span jwcid="@Border" title="JSP Target">
... and back into the world of Tapestry. This is Tapestry page "Target".
</span>
--- NEW FILE: ExternalTagDemo.jsp ---
<%@ taglib uri="http://jakarta.apache.org/tapestry/tld/tapestry_1_0.tld" prefix="tapestry" %>
<html>
<head>
<title>Tapestry JSP Page</title>
</head>
<body>
<form action="<tapestry:external-url page="JSPForm"/>" method="POST">
Enter your name: <input type="text" name="userName" maxlength="100" size="40"/>
<br/>
<input type="submit"/>
</form>
</body>
</html>
--- NEW FILE: CreditCardResults.html ---
<html jwcid="@Shell" title="Credit Card Results" stylesheet="ognl:assets.stylesheet">
<body>
<p>Here is the data your entered:</p>
<br/>
Card Type: <span jwcid="@Insert" value="ognl:cardType.name">Discover</span>
<br/>
Card Number: <span jwcid="@Insert" value="ognl:cardNumber">0000-0000-0000-0000</span>
<hr/>
<p><a href="#" jwcid="@PageLink" page="Home">Return to Home page</a>.</p>
</body>
</html>
--- NEW FILE: PageTagDemo.jsp ---
<%@ taglib uri="http://jakarta.apache.org/tapestry/tld/tapestry_1_0.tld" prefix="tapestry" %>
<html>
<head>
<title>Tapestry JSP Page</title>
</head>
<body>
<script>
<!--
function raiseTarget(targetURL)
{
var width = 200;
var height = 200;
var screenX = Math.floor((screen.width)/2)-Math.floor(width/2);
var screenY = Math.floor((screen.height)/2)-Math.floor(height/2)-20;
var features =
"toolbar=no," +
"scrollbars=no," +
"status=no," +
"top=" + screenY + "," +
"left=" + screenX + "," +
"screenX=" + screenX + "," +
"screenY=" + screenY + "," +
"width=" + width + "," +
"height=" + height;
window.open(targetURL, "TargetPage", features).focus();
}
-->
</script>
Two examples of invoking Tapestry pages from a JSP using the tag library:
<ul>
<li>Using <tapestry:page> to <tapestry:page page="Target">display the target page</tapestry:page></li>
<li>Using <tapestry:page-url> to <a href="javascript:raiseTarget('<tapestry:page-url page="Target"/>');">raise the target page in a new window</a></li>
</ul>
</body>
</html>
--- NEW FILE: JSPForm.html ---
<span jwcid="@Border" title="JSPForm">
... and back into the world of Tapestry. This is Tapestry page "JSPForm".
<p>
You entered: <span jwcid="@Insert" value="ognl:userName">John Smith</span>
</p>
</span>
Index: Home.html
===================================================================
RCS file: /cvsroot/tapestry/TapestryBook/examples/context/Home.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Home.html 25 May 2003 21:27:32 -0000 1.9
--- Home.html 22 Jun 2003 16:42:08 -0000 1.10
***************
*** 2,6 ****
<body>
! <p>Examples from the book:</p>
<ul>
--- 2,6 ----
<body>
! <p>Examples for "Tapestry in Action":</p>
<ul>
***************
*** 21,25 ****
--- 21,28 ----
<li><a href="#" jwcid="@PageLink" page="Pets">Pets</a> Demostrates DirectArea component</li>
<li><a href="#" jwcid="@PageLink" page="ResumeBuilder">ResumeBuilder</a> - Demonstrates use of component libraries</li>
+ <li><a href="#" jwcid="@PageLink" page="CreditCard">CreditCard</a> - Demostrates complex custom component</li>
+ <li><a href="#" jwcid="@PageLink" page="JSP">JSP</a> - Demonstrates use of JSPs with Tapestry</li>
</ul>
+
</body>
-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php