From 9f68f0446c50b6fb92fc2463cf3d6403c2346240 Mon Sep 17 00:00:00 2001 From: Antonio Petrelli Date: Sat, 21 Jul 2007 10:41:12 +0000 Subject: [PATCH] WW-1724 Merge from trunk to STRUTS_2_0_X branch. Added code to Struts 2 showcase to show that the content type is present even with a FreeMarker result, i.e. with a FreeMarker layout page. git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@558289 13f79535-47bb-0310-9956-ffa450edef68 --- apps/showcase/src/main/resources/struts-tiles.xml | 4 ++++ apps/showcase/src/main/webapp/WEB-INF/tiles.xml | 6 ++++++ apps/showcase/src/main/webapp/WEB-INF/web.xml | 6 ++++++ apps/showcase/src/main/webapp/tiles/body.jsp | 3 +++ apps/showcase/src/main/webapp/tiles/layout.ftl | 12 ++++++++++++ apps/showcase/src/main/webapp/tiles/layout.jsp | 2 ++ 6 files changed, 33 insertions(+) create mode 100644 apps/showcase/src/main/webapp/tiles/layout.ftl diff --git a/apps/showcase/src/main/resources/struts-tiles.xml b/apps/showcase/src/main/resources/struts-tiles.xml index 178f9ed68..e49a5faad 100644 --- a/apps/showcase/src/main/resources/struts-tiles.xml +++ b/apps/showcase/src/main/resources/struts-tiles.xml @@ -17,6 +17,10 @@ showcase.freemarker + + showcase.freemarkerLayout + + /tiles/layout.jsp /tiles/layout.jsp diff --git a/apps/showcase/src/main/webapp/WEB-INF/tiles.xml b/apps/showcase/src/main/webapp/WEB-INF/tiles.xml index 7d637db19..38664fed0 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/tiles.xml +++ b/apps/showcase/src/main/webapp/WEB-INF/tiles.xml @@ -39,4 +39,10 @@ + + + + + + diff --git a/apps/showcase/src/main/webapp/WEB-INF/web.xml b/apps/showcase/src/main/webapp/WEB-INF/web.xml index b0523b333..e33323bb4 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/web.xml +++ b/apps/showcase/src/main/webapp/WEB-INF/web.xml @@ -80,6 +80,12 @@ javax.faces.webapp.FacesServlet 1 + + JspSupportServlet + org.apache.struts2.views.JspSupportServlet + 1 + + diff --git a/apps/showcase/src/main/webapp/tiles/body.jsp b/apps/showcase/src/main/webapp/tiles/body.jsp index 11057226c..da89efdbf 100644 --- a/apps/showcase/src/main/webapp/tiles/body.jsp +++ b/apps/showcase/src/main/webapp/tiles/body.jsp @@ -10,6 +10,9 @@
  • View FreeMarker Example
  • +
  • + View Example with a FreeMarker Layout +
  • \ No newline at end of file diff --git a/apps/showcase/src/main/webapp/tiles/layout.ftl b/apps/showcase/src/main/webapp/tiles/layout.ftl new file mode 100644 index 000000000..010d56012 --- /dev/null +++ b/apps/showcase/src/main/webapp/tiles/layout.ftl @@ -0,0 +1,12 @@ +<#assign tiles=JspTaglibs["http://tiles.apache.org/tags-tiles"]> +<@tiles.importAttribute name="title" scope="request"/> + + <@tiles.getAsString name="title"/> + + <@tiles.insertAttribute name="header"/> +

    + <@tiles.insertAttribute name="body"/> +

    +

    Notice that this is a layout made in FreeMarker

    + + diff --git a/apps/showcase/src/main/webapp/tiles/layout.jsp b/apps/showcase/src/main/webapp/tiles/layout.jsp index c3724018a..9caca1183 100644 --- a/apps/showcase/src/main/webapp/tiles/layout.jsp +++ b/apps/showcase/src/main/webapp/tiles/layout.jsp @@ -11,5 +11,7 @@

    + +

    Notice that this is a layout made in JSP