tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken McWilliams <ken.mcwilli...@gmail.com>
Subject tiles decoration
Date Fri, 09 Nov 2012 20:47:33 GMT
I would like to render a tiles definition and put this into the body
attribute and then render an other definition now using that body attribute.

I'm using tiles 3 initialized with the
org.apache.tiles.extras.complete.CompleteAutoloadTilesListener

It probably does not matter but I am using struts2 to render a tiles
definition. To render the definition tiles require a "result type":

To get tiles working with struts2 I do the following:

    public void doExecute(String location, ActionInvocation invocation)
throws Exception {
        //location = "test.definition"; //for test
        setLocation(location);
        ServletContext context = ServletActionContext.getServletContext();
        ApplicationContext applicationContext =
ServletUtil.getApplicationContext(context);
        TilesContainer container =
TilesAccess.getContainer(applicationContext);
        HttpServletRequest request = ServletActionContext.getRequest();
        HttpServletResponse response = ServletActionContext.getResponse();
        ServletRequest servletRequest = new
ServletRequest(applicationContext, request, response);
        container.render(location, servletRequest);
    }

The above works....


I'm using JSPs but I could use freemarker for the views, it it matters.

So how do I render a definition into an attribute and then use that value
in the rendering of another definition?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message