Figured it out. The setProperty tag is ignored when inside a useBean
tag if the bean has already been instantiated.
On Jun 18, 2006, at 7:38 AM, Don Vawter wrote:
I am trying to set a property using setProperty. The method works
if the property doesn't already exist but if the property is
already defined (subsequent page hits) it fails to update the
property.
Here is the snippet:
<jsp:useBean id="navbean" class="com.sprint.ctc.gui.NavigationBean"
scope="session" >
<jsp:setProperty name="navbean" property="menuItem" value="<%=menu%
>" />
</jsp:useBean>
The current active link is:<%=menu%><br/>
<%=d%>
The current navbean is:<bean:write name="navbean" scope="session"
property="menuItem" />
The first time the page is hit "active link" and menuItem are the
same but on subsequent page hits (in the session) menuItem remains
at its initial value.
If I update the session object directly by adding the following:
<%
((NavigationBean)request.getSession(false).getAttribute
("navbean")).setMenuItem(menu);
%>
<br/>
The current navbean is:<bean:write name="navbean" scope="session"
property="menuItem" />
it is updated correctly.
Is this the designed functionality of the setProperty that it does
not update properties which are already set
or am I using it incorrectly.
---------------------------------------------------------------------
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]