You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Garner Shawn <sh...@gmail.com> on 2006/08/25 19:40:11 UTC

[Struts 2] Templating available like Tiles

Is there templating available like Tiles where I can define a template
JSP with a header,side menu, body, and footer and then just reuse it
accross pages?

I see there are themes and templates in the documentation but it
usually is simple pages or bits of code generated so I'm not sure if
this can be done with Velocity, Freemarker, etc...

Shawn

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [Struts 2] Templating available like Tiles

Posted by Ted Husted <hu...@apache.org>.
There is a Tiles result in the distribution that you could try.

* http://cwiki.apache.org/WW/tiles-result.html

Once configured, in the struts.xml, you can refer to the tiles as if
they were pages, just like Struts 1:

<action name="editUser" class="userAction" method="edit">
      <result name="success" type="tiles">userForm</result>
      <result name="input" type="tiles">userList</result>
</action>

Or, so I'm told :)

Many WW/S2 developers use SiteMesh as an alternative to Tiles.

* http://today.java.net/pub/a/today/2004/03/11/sitemesh.html

-- HTH, Ted.
* http://www.husted.com/struts/

On 8/25/06, Garner Shawn <sh...@gmail.com> wrote:
> Is there templating available like Tiles where I can define a template
> JSP with a header,side menu, body, and footer and then just reuse it
> accross pages?
>
> I see there are themes and templates in the documentation but it
> usually is simple pages or bits of code generated so I'm not sure if
> this can be done with Velocity, Freemarker, etc...
>
> Shawn

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [Struts 2] Templating available like Tiles

Posted by Greg Reddin <gr...@apache.org>.
On Aug 25, 2006, at 12:40 PM, Garner Shawn wrote:

> Is there templating available like Tiles where I can define a template
> JSP with a header,side menu, body, and footer and then just reuse it
> accross pages?

Matt Raible created a solution[1] for WebWork using Tiles 2.0.  I'm  
not sure if it will work for Struts 2, but it seems like it should.   
In case you didn't know, Tiles 2.0 is in the sandbox.

[1] http://raibledesigns.com/page/rd?entry=how_to_use_tiles_with

Thanks,
Greg

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [Struts 2] Templating available like Tiles

Posted by Mark Menard <ma...@mjm.net>.
On 8/25/06 1:40 PM, "Garner Shawn" <sh...@gmail.com> wrote:

> Is there templating available like Tiles where I can define a template
> JSP with a header,side menu, body, and footer and then just reuse it
> accross pages?
> 
> I see there are themes and templates in the documentation but it
> usually is simple pages or bits of code generated so I'm not sure if
> this can be done with Velocity, Freemarker, etc...

You could take a look at Sitemesh. Very easy to set up. To my mind it was
much easier than Tiles, and doesn't intrude on your application environment
as much.

Mark
-- 
Mark Menard
Business: http://www.vitarara.net/
Personal: http://www.vitarara.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org