You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tiles.apache.org by Ivan Zucenko <zu...@gmail.com> on 2008/07/09 15:59:48 UTC
Struts2 tiles
Hi I have 2 questions I tried to find solution for two things on the
edge of Struts2/Tiles
1) I have one main layout template for many situations. There is a place
where I want to put or not to put one special component..
example:
<definition name="index.default" extends="default">
<put-attribute name="body"
value="/templates/tiles/index/default.jsp"/>
*<put-attribute name="foot" value="modul/news.jsp"/>*
</definition>
<definition name="index.logged" extends="default">
<put-attribute name="body"
value="/templates/tiles/index/default.jsp"/>
*<put-attribute name="foot" value="empty.jsp"/>*
</definition>
in one definition I need to show somethink in "foot" section
in most situation nothing.. but do not like to use empty.jsp for
this.. I am sure I misser right solution....
2) how to include instead of value="modul/news.jsp" rather struts action
tag..
not to have modul/news.jsp containing:
<s:action name="modul/news" executeResult="true"/>
but i can understand you may consider too tight coupling with Struts2
Thanks
Ivan
Re: Struts2 tiles
Posted by Ivan Zucenko <zu...@gmail.com>.
Hi Antonio,
OK, I just may recommend that being able to include none template on
specific position would add some more comfort to Tiles.. since I like to
use tiles.xml for exactly this purpose - to decide where to show or not
show some element.. on certain position..
But thanks anyway..
Ivan
Antonio Petrelli wrote:
> 2008/7/9 Ivan Zucenko <zu...@gmail.com>:
>
>> 1) I have one main layout template for many situations. There is a place
>> where I want to put or not to put one special component..
>> ...
>> in one definition I need to show somethink in "foot" section
>> in most situation nothing.. but do not like to use empty.jsp for this.. I
>> am sure I misser right solution....
>>
>
> I think your solution is right, except in the case you have a
> "strange" result as an HTML document, such as an empty <div>. In this
> case I suggest to change the template that you use.
>
>
>> 2) how to include instead of value="modul/news.jsp" rather struts action
>> tag..
>> not to have modul/news.jsp containing:
>> <s:action name="modul/news" executeResult="true"/>
>>
>> but i can understand you may consider too tight coupling with Struts2
>>
>
> See this previous e-mail:
> http://www.nabble.com/Tiles2-import-Struts2-action-via-insertTemplate-td13834640.html
> A template and an attribute value work mostly the same way.
>
> Antonio
>
>
Re: Struts2 tiles
Posted by Antonio Petrelli <an...@gmail.com>.
2008/7/9 Ivan Zucenko <zu...@gmail.com>:
> 1) I have one main layout template for many situations. There is a place
> where I want to put or not to put one special component..
>...
> in one definition I need to show somethink in "foot" section
> in most situation nothing.. but do not like to use empty.jsp for this.. I
> am sure I misser right solution....
I think your solution is right, except in the case you have a
"strange" result as an HTML document, such as an empty <div>. In this
case I suggest to change the template that you use.
> 2) how to include instead of value="modul/news.jsp" rather struts action
> tag..
> not to have modul/news.jsp containing:
> <s:action name="modul/news" executeResult="true"/>
>
> but i can understand you may consider too tight coupling with Struts2
See this previous e-mail:
http://www.nabble.com/Tiles2-import-Struts2-action-via-insertTemplate-td13834640.html
A template and an attribute value work mostly the same way.
Antonio