The pros and cons of Struts, Hibernate, and Spring 3 frameworks The struts framework has the advantages of modularity, flexibility and reuse, while simplifying the development of MVC based web applications.
Advantages:
Struts, like many Apache projects such as Tomcat and Turbine, is open source software, which is one of its great advantages. Enable developers to learn more about their internal implementation mechanisms.
Beyond that, the benefits of Struts are primarily focused on two aspects: the Taglib and the page navigation. The Taglib is a tag library for Struts that is flexible enough to greatly improve development efficiency. In addition, as far as the current domestic JSP developers are concerned, it is very rare to develop your own tags in addition to the commonly used tags brought in by JSP, and perhaps Struts is a good starting point.
As for page navigation, I think that's going to be a development in the future, in fact, to make the context of the system clearer. By using a configuration file, you can grasp the connection between the parts of the system, which is of great benefit to later maintenance. This is especially true when another developer takes over the project.
In addition, struts is an industry \(many successful cases), rich in learning resources, and excellent HTML tags
Disadvantages:
Taglib is one of the advantages of Struts, but for beginners, but need a process of continuous learning, can even disrupt your web page in the habit of writing, but, when you get used to it, you will feel it's really good.
Struts split the Controller of MVC into three, adding to the complexity of the system while gaining clarity.
ActionForms is not used for unit testing (StrutsTestCase can only be used for integration)
Struts, like many Apache projects such as Tomcat and Turbine, is open source software, which is one of its great advantages. Enable developers to learn more about their internal implementation mechanisms. The Struts open source framework was created to make it easier for developers to build Web applications based on Java servlets and JavaServer Pages (JSP) technologies. The Struts framework provides a unified standard framework for the open, which allows developers to focus more on the business logic of the application by using Struts as a foundation. The Struts framework itself is a
model-view-controller (MVC) implementation using Java servlets and JavaServer Pages technology.
Specifically, the advantages of Struts are:
Implement the MVC pattern, and the structure is clear, allowing developers to focus on the implementation of the business logic.
Rich tags can be used, and the Struts tag library (Taglib), if flexible, can greatly improve development efficiency. In addition, as far as the current domestic JSP developers are concerned, it is very rare to develop your own tags in addition to the commonly used tags brought in by JSP, and perhaps Struts is a good starting point.
Page navigation is going to be a development in the future, in fact, to make the context of the system clearer. By using a configuration file, you can grasp the connection between the parts of the system, which is of great benefit to later maintenance. This is especially true when another developer takes over the project.
Provide Exception handling mechanisms.
Database connection pool management
6. Support the I18N
A, go to display layer, need to configure forward, every time go to the show layer, that most are directly transferred to the JSP, and involves turning, need to configure forward, if there are ten shows the JSP layer, need to configure the struts, ten times and does not include directory and file changes, sometimes need to modify the forward, note that every change configuration, request to redeploy the whole project, and tomcate this server, also have to restart the server, if the business change complex frequent system, such as simple operation unthinkable. Now that's it, dozens of people are using our system online at the same time, and you can imagine
how big my worries are.
The Action of Struts must be thread-safe, which allows only one instance to handle all requests. So all the resources that action USES must be synchronized, which raises the issue of thread-safety.
Each Action of Struts is coupled with the Web layer, so that its tests depend on the Web container, and unit tests are difficult to implement. However, a Junit extension tool, Struts TestCase, can implement its unit tests.
Four, type conversion. Struts's FormBean USES all the data as a String type, which can be transformed using the tool Commons - Beanutils.
But its transformation is at the Class level, and the type of transformation is unconfigurable. The error message returned to the user is also very difficult.
5, the dependency on servlets is too strong. Struts needs to rely on ServletRequest and ServletResponse to handle Action, and all it can't get rid of the Servlet container.
The front-end expression language aspect. Struts integrates JSTL, so it mainly USES the expression language of the JSTL to get the data. However, the expression language of the JSTL is very weak in the Collection and index properties.
7, the control of Action execution is difficult. Struts creates an Action and it will be very difficult to control its execution
order. You may even want to rewrite the Servlet to implement your functional requirements.
Eight, to Action before and after treatment. The Struts processing when the Action is based on the class hierarchies, it is difficult to operated in Action before and after processing.
Nine, support for events is not enough. In the struts, is actually a Form the Form corresponding to an Action class (or DispatchAction), in other words: in the struts is actually a Form corresponding to an event, only the struts this event is called application event, application event and component compared to the event is a coarse-grained events.
Struts important actionforms form object is an object, it represents a kind of application, this object contains at least a few fields, these fields are the Jsp page in the form input field, as a form corresponding to an event, so that when we need to refine the event granularity to form in the field, that is, a field corresponding to an event, simply use the Struts is unlikely, of course, by combining turn JavaScript can be implemented.
2. Hibernate
Hibernate is an open source object-relational mapping framework, it is very lightweight for JDBC object encapsulation, make the use of Java programmers can follow one's inclinations to manipulate the database object programming thinking.