Solved

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

Posted on 2002-07-23
2
238 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
Comment Utility
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
Comment Utility
Glad I could help and Thanx for the "A".

CJ
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now