Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Why are frameworks used?

995


What are the core classes of the struts framework?

934


How do struts work?

931


What’s the utilization of struts.xml configuration file?

931


Can you explain value stack?

914


Difference between html tags and struts specific html tags

896


How you will display validation fail errors on jsp page?

932


Which interceptor is responsible for mapping request parameters to action class Java Bean properties?

1058


What is used to display the intermediate result in an interceptor?

948


Can we have more than one struts-config.xml file for a single struts application?

925


Explain how to work with error tags?

1002


What is apache struts vulnerability?

923


At the point, you should go for struts framework?

926


What is the purpose of @results?

998


What is actionservlet?

995