• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 252
  • Last Modified:

Does jsp bean (non-ejb) result seperate instance?

Hello,

If I have a jsp bean (non-ejb) that is called by a jsp, will the values that I set in the bean be available to all jsp's... or does a call to a jsp result in a seperate instance of the bean particular to the called jsp instance?

In other words, say I had a bean in which I set the oracle connection. Would each jsp call the bean and be able to set it's own unique connection or would each call to the bean overwrite the other beans connection value?

THanks,
Keith
0
keithedward
Asked:
keithedward
  • 2
1 Solution
 
cheekycjCommented:
It depends on the scope of the bean.

If you use the "session" scope the bean will be available to other JSP for that particular user.  

If you use "page" it is available to that JSP only (page is the default).  

If you use "request" then it is available to that JSP and any JSPs it includes/forwards to.

If you use "application" scope then it is available to all JSPs for all users.

Also keep in mind if you have multiple servers than session and application are specific to that server/jvm unless you architect it otherwise.

CJ

0
 
cheekycjCommented:
Glad I could help and Thanx for the "A".

CJ
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now