Bean bean = (Bean)pageContext.findAttribute("myBean");

finds the attribute in the closest scope, or to get the one specifically in
the session scope

Bean bean =
(Bean)pageContext.getAttribute("myBean",PageContext.SESSION_SCOPE);

or

Bean bean =
(Bean)((HttpServletRequest)pageContext.getRequest()).getSession().getAttribu
te("myBean");

(*Chris*)

----- Original Message -----
From: "Antony Stace" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 07, 2002 1:46 AM
Subject: [JSP-INTEREST] How can I access a Bean from inside a Taglib


> Hi Folks
>
> Can someone kindly tell me how I can access a session bean from inside a
Taglib.
>
> Cheers
>
> Tony
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to