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