I found a workaround for the wildcard definition problem:
Instead of
<definition name="*" template="/layout/simpleLayout.ftl">
<put-attribute name="body" value="{1}" />
</definition>
i use
<definition name="/*/*" template="/layout/simpleLayout.ftl">
<put-attribute name="body" value="/{1}/{2}" />
</definition>
Now the definition is found, but the simpleLayout.ftl isn't parsed by
FreeMarker it's simply returned as it is:
<#assign tiles=JspTaglibs["http://tiles.apache.org/tags-tiles"]>
<html>
<head>
<title>Test</title>
</head>
<body>
<@tiles.insertAttribute name="body" />
</body>
</html>
Is this caused by the listener class
org.apache.tiles.web.startup.TilesListener?
The http://struts.apache.org/2.1.2/docs/tiles-plugin.html
struts-tiles-plugin page notes org.apache.struts2.tiles.StrutsTilesListener
"provides tighter integration with Struts features such as freemarker
integration".
Now that the StrutsTilesListener is incompatible with Tile2.1 what can i do?
Regards,
Stephan
Stephan Schröder wrote:
>
>> Probably it is a Tiles bug. Can you open a JIRA issue and, if
>> possible, attach a test case (i.e. a WAR file with sources).
>> https://issues.apache.org/struts/browse/TILES
>
> https://issues.apache.org/struts/browse/TILES-325 done
>
> Regards,
> Stephan
>
>
> Antonio Petrelli-3 wrote:
>>
>> 2008/10/28 Stephan Schröder <[EMAIL PROTECTED]>:
>>>> put the URI of the taglib: <#assign
>>>> tiles=JspTaglibs["http://tiles.apache.org/tags-tiles"]>
>>>
>>> done, this will only work as long as i got an internet connection, won't
>>> it?
>>
>> No, it works as long as you put tiles-jsp-xxx.jar under WEB-INF/lib,
>> or if you define it in web.xml.
>>
>>> now i get:
>>> "WARNING: Unable to find the definition '/public/files_show.ftl'
>>> or
>>> "org.apache.tiles.definition.NoSuchDefinitionException:
>>> /public/files_show.ftl
>>>
>>> org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:612)"
>>>
>>> /public/files_show.ftl is present under /WebContent.
>>
>> Mmm... This problem is not due to the presence or not of that file,
>> but it seems that Tiles cannot find the *definition* called
>> "/public/files_show.ftl". This is strange since you put the "*"
>> wildcard.
>> Probably it is a Tiles bug. Can you open a JIRA issue and, if
>> possible, attach a test case (i.e. a WAR file with sources).
>> https://issues.apache.org/struts/browse/TILES
>>
>> Thanks
>> Antonio
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/neccessary-stepts-to-use-Struts-2%2BFreeMarker%2BTiles2.1-tp20209482p20225922.html
Sent from the tiles users mailing list archive at Nabble.com.