liferay-util:include

During the migration, I found a problem in Liferay 6.1, it works on Liferay 6.0, but it doesn't work on 6.1.

In my page view_entries.jsp, I include another page view_entry_content.jsp, then the params in the view_entries.jsp doesn't exist in view_entry_content.jsp.

For example:

view_entries.jsp

<% String currentURL = "www.google.com" %>

<liferay-util:include page="/html/portlet/blogs/view_entry_content.jsp" >  
</liferay-util:include>


view_entry_content.jsp

<%= currentURL%>

In this case, I'll get null in Liferay 6.1. It'll show "www.google.com" on Liferay 6.0.


My solution is to pass the param like this:

view_entries.jsp

<liferay-util:include page="/html/portlet/blogs/view_entry_content.jsp" >
<liferay-util:param name="redirectToEntryContent" value="<%=currentURL %>" />
</liferay-util:include>


view_entry_content.jsp

<%

String redirectContentURL = ParamUtil.getString(request, "redirectToEntryContent");

System.out.println(redirectContentURL );

%>

It should work this time!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值