Did you put the <jsp:useBean id="MyBean" class="MyClass" scope="session"/>
in page 2 also?  If not, you need to.  Remember, <jsp:useBean> only creates
a new bean if one doesn't already exist, but it always gives the page access
to the bean.
    (*Chris*)

----- Original Message -----
From: "Hamid Mukhtar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 09, 2001 11:13 AM
Subject: [JSP-INTEREST] Session scope


> Hi JSP developers,
>         I've got a question:
>         Suppose, I want to use a bean for session scope.So I write in page
1:
> <jsp:useBean id="MyBean" class="MyClass" scope="session"/>
> <jsp:setProperty name="MyBean" property="someProperty" value="SomeValue"/>
>
> Then I can click on a link on page1 which refers to page 2, where I use:
> <jsp:getProperty name="MyBean" property="someProperty"/>
>
> However the bean is not recognised there, and generates error.
>         Is this approach correct for using a bean for session or there is
some
> error. Please help me(or provide some reference/url).
> Thanks,
> Hamid Mukhtar
>
>
===========================================================================
> 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://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


_________________________________________________________
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://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to