is it possible to create single instance of java class per
session in web application
Answer Posted / ananth
by using Singleton pattern we can achieve one instance per
class.
Public final class Singleton{
private static Singleton singleton;
public static Singleton getInstance()
{
if(singleton ==null)
{
singleton=new Singleton();
}
retuen singleton;
}
public void getvalue()
{
}
}
| Is This Answer Correct ? | 7 Yes | 6 No |
Post New Answer View All Answers
What is java listener?
How do I become a java developer?
What is event handling in java?
Is advanced java and j2ee same?
Is java safe to download?
Why is java more secure?
What are the main components of multi-tier architecture?
What will happen when you compile and run the following code?
What is distributed application?
What is the difference between load() and get()?
What is actionerrors?
What are struts?
What is j2ee api?
What is java api for xml registries (jaxr)?
for example we are login into the irctc server from there it will go to the selected bank and deduct amount and come back to the irctc. so if we are developing this in java means will it be run on the same session. but as per my knowledge bank is separate and irctc is separate URL's so it will use two different sessions then how it is maintaining same session through out application and even it uses the payment gateway? how it is working can any one help me on that??