Enlist different scope values for the <jsp:useBean> tag?

devquora
devquora

Posted On: Mar 22, 2020

 

The JSP useBean action tag is used to locate the bean class is the bean object is instantiated or it instantiates the bean object. It has many attributes like id, scope, class, type, and beanName. The scope attribute in the useBean action tag is used to represent the scope of the bean. The default scope is the page, but different scopes are available such as request, session, and application.

  • Page – The default scope that specifies the scope of the bean within the JSP page.
  • Request – specifies the scope of the bean to all the JSP page that processes the same request.
  • Session – specifies the scope of the bean to all the JSP page that has the same session irrespective of its request.
  • Application – specifies the scope of the bean to all the JSP pages in the same application.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    JSP Interview Questions

    Which attribute specifies a JSP page that should process any exceptions thrown but not caught in the current page?

    ErrorPage Attribute process specifies a JSP page that should process any exceptions thrown but not caught in the current page....

    JSP Interview Questions

    Explain What is JSP?

    JSP, expanded as Java Server Pages is a Java-based technology to create dynamic web pages. Released in 1999 by Sun Microsystems, JSP is based on technologies such as HTML, SOAP, XML, etc...

    JSP Interview Questions

    What is the el in JSP?

    The EL (Expression Language) in the JSP is used to access the data stored in the JavaBeans along with implicit objects like requests, sessions, etc...