You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Kay Lingenauber <it...@clarq.com> on 2002/08/14 18:53:22 UTC

extending the content in templates & tiles

Hi everybody,

although I surfed through the docs und mail-lits of Struts etc. I didn't find a solution for my template-problem.

I developed a web-application with JSP's in the presentation layer. For now, no templates etc. are used.

As described in http://jakarta.apache.org/struts/doc-1.0.2/api/org/apache/struts/taglib/template/package-summary.html#package_description I would like to use templates.

But,  ;)
as content, I can't use other JSPs or HTML-Pages like this

<template:insert template='/chapterTemplate.jsp'>
  <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' />
</template:insert>

because I can't split the JSP which I use now into some small JSP's/HTML's.

I need something like that: 

<template:insert template='/chapterTemplate.jsp'>
  <template:put name='title' content='Templates' direct='true'/>
  <template:put name='header' content='

	<table><tr><td> ...some HTML-Code here instead of a file 	</table></tr></td>	

	' />
  <template:put name='sidebar' content='

	<table><tr><td> ...and some HTML-Code here. 	</table></tr></td>

	' />
  <template:put name='footer' content='/footer.html' />
</template:insert>

As you can see, I need to write JSP and HTML-Code into the template:put-tag.

I don't now, whether this will work with the template-taglib or the tile-taglib. Will it ? ;)
If not, can you give me a hint, how I can solve this problem. 

Thx very much ! :)

Kay

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


Re: extending the content in templates & tiles

Posted by Cedric Dumoulin <ce...@apache.org>.
  Hi,

  With Tiles you should be able to do something like this (not tested):

<template:insert template='/chapterTemplate.jsp'>
  <template:put name='title' content='Templates' direct='true'/>
  <template:put name='header' direct='true'>

	<table><tr><td> ...some HTML-Code here instead of a file 	</table></tr></td>	
  </template:put>
  <template:put name='sidebar' direct='true' >
	<table><tr><td> ...and some HTML-Code here. 	</table></tr></td>
  </template:put>
  <template:put name='footer' content='/footer.html' />
</template:insert>

  Be aware that your tags inside your <put> are interpreted in the same 
page than the <put>, not in the template page.

        Hope this help,
            Cedric

Kay Lingenauber wrote:

>Hi everybody,
>
>although I surfed through the docs und mail-lits of Struts etc. I didn't find a solution for my template-problem.
>
>I developed a web-application with JSP's in the presentation layer. For now, no templates etc. are used.
>
>As described in http://jakarta.apache.org/struts/doc-1.0.2/api/org/apache/struts/taglib/template/package-summary.html#package_description I would like to use templates.
>
>But,  ;)
>as content, I can't use other JSPs or HTML-Pages like this
>
><template:insert template='/chapterTemplate.jsp'>
>  <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' />
></template:insert>
>
>because I can't split the JSP which I use now into some small JSP's/HTML's.
>
>I need something like that: 
>
><template:insert template='/chapterTemplate.jsp'>
>  <template:put name='title' content='Templates' direct='true'/>
>  <template:put name='header' content='
>
>	<table><tr><td> ...some HTML-Code here instead of a file 	</table></tr></td>	
>
>	' />
>  <template:put name='sidebar' content='
>
>	<table><tr><td> ...and some HTML-Code here. 	</table></tr></td>
>
>	' />
>  <template:put name='footer' content='/footer.html' />
></template:insert>
>
>As you can see, I need to write JSP and HTML-Code into the template:put-tag.
>
>I don't now, whether this will work with the template-taglib or the tile-taglib. Will it ? ;)
>If not, can you give me a hint, how I can solve this problem. 
>
>Thx very much ! :)
>
>Kay
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>  
>



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