title: How to determine which Tile definition a JSP page uses?
body: <p>I'm pretty new to Java, and just encountered a strange problem.  Previously, everything was working fine and I don't know what I did to screw it up (I know, everyone says that).  What's happening is that I am working on a web app that uses Apache Struts (1.x) and Tiles, and when I go to a page in the web browser, it seems to be using a different Tile definition than it used to.</p>
  
  <p>Here's the relevant lines from tiles-config.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;!DOCTYPE tiles-definitions PUBLIC
         "-//Apache Software Foundation//DTD Tiles Configuration//EN"
         "http://supplies.ur.com/dtds/tiles-config_1_1.dtd"&gt;
  
  &lt;tiles-definitions&gt;
    &lt;definition name=".default" path="/template_new.jsp"&gt;
      &lt;put name="title" value="[Company Web App Name]" direct="true"/&gt;
      &lt;put name="customerInfo" value="/customerInfo.jsp" direct="false"/&gt;
      &lt;put name="smallBody" value="" direct="true"/&gt;
      &lt;put name="menu" value="" direct="true"/&gt;
      &lt;put name="quickMenu" value="/quickMenu.jsp" direct="false"/&gt;
      &lt;put name="adminMenu" value="/adminMenu.jsp" direct="false"/&gt;
      &lt;put name="message" value="/message.jsp" direct="false"/&gt;
      &lt;put name="body" value="" direct="true"/&gt;
      &lt;put name="helpAvailable" value="yes" direct="false"/&gt;
      &lt;put name="feedbackAvailable" value="yes" direct="false"/&gt;
      &lt;put name="problemReportingAvailable" value="yes" direct="false"/&gt;
      &lt;put name="newFeaturesAvailable" value="yes" direct="false"/&gt;
    &lt;/definition&gt;
    &lt;definition name=".empty" path="/blank.jsp"&gt;
      &lt;put name="title" value="[Company Web App Name]" direct="true"/&gt;
      &lt;put name="customerInfo" value="/customerInfo.jsp" direct="false"/&gt;
      &lt;put name="quickMenu" value="/quickMenu.jsp" direct="false"/&gt;
      &lt;put name="message" value="/message.jsp" direct="false"/&gt;
      &lt;put name="body" value="" direct="true"/&gt;
      &lt;put name="footer" value="/footer2.jsp" direct="false"/&gt;
      &lt;put name="helpAvailable" value="yes" direct="false"/&gt;
      &lt;put name="feedbackAvailable" value="yes" direct="false"/&gt;
      &lt;put name="problemReportingAvailable" value="yes" direct="false"/&gt;
      &lt;put name="newFeaturesAvailable" value="yes" direct="false"/&gt;
    &lt;/definition&gt;
    &lt;!-- Forgot to include the .rentalHistoryByType definition... --&gt;
    &lt;definition name=".rentalHistoryByType" extends=".default"&gt;
      &lt;put name="title" value="Equipment Rental History By Type" direct="true"/&gt;
      &lt;put name="smallBody" value="/rentalHistoryByType_Search.jsp" direct="false"/&gt;
      &lt;put name="body" value="/rentalHistoryByType.jsp" direct="false"/&gt;
    &lt;/definition&gt;
    &lt;!-- Added for CoolBeans --&gt;
    &lt;definition name=".customerChoose" extends=".default"&gt;
      &lt;put name="title" value="Choose a customer" direct="true"/&gt;
      &lt;put name="quickMenu" value="" direct="true"/&gt;
      &lt;put name="smallBody" value="/customerChoose_Search.jsp" direct="false"/&gt;
      &lt;put name="body" value="/customerChoose.jsp" direct="false"/&gt;
    &lt;/definition&gt;
  &lt;/tiles-definitions&gt;
  </code></pre>
  
  <p>Here's the relevant lines from struts-config.xml:</p>
  
  <pre><code>&lt;action path="/rentalHistoryByType" type="com.[company name deleted].etrieveit.actions.RentalHistoryByTypeAction"&gt;
    &lt;forward name="customerNotSelected" path="/customerChoose.do" /&gt;
    &lt;forward name="success" path=".rentalHistoryByType" /&gt;
  &lt;/action&gt;
  &lt;!-- Added for CoolBeans --&gt;
  &lt;action path="/customerChoose" type="com.[company name deleted].etrieveit.actions.CustomerChooseAction"&gt;
    &lt;forward name="success" path=".customerChoose" /&gt;
  &lt;/action&gt;
  </code></pre>
  
  <p>The page I'm going to in the browser is "[path]/rentalHistoryByType.do", the body of which is built with rentalHistoryByType_Search.jsp and rentalHistoryByType.jsp.  The way I found the problem is that jQuery suddenly stopped working on the page when it had been working fine before.  On viewing source, I found that rentalHistoryByType.do is being built from blank.jsp, not template_new.jsp.  (template_new.jsp has the script includes for jQuery, whereas blank.jsp does not, and other details in the page source match blank.jsp exactly as well.)</p>
  
  <p>My question is, how can I tell which Tile definition a page is going to use when it gets requested and how can I change it?  And/or, what might cause a page to use a different Tile definition than it was apparently using before?</p>
  
  <p>Sorry if my terminology is wrong or confusing, I'm new enough to Java that I don't really know what I'm doing yet...</p>