Taking a small project in books as an example, there were a lot of problems during the integration of the SSH framework, and it was quite annoying at the beginning. However, I keep telling myself that you must stick to it and you can do it. As a result, I am looking for information from the Internet and watching some videos in this area. Gradually, the problem becomes clear, and I feel like I am loading a lot. Here, we will sort out a log to give you a deeper impression and read it later.
1. for the integration of the three, we recommend that you add packages in order to avoid unnecessary errors, such as spring --> hibernate --> struts (sequential)
2. for the integration of the three, the most important thing is the package. If there is a problem with the imported package, there will be hundreds of errors, and most of the integration of the three, the error is the problem of the package, I have a deep understanding. I think, if there is no good way, we 'd better use the packages that myeclipse provides for us to support the SSH framework. At the same time, add the required packages as needed.
3. For the integration of spring and hibernate, the problem is not very big, as long as the hibernte is handed over to a spring configuration file for management. Myeclipe has already done a good job for us. When we add spring support and then add hibernate support, it will ask whether we should submit the configuration file to spring management or create a configuration file by ourselves. We can choose to submit it to spring management. The three operations are as follows:
Project (Project name) --> right-click --> the drop-down menu has a myeclipse --> click it to add SSH support (for example, add spring capabilities, note that it is best to add spring support first.
4. I think the integration of struts and spring is complicated. In addition, there are still many errors in the process of integrating the application. You must pay attention to the fact that using myeclipse to provide us with better support leads to a series of errors. For example, the Code configured in the struts-config.xml:
<Plug-in classname = "org. springframework. Web. Struts. contextloaderplugin">
<Set-Property = "contextconfiglocation" value = "/WEB-INF/classes/applicationcontext. xml"/>
</Plug-in>
In fact, myeclipse has already done a good job for us. We only need to make some modifications.
5. In addition, for the integration of struts and spring, there is only one configuration method, but there are two implementation methods:
(1) Add the above Code in truts-config.xml:
<Plug-in classname = "org. springframework. Web. Struts. contextloaderplugin">
<Set-Property = "contextconfiglocation" value = "/WEB-INF/classes/applicationcontext. xml"/>
</Plug-in>
At the same time, modify the type in action:
Type = "org. springframework. Web. Struts. delegatingactionproxy", which is managed by the spring proxy class to support struts
(2) Of course, we do not have to modify the type in action, we just need to add the following code in the struts-config.xml:
<Controller processorclass = "org. springframework. Web. Struts. delegatingrequestprocessor">
</Controller>,
For the type in action, we can restore its original type.