Archive for the 'JSP' Category

JSP useBean and Scope Types

Kushal Paudyal September 8th, 2010

The beans can be declared in JSP as following:

<jsp:useBean id=”name” class=”mypackage.MyClass” scope=”request”/>

Scope parameter indicates the context in which the bean should be made available. There are four different possible kinds of useBean scope, “page” scope being the default one.

“page”
Availability: The bean is only available on the current page
Storage: The bean is stored in the PageContext of the current page

“request”
Availability: The bean is only available for the current client request
Storage: The bean is stored in the ServletRequest object

“session”
Availability:The object is available to all pages during the life of the current HttpSession.
Storage: The bean is stored in HttpSession object

“application”
Availability: The bean available to all pages that share the same context.
Storage: The bean is stored in ServletContext object

Related Java Blog Posts




    Your Ad Here


    Sanjaal.com is owned and maintained by Sanjaal Corps, Nepal. The company offers Webhosting and Domain Registration Services, IT Solutions and Business Analysis. Sanjaal.com website features H1B Visa Information, Entertainment Portal, Link Directory Service, Free Articles, Free Open Source Tutorials on Java and J2EE Platform, Digital Photography, High Resolution Picture Gallery and Free Reliable Image Hosting Services. Future plan includes Open Source Software Development Portal, Technical Solutions and Customizable Movie and Music Arena. We would be introducing data backup, data recovery, data hosting and voip solutions. Stay free from phishing – our website does not ask for your credit card and banking information. Happy Surfing!

    Blog Widget by LinkWithin

    Originally posted 2008-08-10 18:52:20.

    • Share/Bookmark