how to implement singletun design patteren in struts?
Answer Posted / shaik baji
Singletun design patteren means we can't create more than
one object for that class which follws Singletun design
pattern.
We can implement it by using one "private" constructor and
one Factory mathod as like follows:
class Sample
{
public static Sample s = new Sample();
private Sample()//constructor
{
}
public static Sample getInstance()//static factory
method
{
return s;
}
}
public class SingleTun
{
public static void main(String arg[])
{
Sample s1= Sample.getInstance();
Sample s2= Sample.getInstance();
}
}
Is This Answer Correct ? | 5 Yes | 4 No |
Post New Answer View All Answers
What are the reasons for an error message not being displayed while developing struts application?
What is DynaActionForm?
Explain the complete struts validator framework.
What is the role of action class?
Explain about the validation steps which have to be carried during validation of client-side address?
What applications use apache struts?
Describe the basic steps used to create a tiles application?
What is struts.devmode?
Which design pattern is implemented by Struts2 interceptors?
Which components are available using actioncontext map?
while working struts in intellij 7.0error unable to initialize tld location cache: zip file is closed is displayed anybdy can answer me immdialy .ungert
How do I install struts?
What is http redirect?
What's the purpose of execute method of action class?
What is the purpose of @key?