The difference between struts and Struts2 frameworks in the Java framework

Source: Internet
Author: User

Struts1with thestruts2The difference:
1.'s AllMvcOfWebFramework,
2 Struts1The old framework, the application is very broad, has a good mass base, the use of IT development risk is very small, lower cost!
Struts2Although based on this framework, but the application of the masses and many, relatively immature, unknown risks and changes a lot, developed
Personnel relatively bad recruit, use it development project risk coefficient is bigger, employing higher cost!
3.struts2After all is standing on the foundation design of the predecessor, it will improve and perfectStruts1Some of the flaws in theStruts1
Some of the outstanding issues inStruts2have been resolved.
4.struts1The front-end controller is aServlet, a name calledActionservlet,Struts2The front-end controller is a
FilterInstruts2.0Middle calledFilterdispatcherInstruts2.1Middle calledStrutsprepareandexecutefilter。
5.struts1OfActionNeed to inheritActionClassStruts2OfActionCan not inherit any class;Struts1To the same
All requests for a path share aActionInstanceStruts2Each request for the same path uses a single
StateActionInstance object, all forStruts2OfActionDon't worry about thread-safety issues.
6.InStruts1Used inFormbeanEncapsulates the request parameters in theStruts2Direct use inActionProperties to encapsulate please
Parameters are evaluated.
7.struts1Multiple business methods in aActionMedium time (that is, inheritanceDispatchaction), or both,
Either are not verified;Struts2, you can specify that only one method is validated when aActionInherited the
ActionsupportAnd in this class, you write only theValidateXxx ()method, then only theXxx ()method to verify.
(a request for an execution process is analyzed,Struts2is automatic support sub-module development, and can be different module settings
of differentwr.prefix, which is passed through thePackageOfNamespaceto achieve;Struts2is to support multiple types of visual
FigureStruts2The view address can be dynamic, that is, the name of the view is supported variable mode, for example, forum post lost
I'm going to pass it back after the defeatBoardid。 View content display facet: It's tagged withOgnlToEl Much more powerful, in the international
Support sub-module management, two modules used to the same key , corresponding to different messages;)
struts1 struts2 Each request to the user creates a action struts2action
What impresses me most is: struts redirect Span class= "FONTSTYLE0" > view url cannot accept arguments, and struts2 with
redirect view can accept parameters.
/span>

Differences between struts and Struts2 frameworks in the Java framework

Related Article

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.