What you would like to do is to be able to use template "parameters"
in logic tags.
  I have another solution to this problem : add a tag importing template
"parameter/attribute" in  jsp scope (page, request, ...), as a bean.
Like this, you can use logic tag with the imported bean (which in
reality is a simple String).

  <!-- import template attribute in the specified scope -->
<template:importAttribute name="chapter" scope="page" />
  <!-- Do what you want with the bean -->
 <logic:present name="chapter">
...
</logic:present>

Advantages of this approach :

   * No need to modify existing logic tags
   * No template stuff in struts core library : Struts and templates
     still well separated
   * Imported bean value can be used in any others tags accepting a bean

This proposed solution already exist in Components / Extended Templates.
So,  you can test it immediately ...

  Cedric

Components sites :
  http://www.lifl.fr/~dumoulin/components/
  (mirror) : http://www.geocities.com/cedricdumoulin/components/

Oleg V Alexeev wrote:

> Hello struts-dev,
>
> Now I use next scheme to pass parameters to the template page -
>
> --------------- page ------------
> <template:insert template="layout/main.jsp?chapter=news">
> </template:insert>
> ---------------------------------
>
> and check parameter 'chapter' in template.
> -------------- template ---------
> <logic:present parameter="chapter">
> ...
> </logic:present>
> ---------------------------------
>
> But I think that this approach is not so flexible because of direct
> query string editing. For my mind constructions listed below is more
> preferable -
>
> --------------- page ------------
> <template:insert template="layout/main.jsp">
>  <template:put name="chapter" content="news" direct="true"/>
> </template:insert>
> ---------------------------------
>
> -------------- template ---------
> <logic:present template="chapter">
>  <bean:define id="chapter" template="chapter"/>
>  ....
> </logic:present>
> ---------------------------------
>
> How about it?
>
> --
> Best regards,
>  Oleg                         mailto:[EMAIL PROTECTED]

Reply via email to