[英]Unable to set Window State to Exclusive in Struts2 Liferay Portlet
概述:将struts2 web-appp移植到liferay struts2 6.2 portlet
问题:无法在struts2标记<s:url ..../>
中将windowState设置为“独占”
说明:我需要在struts2标签<s:url ..../>
中将windowState设置为“ Exclusive”。
我正在尝试以下选项,但无法将url的窗口状态设置为独占。
<s:url var="billingOverview" action="%{billingOverviewURL}"
portletMode="view" portletUrlType="struts.portlet.action"
windowState=<%=LiferayWindowState.EXCLUSIVE.toString()%> />
最初我得到一个例外:“根据tld或属性windowState,不接受任何表达式”。我在以下位置修改了struts2核心jar(struts2-core-2.3.7.jar)的“ struts-tags.tld”文件通过将rtexprvalue更改为TRUE,我进行了以下更改以接受windowState标记中的表达式:
<attribute>
<description><![CDATA[The resulting portlet window state]]></description>
<name>windowState</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
如果我能对上述问题有所了解,那将是非常不错的。 提前致谢!
您不能在Struts标记内嵌套scriptlet( <%...%>
不应在其他任何地方使用)。
您需要
在struts.xml中启用静态方法访问
<constant name="struts.ognl.allowStaticMethodAccess" value="true" />
然后
使用以下语法引用FQCN:
更改为:
<s:url portletUrlType="struts.portlet.action"
portletMode="view"
var="billingOverview"
action="%{billingOverviewURL}"
windowState="%{@com.liferay.portal.kernel.portlet.LiferayWindowState@EXCLUSIVE}" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.