A "session" scoped bean will be instantated once for the duration of the
session. I listed a couple of reasons when a new session would be created
and thus a new instance of the bean.
You can also define a bean in a "application" scope. The ServletContext
would be used to store/retrieve the bean in this case as opposed to the
HttpSession API. This bean will persist for the duration of the context.
Justy
----- Original Message -----
> Hi!
> So which scope scope should i use so as my bean won't be intantiated
another
> time?
>
> in the jsp tutorial i found the following sentence:
> "
> The reason that the scope matters is that a jsp:useBean entry will only
> result in a new object being instantiated if there is no previous object
> with the same id and scope. Otherwise the previously existing object is
> used, and any jsp:setParameter elements or other entries between the
> jsp:useBean start and end tags will be ignored.
>
> "
> how to apply these ?
>
> Thanks
> ----- Original Message -----
> >A session is transient, and its lifetime ends when one of the following
> >occurs:
> < - a user leaves your site and the user's browser does not accept
<cookies
> > - a user quits the browser
> > - the session is timed out due to inactivity
> > - the session is completed and invalidated by the servlet
> > - the user logs out and is invalidated by the servlet
>
> Justy
>
>
>
> >Hi!
> >I use a two beans
> ><jsp:useBean id="search" class="ousranet.MetaSearch" scope="session">
> ><jsp:setProperty name="search" property="*"/>
> ></jsp:useBean>
> ><jsp:useBean id="hit" class="ousranet.Hits"/>
> >/* here i get the result and out it in hit */
> >hit=search.getHits();
> >
> >i dislpay only some of the hit class! i got a next button
> >that is supposed to show the rest and so on till it's the end!
> >the puspose is not to reinstantiaite the search bean cause it takes a lot
> of
> >time ! i thought of scope session !
> >but when i run the first page, then disconnet from the web, to make sure
> it
> >won't reinstantiate (in the construct it connect toa url), it gives me no
> >result , however when i connect, it takes as much time as in the first
> page,
> >then display results! wich means it does not use the last instatiation!
> >
> >pleaaaaaaaaaaaaase help
> >
>
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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
>
===========================================================================
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