Reflection and summary of problems arising during SSH framework integration

Source: Internet
Author: User

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.

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.