Ben,

Why not put "msgs" in your main template but leave it equal to the value "".
That way, nothing will show up in the main template but when you extend it
and change the "msgs" component depending on what you need to display in
that location of your output. You would end up with something like this:

In tiles-def.xml:
<definition name=".pub.welcome" path="/WEB-INF/layout.jsp">
        <put name="header" value="/WEB-INF/pgs/header.jsp" />
        <put name="msgs" value="" />
        <put name="content" value="/WEB-INF/pgs/welcome.jsp" />
</definition>

Then, extend it for various output pages and either define msgs to show
something or leave it blank.  For example, your error page might be this
template:
<definition name=".pub.errors" extends=".put.welcome">
        <put name="msgs" value="/WEB-INF/pgs/msgs.jsp" />
</definition>

Your login page definition might change the "content" page to login.jsp like
so:
<definition name=".pub.login" extends=".put.welcome">
        <put name="content" value="/WEB-INF/pgs/login.jsp" />
</definition>

And so forth for each respective "page" you wish to show.  Essentially, you
will be including components into templates instead of fixing this into each
JSP directly.  The result gives you an easier time changing things (just
update tiles-defs.xml) when you need to modify your site's look and feel.

Regards,
David

-----Original Message-----
From: Ben Taylor [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 03, 2005 11:52 AM
To: Struts Users Mailing List
Subject: Remove Tiles Component


I know there have been a few Tiles related question recently, but
having read them I still can't figure out how to solve my problem.

At current I'm using:
 <tiles:insert component="/WEB-INF/pgs/msgs.jsp"/>
... within a few of my JSPs.  The position of this component within
the document changes for each JSP file so I can not create a new
layout file for it.

This is my current tiles-def file:
 <definition name=".pub.welcome" path="/WEB-INF/layout.jsp">
   <put name="header" value="/WEB-INF/pgs/header.jsp"/>
   <put name="content" value="/WEB-INF/pgs/welcome.jsp"/>
 </definition>

I'd like to be able to add an extra line to the above base definition
(.pub.welcome) along the lines of:
 <put name="msgs" value="/WEB-INF/pgs/msgs.jsp"/>... and then be able to
insert that page within a number of my
(content) JSP files.

I've tried using <tiles:insert attribute="msgs"/> but it doesn't work. :-(

Can anyone suggest a method that might work?

Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to