You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Alex Colic <al...@pop-ware.com> on 2001/08/07 20:50:01 UTC
I think I found a bug in Struts?
Hi,
It took a while but I think I found why the lists I put in application scope
were not being refreshed.
When my app starts I put a couple of lists into the servletcontext so that
all my pages can access them. If the lists change I update the lists and
then I expect the next time the user access the page that the lists would
reflect the changes. I did a quick test and I found that my class was
updating the list and putting them into the session.
That portion briefly is:
protected ServletContext context;
context.setAttribute("COMMON_PROBLEM_LIST",tbeList );
On my page I have the following:
<logic:present name="CommonProblemList" scope="application">
<html:select property="wrTitle">
<bean:define id="list" name="CommonProblemList"
scope="application" property="list" />
<html:options collection="list" property="name"/>
</html:select>
</logic:present>
I stepped through the logic:present tag and found that while it looks for
the bean it goes into the RequestUtils class. It enters the lookup method
and scan through the scope value. It is finding that scope does equal
application but the bean it is returning is the old one with the old data. I
would step through the pageContext class but because it is abstract I am
trying to find the concrete implementation of it.
bean = pageContext.getAttribute(name, PageContext.APPLICATION_SCOPE);
Any help in resolving this is highly appreciated.
Alex
Re: I think I found a bug in Struts?
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Tue, 7 Aug 2001, Alex Colic wrote:
> Hi,
>
> It took a while but I think I found why the lists I put in application scope
> were not being refreshed.
>
> When my app starts I put a couple of lists into the servletcontext so that
> all my pages can access them. If the lists change I update the lists and
> then I expect the next time the user access the page that the lists would
> reflect the changes. I did a quick test and I found that my class was
> updating the list and putting them into the session.
Where are they really? In the session or in application scope?
>
> That portion briefly is:
> protected ServletContext context;
> context.setAttribute("COMMON_PROBLEM_LIST",tbeList );
>
> On my page I have the following:
>
> <logic:present name="CommonProblemList" scope="application">
> <html:select property="wrTitle">
> <bean:define id="list" name="CommonProblemList"
> scope="application" property="list" />
> <html:options collection="list" property="name"/>
> </html:select>
> </logic:present>
>
> I stepped through the logic:present tag and found that while it looks for
> the bean it goes into the RequestUtils class. It enters the lookup method
> and scan through the scope value. It is finding that scope does equal
> application but the bean it is returning is the old one with the old data. I
> would step through the pageContext class but because it is abstract I am
> trying to find the concrete implementation of it.
>
> bean = pageContext.getAttribute(name, PageContext.APPLICATION_SCOPE);
>
> Any help in resolving this is highly appreciated.
>
The concrete implementation of PageContext (and every other interface and
abstract class in the Servlet and JSP APIs) is inside your servlet
container.
> Alex
>
>
Craig