The process of initializing the SSH project on the server

Source: Internet
Author: User

Just contact the SSH project, only know that according to the demo write, there are problems on Baidu, resolved on the complacent, now try to do some summary, to upgrade their own.

How does a simple SSH project deploy (deploy) on the server and how does the server load the instantiated project code?

After Tomcat is released, Tomcat will load the project into the WebApps directory, run, and look closely at the logs found on the console, Tomcat checks the jar package and then loads Web. Xml.

The default load order is <context-param>---<listener>---<filter>---<servlet> The Tomcat container creates a ServletContext (context). This context is shared by all parts of the Web project. The container first converts <context-param> to Key-value, hands over to ServletContext, and then creates an <listener> instance.

There will be an initialization method in the listener, get the Context-param in the ServletContext, in SSH, The Contextloaderlistener listener loads the Contextconfiglocation value (that is, the path to the Application.xml), and then Tomat loads the spring configuration file, initializing the bean in the configuration file Instances

The general project will host hibernate with spring, so that when the beans is initialized, The container will be home loaded Hibernate.cfg.xml, read the above configuration information, generally with the database connection, connection pool management, mapping file information and hibernate their own configuration related information. This way, when the app is published, the user requests can interact with the database.

Finally, the filter is loaded, such as Struts2 's filters, and finally everyone's favorite server startup in XXXX Ms.

  

The process of initializing the SSH project on the server

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.