you could pass it along with the tile.

  <tiles:insert attribute="billingAddress" >
        <tiles:put name="billing" beanName="..."/>
  </tiles:insert>

or re-access it from whichever scope it was put in.

Yann

-----Original Message-----
From: Roland Berger [mailto:[EMAIL PROTECTED]
Sent: Monday, September 08, 2003 8:22 AM
To: Struts
Subject: Tiles problem?


Hi all

I have JSP code which used to work with older struts versions (1.1 beta xy).
Now I use struts 1.1 stable release.

I have  two jsp pages. I want to nest JSPPage2 into JSPPage1 with
<tiles:insert> ( see JSPCode ). All I get is "[ServletException
in:/WEB-INF/pages/JSPPage2.jsp] Cannot find bean in any scope'"
With debugging I have found out that JSP Page 2 losses the parent context (I
mean the bean which is assosiated to the /RegisterAddressAction.do action in
struts-config.xml). How can I handle over the parent context to the nested
JSPPage2 tile?


Thanks for any help
Roland

JSPPage1
----------
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

<nested:form action="/RegisterAddressAction.do">
<nested:nest property="orderFB">
<table width="100%" border="0" cellspacing="1">
  <tr>
    <td class="subtitle"><bean:message
key="jsp.registerAddress.title"/></td>
    <td class="subtitle" width="20%"><html:image
property="method_continueShopping"
src="images/16x16/normal/Purchases-txweitereinkaufen.gif"
titleKey="common.tooltip.continueShopping"
align="absbottom"></html:image></td>
  </tr>
</table>
<p><bean:message key="jsp.registerAddress.text1"/></p>
  <span class="kleineSchrift"><bean:message
key="common.label.mustFields"/></span></p>
    <p>
      <nested:checkbox property="billingEqualShippingAddress" value="true"
/><bean:message key="jsp.registerAddress.text2"/>
    </p>
  </nested:nest>

***
  <tiles:insert attribute="billingAddress" />
***

  <table width="100%" border="0" cellspacing="1">
  <tr>
    <td width="30%">&nbsp;</td>
    <td width="2%">&nbsp;</td>
    <td><html:image property="method_submitAddresses"
src="images/16x16/normal/Forward-2-txweiter.gif"
titleKey="common.tooltip.next" align="absbottom"></html:image></td>
  </tr>
  </table>
  </nested:form>
---------------- end JSPPage1


JSPPage2 (is referenced by   <tiles:insert attribute="billingAddress" />
)--------
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>

 <nested:nest property="orderFB">
 <nested:nest property="orderBean">
  <table width="100%" border="0" cellspacing="1">
  <tr>
    <td colspan="3" class="menu"><bean:message
key="jsp.registerAddress.billingAddressSection.title"/></td>
  </tr>
  <tr>
    <td width="30%"><bean:message key="common.label.company"/></td>
    <td width="2%">&nbsp;</td>
    <td>
      <nested:text property="invoiceCompany" size="50" maxlength="50"/>
    </td>
  </tr>
  </table>
  </nested:nest>
  </nested:nest>
-------------------end JSPPage2


---------------------------------------------------------------------
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