Spring MVC's Frameworkservlet source analysis

Source: Internet
Author: User

Frameworkservlet is a subclass of Httpservletbean, which implements the Initservletbean method of Httpservletbean.

Through Initservletbean () for Webapplicationcontext initialization, the source code is:

1     /**2 * Overridden method of {@linkHttpservletbean}, invoked after any bean properties3 * have been set. Creates this servlet ' s webapplicationcontext.4      */5 @Override6     protected Final voidInitservletbean ()throwsservletexception {7Getservletcontext (). log ("Initializing Spring frameworkservlet" + getservletname () + "'");8         if( This. logger.isinfoenabled ()) {9              This. Logger.info ("Frameworkservlet" + getservletname () + "': Initialization Started");Ten         } One         LongStartTime =System.currenttimemillis (); A  -         Try { -              This. Webapplicationcontext =Initwebapplicationcontext (); the Initframeworkservlet (); -         } -         Catch(Servletexception ex) { -              This. Logger.error ("Context initialization Failed", ex); +             Throwex; -         } +         Catch(RuntimeException ex) { A              This. Logger.error ("Context initialization Failed", ex); at             Throwex; -         } -  -         if( This. logger.isinfoenabled ()) { -             LongElapsedTime = System.currenttimemillis ()-StartTime; -              This. Logger.info ("Frameworkservlet" + getservletname () + "': Initialization completed in" + inElapsedTime + "MS"); -         } to}

Its main function is to call the Initwebapplicationcontext method to initialize a webapplicationcontext.

The following is the source code of Initwebapplicationcontext:

Spring MVC's Frameworkservlet source analysis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.