Hi I am having issue of set property tag not working properly. I have a jsp which I am including in webcenter as portlet.
<jsp:useBean id="pathEditor" class="backing.bean.AppletBean" scope="page"/>
<jsp:getProperty name="pathEditor" property="username" />
${pageContext.request.remoteUser}
<jsp:setProperty name="pathEditor" property="username" value="${pageContext.request.remoteUser}"/>
<jsp:getProperty name="pathEditor" property="username" />
I am doing login from two different browsers from same m/c. user name value in first comes correct, while the second login prints ${pageContext.request.remoteUser}
correct but <jsp:getProperty name="pathEditor" property="username" />
prints the previous logged in user.It gives impression that setProperty is not getting called at all .can any body suggest what might be wrong here. I am using two different browsers and no static variable.I keep both browser open for this test case. can it be becos of the way portlets are handled in webcenter. if I am declaing scope of bean as page, is it not correct way for thread safety. what I can do to make it thread safe? I have made bean property variables volatile but that does not does any good. or is it possible that I destroy the bean after use? How can I destroy the bean?
so if I include this - <%@page isThreadSafe="false" %> in jsp, that should work. but it is also not working.
Edit# After debugging code I saw this unusual behaviour. I put System.out.println in my bean for seeing what value coming from jsp. though ${pageContext.request.remoteUser} prints new value - jsp:setProperty name="pathEditor" property="username" value="${pageContext.request.remoteUser}"/> passes old value to my bean setter method. this I am not able to understand. Please help.