In Liferay, there's a lot of Service Util classes. They're really convenient. One thing I notice is that there's LocalServiceUtil and ServiceUtil class.
The difference between them is permission check.
For example:
UserLocalServiceUtil: It works even though we don't log in.
UserServiceUtil: It will check the permission. If we don't log in. It reports errors.
本文介绍了Liferay平台中ServiceUtil和LocalServiceUtil的区别。LocalServiceUtil类即使在未登录状态下也能工作,而ServiceUtil则会进行权限检查。如果未登录尝试使用ServiceUtil,则会报错。
2673

被折叠的 条评论
为什么被折叠?



