# 14.1 Quick Upgrade
# I. Upgrading Versions Prior to jfinal 3.0
jfinal 3.0 is a major version upgrade. For upgrades from previous versions to jfinal 3.0, please refer to sections 14.2, 14.3, 14.4, and 14.5. The content in these sections is minimal, making the upgrade quite convenient.
# II. Upgrading Versions After jfinal 3.0
# 1. Upgrading to 3.1
No modifications required, smooth upgrade.
# 2. Upgrading to 3.2
IStringSource
is renamed to ISource
.
Follow section 14.2 for upgrading Ret
.
# 3. Upgrading to 3.3
The java.io.Writer
in directive extensions has been changed to com.jfinal.template.io.Writer
. Eclipse/IDEA development tools will automatically provide prompts.
# 4. Upgrading to 3.4
Because the defaultDatePattern
in Json has been changed from null
to "yyyy-MM-dd HH:mm:ss"
, and datePattern
attribute is removed in JFinalJson
, you need to configure me.setJsonDatePattern(null)
or a specific value in configConstant(Constants me)
.
# 5. Upgrading to 3.5
ISource.getKey()
is renamed to ISource.getCacheKey()
.
# 6. Upgrading to 3.6
Db
and Model
have added an 's' suffix to findById
and deleteById
methods for multi-primary keys (composite primary keys), changing them to findByIds
and deleteByIds
.
If you are using the jfinal weixin project's MsgController
, you need to configure me.setMappingSuperClass(true)
in configRoutes
.
# 7. Upgrading to 3.8
Methods using Aop
configuration should now use AopManager
, for example, change Aop.addMapping(...)
to AopManager.me().addMapping(...)
.
# 8. Upgrading to 4.0
No modifications required, smooth upgrade.
# 9. Upgrading to 4.1
No modifications required, smooth upgrade.
# 10. Upgrading to 4.2
No modifications required, smooth upgrade.
# 11. Upgrading to 4.3
No modifications required, smooth upgrade.
# 12. Upgrading to 4.4
No modifications required, smooth upgrade.
# 13. Upgrading to 4.5
Direct access to .jsp
files is not supported by default. If you need to access .jsp
files directly, you need to add the configuration: me.setDenyAccessJsp(false)
.
# 14. Upgrading to 4.6
No modifications required, smooth upgrade.
# 15. Upgrading to 4.7
No modifications required, smooth upgrade.
# 16. Upgrading to 4.8
The Controller.getPara(String)
method in jfinal 4.8 and earlier versions returned an empty string ("") when a form field existed, rather than returning null
. In jfinal 4.8, this has been changed to treat an empty string as null
.
For those who need to quickly upgrade older projects, you can introduce BaseController
and use the old version's implementation.
# 17. Upgrading to 4.9
jfinal 4.9 has refactored JFinalJson.java
. If you have extended the JFinalJson
class in previous projects, note that the extension interface has changed.
# 17. Upgrading to 4.9.01
No modifications required, smooth upgrade.
(Continued due to character limit)
# 18. Upgrading to 4.9.02
Engine.setWriterBufferSize(int)
is renamed to setBufferSize(int)
.
# 19. Upgrading to 4.9.03
No modifications required, smooth upgrade.
# 20. Upgrading to 4.9.04
No modifications required, smooth upgrade. This version only fixes a bug in com.jfinal.plugin.redis.Cache.hgetCounter(...)
.
# 21. Upgrading to 4.9.05
No modifications required, smooth upgrade. This version adds a new each
method in Model
and Db
, which does not affect the upgrade.
# 22. Upgrading to 4.9.06
The MetaBuilder.filter(...)
method is renamed to skip
. The usage logic has not changed. This method is rarely used, so only those who have used it need to modify the code.
# 23. Upgrading to 4.9.07
No modifications required, smooth upgrade.
# 24. Upgrading to 4.9.08
No modifications required, smooth upgrade.
# 25. Upgrading to 4.9.09
No modifications required, smooth upgrade.
# 26. Upgrading to 4.9.10
No modifications required, smooth upgrade.
# 27. Upgrading to 4.9.11
No modifications required, smooth upgrade.
# 28. Upgrading to 4.9.12
Do not use this version, as the template will generate extra blank lines. Please use subsequent versions.
# 29. Upgrading to 4.9.13
No modifications required, smooth upgrade.
# 30. Upgrading to 4.9.14
No modifications required, smooth upgrade.
# 31. Upgrading to 4.9.15
No modifications required, smooth upgrade. Note that if you're upgrading across multiple versions, you should read the section about upgrading to 4.9.13.
# 32. Upgrading to 4.9.16
This version upgrades the Redis plugin's dependencies on jedis
and fst
. Therefore, if you are using the jfinal Redis plugin, you need to upgrade your jedis
dependency to version 3.6.3.
# 33. Upgrading to 4.9.17
No modifications required, smooth upgrade.
# 34. Upgrading to 4.9.18
If you use file upload, the cos
dependency must be upgraded to version 2022.2.
# 35. Upgrading to 4.9.19
No modifications required, smooth upgrade.
# 36. Upgrading to 4.9.20
Ret.create(Object,Object)
is renamed to Ret.of(Object, Object)
. Ret.ok(Object, Object)
and Ret.fail(Object, Object)
have been removed.
# 37. Upgrading to 4.9.21
To maintain compatibility, this version restores the Ret.ok(Object, Object)
and Ret.fail(Object, Object)
methods that were removed in version 4.9.20.
# 38. Upgrading to 5.0.0
No modifications required, smooth upgrade.
# 39. Upgrading to 5.0.1
No modifications required, smooth upgrade.
# 40. Upgrading to 5.0.2
The Enjoy template engine's static method call and static property access expressions are disabled by default. To enable them, you need the following configuration.
# 41. Upgrading to 5.0.3
No modifications required, smooth upgrade.
# 42. Upgrading to 5.0.4
No modifications required, smooth upgrade.
# 43. Upgrading to 5.0.5
No modifications required, smooth upgrade.
# 44. Upgrading to 5.0.6
The unit of the timeOut
parameter in the lock(...)
and withLock(...)
methods of the Redis plugin, which was added in version 5.0.3, has been changed from "milliseconds" to "seconds".
# 45. Upgrading to 5.0.7
No modifications required, smooth upgrade.
# 46. Upgrading to 5.0.8
No modifications required, smooth upgrade.
# 47. Upgrading to 5.0.8
No modifications required, smooth upgrade.
# 48. Upgrading to 5.0.9
No modifications required, smooth upgrade.
# 49. Upgrading to 5.1.0
No modifications required, smooth upgrade.
# 50. Upgrading to 5.1.1
No modifications required, smooth upgrade.
# 51. Upgrading to 5.1.2
The Runnable/Callable
parameters in ScheduledKit
methods have been moved to the last position.