title: Using Spring Webflow + Tiles: How to specify which tiles definition to use at runtime?
body: <p>I have a web application running with Spring Webflow, Tiles and JSP.</p>
  
  <p>Currently all pages are extending my "defaultLayout" definition (which has a banner, menu structure, footer, etc.).</p>
  
  <p>In tiles definition file:</p>
  
  <pre><code>&lt;definition name="defaultLayout" template="/WEB-INF/tiles/defaultLayout.jsp"/&gt;
  
  &lt;definition name="_**.view.jsp" extends="defaultLayout"&gt;
      &lt;put-attribute name="content" value="{1}.view.jsp"/&gt;
  &lt;/definition&gt;
  </code></pre>
  
  <p>A new requirement is to have an "embedded" view (without footer/menu/etc.). I created an embedded view definition:</p>
  
  <pre><code>&lt;definition name="embeddedLayout" template="/WEB-INF/tiles/embeddedLayout.jsp"/&gt;
  &lt;definition name="_**.embedded.view.jsp" extends="embeddedLayout"&gt;
      &lt;put-attribute name="content" value="{1}.view.jsp"/&gt;
  &lt;/definition&gt;        
  </code></pre>
  
  <p>I have JSP files that specify the main content of a page (all named: pageName.view.jsp).</p>
  
  <p>Now what I need is some way to let tiles render pageName.embedded.view.jsp (which will use embeddedLayout) instead of pageName.view.jsp based on a certain requirement (haven't figured out that yet probably a request parameter passed in or something to that effect).</p>
  
  <p>I am not too familiar with the inner workings of tiles What class can I override to change pageName.view.jsp to rather be pageName.embedded.view.jsp?</p>
  
  <p>Here are my relevant Spring configuration:</p>
  
  <pre><code>&lt;bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer"&gt;
      &lt;property name="definitions"&gt;
          &lt;list&gt;
              &lt;value&gt;/WEB-INF/tiles/tiles-defs.xml&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;bean id="webflowViewFactoryCreator" class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator"&gt;
      &lt;property name="viewResolvers"&gt;
          &lt;bean class="org.springframework.js.ajax.AjaxUrlBasedViewResolver"&gt;
              &lt;property name="viewClass" value="org.springframework.webflow.mvc.view.FlowAjaxTilesView"/&gt;
              &lt;property name="prefix" value="_"/&gt;
          &lt;/bean&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Any help will be appreciated.</p>
  
  <p>Tiles version: 2.2.1
  Spring version: 3.0.3
  Webflow version: 2.1.1</p>