This is probably JRun-specific so if you're not interested in JRun you don't
need to read any further.

I have a need to reference 2 beans within the same JSP.

With the 0.92 reference implementation I was able to code

<USEBEAN name = "queryAA" type =
"dreba.prj.servlet_utils.JBPresentAISApplication" lifespan = page>
</USEBEAN>
<USEBEAN name = "AISRB" type = "dreba.prj.servlet_utils.PresentAISRBAA"
lifespan = page>
</USEBEAN>

<! Untervening HTML skipped>

<TABLE BORDER="1">
<!Rows 15 to 18 contain dummy data so just loop over them>
<LOOP PROPERTY=AISRB:TABLE_APP_R15to18 PROPERTYELEMENT=ix>
<TR>
            <TD WIDTH=156><B><FONT SIZE=2 FACE="Arial">
            <DISPLAY PROPERTY=ix PLACEHOLDER="Desc rows 15-18">
                        </FONT></B></TD>
                        <TD WIDTH=57><CENTER><B><FONT SIZE=2 FACE="Arial">
                        <DISPLAY PROPERTY=queryAA:X PLACEHOLDER="X">
                        </FONT></B></CENTER></TD>
                        <TD WIDTH=50><CENTER><B><FONT SIZE=2 FACE="Arial">
                        <DISPLAY PROPERTY=queryAA:X PLACEHOLDER="X">
                        </FONT></B></CENTER></TD>
                        </TR>
     </LOOP>
</TABLE>

where the AISRB bean property indexed as ix is a String array, and the X
property is a String (yes, I know it's a silly name but the information to
be placed here hasn't been decided yet - for the moment I always return the
string "X").

WIth the reference implementation this behaves as expected.

However, with JRun 2.3 I was unable to compile the page because of  errors
like:
line 410: [] can only be applied to arrays. It can't be applied to
dreba.prj.servlet_utils.JBPresentAISApplication.

                String res = JSP.beanVal(queryAA[jsp_array_idx0],"X", new
String(jsp_default0));
                                                    ^
Looking into the generated source code, I see the lines

Object[] x = JSP.getIndexedProps(AISRB,"TABLE_APP_R15to18");
for (int jsp_array_idx0=0;jsp_array_idx0<x.length;jsp_array_idx0++) {
out.println("");
out.println("<TR>");
out.println("       <TD WIDTH=156><B><FONT SIZE=2 FACE=\"Arial\">");
out.print("         ");


{
byte[] jsp_default0 = {68,101,115,99,32,114,111,119,115,32,49,53,45,49,56};
String res = JSP.beanVal(x[jsp_array_idx0],"", new String(jsp_default0));
out.print(res);
}

out.println("");
out.println("                   </FONT></B></TD>");
out.println("                   <TD WIDTH=57><CENTER><B><FONT SIZE=2
FACE=\"Arial\">");
out.print("                     ");


{
byte[] jsp_default0 = {87,97,115,32,88};
String res = JSP.beanVal(queryAA[jsp_array_idx0],"X", new
String(jsp_default0));
out.print(res);
}

What I do not understand is why JRun is treating the queryAA bean property
as an array - the loop refers to the AISRB bean not the queryAA bean.

Is there something I'm missing here?  I assume it's legal to loop over a
property in one bean while referring to properties in other beans.  If this
is  correct, is there a problem in JRun?

Sorry for the excessive length of the message.

Regards
Tom O'Hare                      ([EMAIL PROTECTED])
"I'm living so far beyond my income that we may almost be said to be living
apart:"  - e e cummings

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to