Liferay:ActionRequest,RenderRequest和PortletRequest之间的关系和区别是什么? [英] Liferay: what is the relationship and difference between ActionRequest, RenderRequest and PortletRequest?

查看:93
本文介绍了Liferay:ActionRequest,RenderRequest和PortletRequest之间的关系和区别是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ActionRequestRenderRequestPortletRequest之间的关系和区别是什么?

我们可以从另一个实例中获取一个实例吗?

解决方案

PortletRequest是两者的父级. ActionRequestRenderRequest都是PortletRequest对象的不同类型.

ActionRequest在portlet的动作处理阶段有效.在此阶段,portlet尚未完全决定如何呈现自己,无论是最小化,最大化,在编辑模式下还是在veiw模式下等等.

另一方面,RenderRequest在portlet的呈现阶段有效.此时,Portlet知道它将如何呈现自己,并且不允许某些更改(例如窗口状态).

如果要将参数从动作传递到渲染,则需要设置ActionResponse使用

response.setRenderParameter(key,val);  

然后在相应的RenderRequest中可用.

在此处找到答案

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

Can we get instance of one from another?

解决方案

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

这篇关于Liferay:ActionRequest,RenderRequest和PortletRequest之间的关系和区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆