问题
I am working in a Struts 2.0 Project.
What are the steps and precautions needed to do while upgrading Struts from 2.0 to 2.5?
回答1:
Many things have changed since Struts 2.0 (that is 10 years old).
They're all described in the version notes of each release, that you should read.
The best shot you have, however, is to bring your 2.0 project to a 2.3 one (the latest version, that currently is 2.3.32).
The biggest things that you'll need to refactor (from 2.0 to 2.3.32) are:
- remove DMI (this will probably be the biggest).
- remove Dojo plugin and tags
- remove static method accesses
- change the filter
- change the
id
attribute tovar
attribute in tags - change the
dtd
s of xml files (struts.xml, validation files etc)
Once you have a full working 2.3 project, you can follow the official Struts 2.3 to 2.5 Migration Guide.
Remember that, while up to Struts 2.3 you were allowed to use Java >= 6,
Struts 2.5 will run on Java >= 7 only.
Good luck.
来源:https://stackoverflow.com/questions/42995276/how-to-migrate-struts-from-2-0-to-2-5