Le 05-07-06 à 21:38, Andy Freeman a écrit :
On 7/6/05, David Geary <[EMAIL PROTECTED]> wrote:
Le 05-07-06 à 15:50, Andy Freeman a écrit :
Craig,
How do you think that the Shale-JSF-Tiles implementation compares
to what
MS is introducing with ASP.NET <http://ASP.NET> 2.0's Master Pages?
article:
http://www.ondotnet.com/pub/a/dotnet/2004/09/27/
libertyonwhidbey.html
sample source code:
http://www.ondotnet.com/dotnet/2004/09/27/examples/Source.zip
thanks,
Andy
Tiles is very much like ASP 2.0 Master Pages. They both compose
disparate content fragments into a page and you can specify that
content statically with XML or dynamically, with code.
Shale's Tiles integration lets you load a tile directly instead of
loading a JSP page that inserts the tile. You can also specify a JSP
page or a tile with the same view ID, which makes it easy to plug in
a tile for an existing page, or vice-versa.
David,
I have use Struts and Tiles together in the past. I always found
Tiles to somewhat verbose if you used the XML structure. :(
With the Shales Tiles integration, will it be this simple to create
pages?
First, create a master page to define the overall page layout:
TopMasterPage.master
-----------------------------------------
<%@ Master Language="C#" CompileWith="TopMasterPage.master.cs"
ClassName="TopMasterPage_master" %>
...
<body>
...
<div>
<asp:contentplaceholder id="TopPageContent" runat="server">If you see
this content,
then the master page content was not
replaced<br />
</asp:contentplaceholder>
</div>
...
-----------------------------------------
Second, create a content page which defines which master page to use,
which content id(s) to insert the content into, and what the page
title is:
Welcome.aspx
-----------------------------------------
<%@ Page Language="C#" MasterPageFile="~/TopMasterPage.master"
CompileWith="Welcome.aspx.cs" ClassName="Welcome_aspx" Title="Welcome
Page" %>
<%@ MasterType VirtualPath="~/TopMasterPage.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TopPageContent"
Runat="server">
This is
the content of the welcome page.
...
</asp:Content>
------------------------------------------
Third, there is no third. Since MS made Master Pages a first class
concept within ASP.NET 2.0 you don't need to modify the Web.Config
file and you don't need to create something like a tiles-defs.xml file
in order to take advantage of them. Here is the sample code link I
sent earlier: http://www.ondotnet.com/dotnet/2004/09/27/examples/
Source.zip
Again, will the Shale Tiles integration make it this easy to layout
pages? I am sure there is a bit of web.xml configuration to do and I
am okay with that, but looking at the sample ASP.NET code, I hope it
is not a lot. I think this is simply too powerful of a concept to not
have an equivalent on the Java side.
There's no web.xml configuration if you use Shale's Tiles
integration. shale-tiles.jar
contains a META-INF/web.xml file that declares the Tiles servlet.
You do have an XML config file, though. I'm not convinced that
ASP.NET is
easier. You still have to specify the same information: which page is
the layout,
(master) which represent content, and how they are contained. With
Tiles, you specify
that information in an XML file, with ASP.NET, you inline it in ASP
(apparently from the
preceeding example--sorry I haven't used ASP.NET).
I know Tiles gets dinged for its config file now that everyone
suddenly hates XML.
But IMO, it's one of Tiles strengths. I can see how all my pages are
composed and
do amazing things with tiles in the context of a single XML file.
david
thanks,
Andy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]