Loading
Servlet Init

Java Quick Notes

Refresh Your Java - Before Java Interview

We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....


Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet

Go to SiteMap

Q)  How many times init () will be called ?


Ans)

init() method will be invoked only once in Servlet Life Cycle by Servlet Container, this could be overriden by you.
In most of the cases if you do one-time tasks such as  loading the applications properties or reading Configurations  could be done in

This method. Please see below for more details.

           public void init(ServletConfig config) throws ServletException {
                super.init(config);
              
                try {
                    String log4jPropFileName = null;
                     String legacyServiceConfig = getInitParameter(LEGACY_CONFIG);
                    log4jPropFileName = legacyProp.getProperty(LOGGING_PROPERTIES);
                    if (log4jPropFileName != null) {
                        URL url = Logger.class.getClassLoader().getResource(log4jPropFileName);
                    }
            }



Back to top

------------------------- We hope you got necessary Info On -----------------------------------------

Servlet Init


Servlet Init

-------------------------------------------------------------------------------------------------------



Face Book
Request for a Mock Interview/Training

Get a PDF

Face Book
Same look (Read) on any device, this is Ads free