You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Buntin, Seth - KATE" <Se...@coe.murraystate.edu> on 2005/12/22 15:59:27 UTC

Tiles with Struts

I am having an issue getting Tiles to work.  I am totally new to Struts
so bear with me.  The issue is I don't see anything.  I got to home.do
(which is set up as what the user will see first) and it is totally
blank and the source is totally empty.  I think I have everything in my
configuration correct but don't know what to do.  Here are my files:

 

/WEB-INF/tiles-def.xml:

 

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE tiles-definitions PUBLIC

       "-//Apache Software Foundation//DTD Tiles Configuration 1.3//EN"

       "http://struts.apache.org/dtds/tiles-config_1_3.dtd">

 

<tiles-definitions>

      <definition name="baseDef" path="/layout/layout.jsp">

            <put name="pageTitle" value="Kentucky Academy of Technology
Education" />

        <put name="header" value="/layout/header.jsp"/>

        <put name="nav" value="/layout/nav.jsp"/>

        <put name="footer" value="/layout/footer.jsp"/>

        <put name="body" value=""/>

    </definition>

    

      <definition name="homeDef" extends="baseDef">

            <put name="pageTitle" value="KATE : WORM : Home" />

        <put name="body" value="/pages/homeBody.jsp"/>

    </definition>

</tiles-definitions>

 

/layout/layout.jsp:

 

<%@ taglib uri="/tags/struts-bean" prefix="bean" %>

<%@ taglib uri="/tags/struts-html" prefix="html" %>

<%@ taglib uri="/tags/struts-logic" prefix="logic" %>

<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

      <head>

            <title><tiles:insert attribute="pageTitle"/></title>

            <link href="layout/katemain.css" rel="stylesheet"
type="text/css" /> 

      </head>

      

      <body>

      

      <!-- Begin Container -->

      <div id="container">

            

            <!-- Begin Banner Bar with Search -->

            <div id="banner">

                  <%-- include header --%>

                  <tiles:insert attribute="header"/>

                  <p class="toptext"></p>

            </div>

            <!-- End Banner Bar with Search -->

            

            <!-- Begin Left Navigation -->

            <div id="left">

                  <%-- include navigation --%>

                  <tiles:insert attribute="nav"/>

            </div>

            <!-- End Left Navigation -->

 

            <!-- Begin Middle Content -->

            <div id="center">

                  <div id="content">

                        <%-- include body --%>

                  <tiles:insert attribute="body"/>

                  </div>

            </div>

            <!-- End Middle Content -->

            

            <!-- Clear the left floats so that the footer will appear
correctly -->

            <div class="clearer"></div>

      

            <!-- End Clear the left floats so that the footer will
appear correctly -->

            

            <!-- Begin Footer -->

            <div id="footer">

                  <%-- include footer --%>

                  <tiles:insert attribute="footer"/>

            </div>

            <!-- End Footer -->

            

      </div>

      <!-- End Container -->

      

      </body>

</html>

 

I have these in my /WEB-INF/struts-config.xml file:

 

<controller
processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>

<plug-in className="org.apache.struts.tiles.TilesPlugin" >

            <set-property property="definitions-config"
value="/WEB-INF/tiles-defs.xml" />

            <set-property property="moduleAware" value="true" />

</plug-in>

 

Can someone point me in the right direction?

 

Thanks,

 

Seth Buntin

Web Resources Coordinator

Kentucky Academy of Technology Education

Murray State University

 


Re: Tiles with Struts

Posted by Greg Reddin <gr...@apache.org>.
On Dec 22, 2005, at 8:59 AM, Buntin, Seth - KATE wrote:

> I am having an issue getting Tiles to work.  I am totally new to  
> Struts
> so bear with me.  The issue is I don't see anything.  I got to home.do
> (which is set up as what the user will see first) and it is totally
> blank and the source is totally empty.  I think I have everything  
> in my
> configuration correct but don't know what to do.

Does your web.xml point to an index.jsp or something similar for a  
welcome-file?  Can you post the contents of that?  What does the  
configuration for the home.do action look like?

There are several reasons why this might happen.

Thanks,
Greg

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