Need to add a Java class (named HistoryBean in my project) to the ServletContext. I do not want to create new instance of the HistoryBean class in the different Servlets that I have inside my project. I want to get it from the ServletContext. Please help me with suggestions.
Need to add a Java class (named HistoryBean in my project) to the ServletContext.
Share
You can do that in a
ServletContextListener:Register your listener with
@WebListeneror with<listener>..</listener>in web.xml.