Well....
The current reference implementation (sun 0.92) generates VERY different code.
Setoncreate ONLY WORKS AT CREATE.
Here's a dump:
-------------------------------------------------------------------
jb.jTelescopeUser jUser = (jb.jTelescopeUser) session.getValue("jUser");
if ( jUser == null ) {
try {
jUser = (jb.jTelescopeUser) Beans.instantiate(null,
"jb.jTelescopeUser");
} catch (Exception exc) {
throw new ServletException("Cannot create bean of class
jb.jTelescopeUser:" + exc.getMessage());
}
_jrl.introspecthelper(jUser, "dBUser", "someuser", request);
_jrl.introspecthelper(jUser, "dBPass", "somedumbpassword", request);
_jrl.introspecthelper(jUser, "dBUrl", "jdbc:odbc:SomeDatabase",
request);
_jrl.introspecthelper(jUser, "driver", "sun.jdbc.odbc.JdbcOdbcDriver",
request);
_jrl.introspecthelper(jUser, "from", "sometable", request);
session.putValue("jUser", jUser);
}
-------------------------------------------------------------------
Note the "if ( jUser == null)"
-Sigh
There is no currently reasonable way to set consistenly without scriptlets.
I will fire off a suggestion doc that (hopefully) can make it into the new JSP1.0
-jason
:)
>
>
>
> "Jason P. Bright" wrote:
> >
> > Background:
> > I am currently writing a large database application in java. I
> > really hope to use JSP, servlets, and beans. I have come accross 3 issues.
> >
> > Problems:
> > 1. The application object is not (to my knowledge) accessible to
> > the JSP-aware beans without some scriptlet kludge to get the servlet context.
> >
> > 2. The bean model does not have a method by which it can set a variable
> > every time a page is loaded without some similar scriptlet kludge. We have
> > setoncreate and setfromrequest, but no plain set. This results in my having
> > to move the "work" out of processRequest and into some scriptlet called code.
> And why can't you use setoncreate?
>
> <SETONCREATE BEANPROPERTY="item" VALUE="bla">
> translates to mybean.setItem("bla");
>
> Gabriel Wong
> http://www.ezwebtools.com
> -------------------------
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".