PortletA集成MVCPortlet,写toEdit()方法调整到edit.jsp.
toEdit中使用actionRequest.setAttribute(“name”,“gjm”);
edit.jsp中通过request.getAttribute("name")无法获取。
最后发现,错误引起是liferay-portlet.xml中设置了<action-url-redirect>true</action-url-redirect>引起。删除该设置,jsp中可以获取值。
本文详细介绍了PortletA如何集成MVCPortlet,并在toEdit方法中使用actionRequest.setAttribute设置变量。然而,在edit.jsp中无法获取此变量,问题根源在于liferay-portlet.xml中设置的action-url-redirect为true。通过删除此设置,问题得以解决,使得变量成功在jsp中获取。
PortletA集成MVCPortlet,写toEdit()方法调整到edit.jsp.
toEdit中使用actionRequest.setAttribute(“name”,“gjm”);
edit.jsp中通过request.getAttribute("name")无法获取。
最后发现,错误引起是liferay-portlet.xml中设置了<action-url-redirect>true</action-url-redirect>引起。删除该设置,jsp中可以获取值。
1343

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