>> Can JSP and Servlet share same Session and Beans?
>> Example: I used Beans and Session with my servlet, JSP can use same Beans
>> and Session or not?
>
>This can be done, but you are likely to run into problems with
>class loaders. For instance, we have Apache/JServ which uses the
>AdaptiveClassLoader along with GNU-JSP which has a different class
>loader. If you just casually allocate objects in a servlet and
>then pick them up in JSP pages, you'll most likely get the
>dreaded ClassCastException, which signals the VM's pleasure when
>you try to cast a class that was brought in by a different class
>loader.
Some of these problems might be fixed in GNUJSP 0.98, which will load
classes through the same classloader that loaded it (which typically will
load your servlets as well). I haven't tried Apache, but it solved the
problem in WebLogic.
>Note that there are sometimes problems even within JSP, as GNU-JSP
>drops the class loader every time you recompile a page, so if
>you allocated a class instance using one version of the page, then
>recompiled and tried to fish that instance back again, you would
>either (1) not find it or (2) get the ClassCastException (but
>see para #1 above).
I'm not sure, but I think this should also work now, at least if Apache
hangs on to that ClassLoader.
-Ben
===========================================================================
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".