Well, the tile which is referenced with the attribute "billingAddress" is
found. The problem starts latter. Again the hole story  in short:

- The code is working with sturts 1.1 beta xy? Sorry I can not find out
which beta it was. Now I use 1.1 final.

- My tiles definitions are in a seprate file --> tiles-defs.xml
- I hava a master layout jsp page where usually only the body part is
changing.
- One of the body tiles is called: let's say 'tile1' referencing a jsp page:
let's say page1
- I have another tile (tile2) referencing page2 which is inserted in tile1

The structure of the pages is as follows (Comments start with ***):

page1 (tile1):

<html:form action="/RegisterAddressAction.do">
*** RegisterAddressAction.do works with an actionformbean ( lets call it
AFB1 which isdefined in struts-config.xml) which has a getter to get orderFB
<nested:nest property="orderFB">
      <nested:text property="billingEqualShippingAddress" />
</nested:nest>
*** --> Cedric told me I can not use tiles in a nested context. --> so I
close the nested context before <tiles:insert>
<tiles:insert  attribute="tile2"/>
</html:form>

page2 (tile2):

*** because the information I want to display is in
AFB1-->orderFB-->orderBean I start to nest again in tile2

 <nested:nest property="orderFB">
 <nested:nest property="orderBean">

*** here the problem starts. the property invoiceCompany can not be
displayed because it seems that the AFB1, orderFB or orderBean are not found
in any scope. The error which is displayed here is: "[ServletException
in:/WEB-INF/pages/JSPPage2.jsp] Cannot find bean in any scope'"

      <nested:text property="invoiceCompany" size="50" maxlength="50"/>
  </nested:nest>
  </nested:nest>


Again, this code is working with beta versions of struts 1.1.

Any hints?

Thank you
Roland



-----Ursprüngliche Nachricht-----
Von: Yann Lebreton [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 9. September 2003 19:22
An: Struts Users Mailing List
Betreff: RE: Tiles problem?


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]



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

Reply via email to