Solved

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

Posted on 2002-07-23
2
248 Views
Last Modified: 2010-04-01
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
Comment
Question by:keithedward
  • 2
2 Comments
 
LVL 19

Accepted Solution

by:
cheekycj earned 50 total points
ID: 7174400
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
 
LVL 19

Expert Comment

by:cheekycj
ID: 7175005
Glad I could help and Thanx for the "A".

CJ
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jersey maven project error 7 145
spring AOP 6 91
Is possible to make a jsp script work with oracle wallet? 7 106
equalIsNot  challenge 43 178
Facebook has became the #1 social media platform. People share many funny videos there, yet you don't know how to download them? Now you can download Videos from Facebook in just 3 simple steps.
This article discusses how to implement server side field validation and display customized error messages to the client.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question