You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marcus Biel <Ma...@bmw.de> on 2002/10/29 12:11:26 UTC

How to use Templates efficently ?

Sorry this might be a dumb question,
but I can't really figure out how to use struts templates efficently.

I already had a look at Struts-Docu:
http://localhost:8080/struts-documentation/api/org/apache/struts/taglib/template/package-summary.html#package_description

If i figured it out correctly,

You got for example

a header file
a content file
a footer file
a "template file":
<tr><td><template:get name='header'/></td></tr>
<tr><td><template:get name='content'/></td></tr>
 <tr><td><template:get name='footer'/></td></tr>

a jsp that uses those templates:
<template:put name='title' content='Templates' direct='true'/>
<template:put name='header' content='/header.html' />
<template:put name='sidebar' content='/sidebar.jsp' />
<template:put name='content' content='/introduction.html'/>
<template:put name='footer' content='/footer.html' />

Asuming I would have 100 different jsp content files,
I would have:
1 header file
1 footer file
1 template file
100 content files
100 jsp files that are "using" the other files.

so I would have 203 files instead of 100 !!!

For this example: wouldn't it make more sense, 
to have one "introduction.jsp" file, and at the begining you insert your
header file,
at the end you insert your footer file.
1 header file
1 footer file
100 Content files.
102 Files (not 203!)

Am I correct ? Is this possible ?

thx,
marcus

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>