Rick Smith wrote:

Normally, the controller is called only when its definition is
inserted.



A search of my JSP source code directory confirms that I do not use the
<tiles:insert> tag at all, I'm using <tiles:get>: all my tiles are defined
in my tiles-defs.xml.


The <tiles:get> tag extends the <tiles:insert> tag. The primer is for compatibility with the template mechanism. If you get or insert your login definition, its associated controller is called.
Have you tried to remove the associated controller from your login definition ? Does the controller still called ?
Where do you get or insert your login definition ?


Cedric

The attached file shows the template JSP used in the tiles .baseLayout
definition that all other definitions extend; it also includes a sample of a
'content' tile that gets substituted for each definition.

I control the navigation to the various pages by using tiles definitions as
ActionForwards.

I hope that the above is acceptable tiles practice.

Rick



------------------------------------------------------------------------


------------------------- My BaseLayout.jsp --------------------


<%--
/**
This is a page layout that provides for a header area, a navigational bar, a context menu, a content
area and a footer area.


* Does NOT open the BODY tag. * This allows header tiles to set body-tag attributes.
* Does close the BODY tag.


* Exports attributes to request so that they can be used by any sub-tile.

* Expects "app.title" to be defined in the application resources * as name of the application.
*

*/
--%>
<%@ page language="java" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/tiles" prefix="tiles" %>


<tiles:importAttribute scope="request"/>


<html:html> <tiles:get name="header" />

  <tiles:get name="banner" />
        
  <tiles:get name="navigationBar" />
        
  <table border="0" cellpadding="0" cellspacing="2" width="740" summary="Page Content">
    <tr>
      <td valign="top" width="155" ><br>
        <logic:present name="contextMenu">
           <table border="0" cellpadding="0" cellspacing="0" width="155" summary="Secondary 
Navigation">
              <tiles:get name="contextMenu" />
           </table>       
        </logic:present>
      </td>
                                
     <td valign="top" width="3"><img src="<bean:message key="images.commonURL"/>/spacer.gif" height="1" 
width="3" alt=" "></td>
     <td valign="top" bgcolor="#cdcdcd" width="1"><img src="<bean:message key="images.commonURL"/>/spacer.gif" 
height="1" width="1" alt=" "></td>
     <td valign="top" width="5"><img src=""<bean:message key="images.commonURL"/>/spacer.gif" height="1" 
width="5" alt=" "></td>

<td valign="top" width="530"><tiles:get name="content" /> </td>

     <td valign="top" width="7"><img src=""<bean:message key="images.commonURL"/>/spacer.gif" height="1" 
width="7" alt=" "></td>
     <td valign="top" bgcolor="#cdcdcd" width="1"><img src="<bean:message key="images.commonURL"/>/spacer.gif" 
height="1" width="1" alt=" "></td>
     <td valign="top" width="7"><img src=""<bean:message key="images.commonURL"/>/spacer.gif" height="1" 
width="7" alt=" "></td>
  </tr>
 </table>
        
 <tiles:get name="footer" />
 </body>

</html:html>

VVVVVVVVVVVVVVVVVV ------------------- a sample content tile ---------------- VVVVVVVVVVVVVVVVVVVV

<%--
/**
        This renders the content of the welcome text for Type1 users
*/
--%>
<%@ page language="java" import="util.Constants"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>

<table border="0" cellpadding="0" cellspacing="2" width="740" summary="Page Content">
<tr>
<td valign="top" class="contenttext">
<p>
<img src="<bean:message key="images.commonURL"/>/main_title_company.gif" width="367" height="21" border="0" alt="My System"><br>
<br>
<logic:present name="<%=Constants.USER %>">
<b>Wecolme&nbsp<bean:write name="<%=Constants.USER %>" property="firstName"/></b>,
</logic:present>
<logic:notPresent name="<%=Constants.USER %>">
<b>Welcome Type 1 user</b>,</p>
</logic:notPresent>
<p><bean:message key="welcome.type1user"/><br>
</p>
</td>
</tr>
</table>


------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to