struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Freeman <andy.w.free...@gmail.com>
Subject Re: [shale] Configuring TilesViewHandler
Date Thu, 07 Jul 2005 03:38:44 GMT
On 7/6/05, David Geary <sabreware@earthlink.net> 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.

thanks,
Andy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message