Liferay: what is the relationship and difference between ActionRequest, RenderRequest and PortletRequest?

别说谁变了你拦得住时间么 提交于 2019-12-04 14:41:02

问题


What is the relationship and difference between ActionRequest, RenderRequest and PortletRequest?

Can we get instance of one from another?


回答1:


The PortletRequest is the parent of both. An ActionRequest and a RenderRequest are both different types of PortletRequest objects.

An ActionRequest is valid during the action processing phase of the portlet. During this phase, the portlet hasn't completely decided how it is going to render itself, be it minimized, maximized, in edit mode or in veiw mode, etc.

On the other hand, the RenderRequest is valid during the rendering phase of the portlet. At this point, the portlet knows how it is going to render itself, and certain changes such as window state, are not allowed.

If you want to pass the params from action to render, you would need to set the ActionResponse using

response.setRenderParameter(key,val);  

Then this is available in the corresponding RenderRequest.

Answer was found here



来源:https://stackoverflow.com/questions/12745786/liferay-what-is-the-relationship-and-difference-between-actionrequest-renderre

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!