tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "doktora v" <dokt...@gmail.com>
Subject Re: tiles1 - tiles2 migration: insert an action
Date Sun, 18 Nov 2007 19:51:26 GMT
I have tried this now with struts2 and tiles2 and it doesn't seem to
work either.
See the attached war. Take a look at /s2t2/test.action

The success of test.action maps to tile test.layout:

<definition name="test.layout" template="/testlayout.jsp">
  <put-attribute name="menuclass" value="leftmenu"/>
  <put-attribute name="bottom" value="/bottom.jsp"/>

Here is testlayout.jsp:
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<tiles:importAttribute name="menuclass"/>
test layout
<tiles:insertAttribute name="menuclass"/>
<tiles:insertTemplate template="/bottom.jsp">
  <tiles:putAttribute name="menuclass" value="${menuclass}"/>

An now here is what bottom.jsp does, inserting an action as a template:
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<tiles:importAttribute name="menuclass" ignore="true"/>

bottom jsp page
menuclass: <tiles:insertAttribute name="menuclass"/>
<tiles:insertTemplate template="/test2.action">

test2.action works, /s2t2/test2.action produces the text "test2layout jsp page".

However, what bottom.jsp renders is
"The requested resource (/s2t2/test2.action) is not available"
in place of where the action's result should be inserted.

Any thoughts? (Sorry for the complicated jsp/tiles, I was testing out
a few other things as well.)

The war file is available here:


On 11/18/07, doktora v <doktora@gmail.com> wrote:
> On 11/18/07, Antonio Petrelli <antonio.petrelli@gmail.com> wrote:
> > 2007/11/18, doktora v <doktora@gmail.com>:
> > > You mean struts1 and tiles2 w/o plugin? How? If I specify the tiles
> > > listener in web.xml and don't specify the plugin in struts-config.xml,
> > > the tiles are not recognized (I get errors of the sort "path does not
> > > begin with /").
> >
> > You can use it without a plugin:
> > 1) by rendering using the Tiles container. See:
> > http://tiles.apache.org/tutorial/basic/pages.html
> > 2) by using the Tiles dispatcher servlet. See:
> > http://tiles.apache.org/tutorial/advanced/utils.html
> >
> > The drawback is that you cannot use a Tiles definition as a Struts forward.
> Hmm... that doesn't fit my specs unfortunately. Thanks though.
> >
> > Antonio
> >

View raw message