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