jhteo wrote:

> I'm currently doing a project that require a bean that created in new
> session, and this bean need to be accessed using both servlets &
> jsp.For example:<jsp:useBean id="abc" scope="session" class="Testing"
> />This statement make an object of "abc" available for my jsp pages
> within the same session. But i also want to use this "abc" in my
> servlets. How can it be done? jhteo.

Session-scoped beans are perfectly accessible in a servlet, using the
following code:

    HttpSession session = request.getSession(true);
    Testing myBean = (Testing) session.getValue("abc");

Craig McClanahan

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to