Hello again.
I've done some new tests, debugging what occurs during the view
rendering. I've found, as already mentioned in other posts, that Tiles
intents to build its content with "forward" instead of "include",
which is why it probably doesn't produce anything...
In the class "org.apache.tiles.servlet.context.ServletTilesRequestContext",
the following method is where the interesting things occur :
public void dispatch(String path) throws IOException {
if (response.isCommitted() || ServletUtil.isForceInclude(request)) {
include(path);
} else {
forward(path);
}
}
I've found a post or two that seems to report similar problems, and
giving as a possible solution to configure a ViewPreparer to intercept
the request processing and force Tiles to include the generated
content. As the few examples I've seen don't work, here is my own test
version that seems to work at least in my case.
public void execute(final TilesRequestContext tilesContext, final
AttributeContext attributeContext) {
ServletTilesRequestContext servletRequest =
ServletUtil.getServletRequest(tilesContext);
servletRequest.getRequest().setAttribute(ServletUtil.FORCE_INCLUDE_ATTRIBUTE_NAME,
Boolean.TRUE);
Although this seems to be a nice solution, because, first, it seems to
work, and also because it doesn't imply the portlet code to be aware
of the Tiles view, I'd like to have more information about the
behavior of Tiles in portlet applications, and be sure no better
solution could be done using an appropriate configuration.
Thanks again.
Regards.
On Mon, Aug 13, 2012 at 10:08 PM, Nicolas LE BAS <[email protected]> wrote:
> Hi,
>
> On 12-08-13 01:48 PM, Ephemeris Lappis wrote:
>>
>> As already reported in many messages, the configuration for portlet
>> applications is just TBD, and it's a bit... limited to have a concrete
>> idea of it !
>
>
> I agree.
>
> The truth is we're having a hard time maintaining the portlet support in
> tiles. I'm no expert in portlets myself, and I believe the guys in the dev
> team who know best about portlets are now inactive.
>
>> I've been looking for simple examples using Tiles alone in a simple
>> portlet application, but... nothing...
>
>
> There is a test portlet inside the tiles test webapp, source code here:
> http://tiles.apache.org/2.2/framework/tiles-test-pom/tiles-test/xref/org/apache/tiles/test/portlet/TestPortlet.html.
>
> However we're not running an automated test suite against it, as opposed to
> servlets, JSPs, freemarker, velocity... So maybe some bugs manage to get
> through.
>
> If you'd like to help with running a liferay portal automatically as a part
> of the maven build, I'd be happy to fix the bugs that we shall probably
> find.
>
> Nick.
>