I've seen it
mentioned on this list a few times that
Page =
HttpServletRequest
Session =
HttpSession
Application =
ServletContext
so to 'pass' a bean
to a jsp from a servlet (using RequestDispatcher),
for 'page' scope
use req.setAttribute("TestPage",
pageBean);
for 'session' score
use sess.putValue("TestSession",
sessionBean);
and for application
scope use ctx.setAttribute("TestApplication",
appBean);
where req, sess and
ctx are the expected types, and pageBean, sessionBean and appBean are instances
of a bean referenced on the jsp page using the same names in the above three
lines of code.
Using this code in a
servlet - on the jsp page I 'forward' to I get the page and session bean OK, but
not the application bean, so I'm wondering if anybody else has tried this and
made it work?
I'm using JRun 2.3
BTW with IIS and I know the spec. isn't definite on where beans with different
lifetimes live, so I'm assuming this is a JRun problem, could anybody confirm
that?
Kevin
Jones
