Describe how to implement singleton design pattern in struts.- A singleton design pattern implementation is done using action class in struts framework.
- It performs as a front controller and every request goes through it.
- Also, the logging mechanism is easier.
- This can be achieved without authoring Log4j class over and over in each and every servlet.
- The singleton pattern restricts the instantiation of a class and ensures that only one instance of a class exists the java virtual machine.
- It provides global access point to the instance of the class.
- It is used for logging, driver objects, caching and thread pool.