Hi all,
I am getting a wierd behaviour from application beans: they seem to remain
different for pages within my application.
I have a very simple application, in which I need application beans. I have
two pages that go like this:
page1.jsp
<jsp:useBean id="gums" scope="application" class="gov.bnl.gums.GUMS" />
<% gums.doSomething(); %>
----
page2.jsp
<jsp:useBean id="gums" scope="application" class="gov.bnl.gums.GUMS" />
<% gums.doSomethingElse();%>
I would expect the pages to share the object, but they appear to create one
object per page, and then keep it throught the life of the app. I logged the
stack trace, to be sure I wasn't creating them somehow:
DEBUG http-8080-Processor23 gov.bnl.gums.GUMS - GUMS init at
:java.lang.Exception
at gov.bnl.gums.GUMS.initConfiguration(GUMS.java:82)
at gov.bnl.gums.GUMS.<init>(GUMS.java:29)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:12
12)
at org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
....
DEBUG http-8080-Processor24 gov.bnl.gums.GUMS - GUMS init at
:java.lang.Exception
at gov.bnl.gums.GUMS.initConfiguration(GUMS.java:82)
at gov.bnl.gums.GUMS.<init>(GUMS.java:29)
at
org.apache.jsp.updateMembers_jsp._jspService(updateMembers_jsp.java:57)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
...
They both come from jasper... am I missing something?
Thanks,
Gabriele
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]