having trouble with useBean
I am using a session bean, and then assigning it a value by referring to it by name... but when I use <%=beanName.getMyProperty()%>
I get the value I expect, and when I use <jsp:getProperty name="beanName" property="myProperty">
I get the default/empty bean value of 0.
Here is my code snippet, can anybody see anything wrong with it?
<html>
<head>
<jsp:useBean id="defineSaleBean" scope="session" class="com.ifxonline.drm.core.beans.DefineSaleBean" />
<jsp:useBean id="saleBean" scope="session" class="com.ifxonline.drm.core.beans.SaleBean" />
<jsp:useBean id="saleClientBean" scope="session" class="com.ifxonline.drm.core.beans.ClientBean" />
<jsp:useBean id="saleProductBean" scope="session" class="com.ifxonline.drm.core.beans.ProductBean" />
<%
if (null != saleBean.getSaleClientValue()){
saleClientBean = saleBean.getSaleClientValue();
}
if (null != saleBean.getSaleProductValue()){
saleProductBean = saleBean.getSaleProductValue();
}
%>
</head>
<body>
<jsp:getProperty name="defineSaleBean" property="saleClientLabel" />:
<%=saleClientBean.getClientId()%> (<jsp:getProperty name="saleClientBean" property="clientId" />)
<b><jsp:getProperty name="defineSaleBean" property="saleProductLabel" />: </b>
<%=saleProductBean.getProductId()%> (<jsp:getProperty name="saleProductBean" property="productId" />)
The first printout of the value (the value just after the ':') prints the correct value, the value inside the parenthesis prints out 0 (default empty bean)... I think they should be the same though.
I was under the impression that referring to the bean by name (as in saleClientBean = saleBean.getSaleClientValue();
) will refer to the same instance of the bean as when using a jsp tag (as in <jsp:getProperty name="saleClientBean" property="clientId" />
) and putting the bean name into the "name" value.
Am I wrong?

