Can I instantiate the same JavaBean multiple times within a JSP page by associating each instance with a different scope?

Govind Seshadri

Yes, you can instantiate the same bean within a page multiple times by associating them with different scopes. Needless to say, the bean's "id" must also be unique for the specified scope. For example, you can have the following within a page:

<jsp:useBean class="foo.Bar" id="requestBar" scope="request" />

<jsp:useBean class="foo.Bar" id="sessionBar" scope="session" />
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact