StrutsPros and cons
Advantages:
1.RealizeMvcPattern, clear structure,Enable developers to focus only on the implementation of business logic.
2. Have a wealth ofTagcan be usedStrutsThe tag Library(Taglib), if flexible, can greatly improve the development efficiency
3.Page navigation
Make the system's context clearer. With a configuration file, you can grasp the connection between the parts of the system,
This is a great benefit for later maintenance. Especially when another group of developers took over the project, the advantage
More obvious.
4.ProvideExceptionProcessing mechanism.
5.Database Link Pool Management
6.Supporti18n
Disadvantages
First, when you go to the presentation layer, you need to configureForward, if there are 10 display layers ofJsp, need to be configured 10 timesStruts,
And does not include sometimes directories, file changes, need to re-modifyForward, notice that after each configuration modification,
Requires redeployment of the entire project, andTomcateSuch a server, you must also restart the server
TwoStrutsOfActionMust beThread-Safemode, which allows only one instance to handle all
The request. SoActionAll resources used must be synchronized synchronously, which raises the issue of thread safety.
Third, the test is not convenient. Strutsof eachActionAll the sameWebLayer is coupled so that its test relies on the
Webcontainers, unit tests are also difficult to implement. But there is aJunitThe extension toolStruts TestCasecan achieve
It's unit tests.
Iv. Types of conversions. StrutsOfFormbeanTake all the data asStringType, it can make the labor
WithCommons-beanutilsMake type conversions. But its transformation is in theClassLevel, and the type of conversion is
Non-configurable. It is also very difficult to return the error message to the user when the type is converted.
V. toServletThe dependence is too strong. StrutsProcessingActionMust be dependent uponServletRequestAnd
Servletresponse, all it can not get rid ofServletContainer.
Vi. front-end expression language aspects. StrutsIntegrates aJstl, so it mainly usesJstlThe expression language to
Get the data. ButJstlThe expression language inCollectionand indexed properties are very weak to handle.
Seven, theActionDifficulty in controlling the implementation. StrutsCreate aAction, if you want to control the order in which it will be executed
Very difficult. You even have to write it back.ServletTo achieve this functional requirement for you.
Eight, toActionPre-and post-execution processing. StrutsProcessingActionThe time is based onClassOfHierarchies,
Difficult toActionOperations before and after processing.
IX. Insufficient support for eventsstruts is actually a form form corresponds to a action ( or
struts struts this
Event mode called application event Application event component event Compared to a coarse-grained
event
Advantages and disadvantages of the struts framework in the Java framework