论坛

主页 » Liferay Portal » English » 3. Development

组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
toggle
Kamesh Sampath
liferay-util:include
2012年2月11日 下午8:55
答复

Kamesh Sampath

等级: Regular Member

帖子: 159

加入日期: 2010年5月26日

最近的帖子

Hi,

Can anyone tell me the differnce between <liferay-util:include> and jsp:include/<%@include%> ?

Can I use <liferay-util:include> in my custom portlet application ?, i see that the tag is not getting processed even though i give servletContext parameter for the tag emoticon

I guess I am missing something emoticon

Also whether its advisable to use the tag in the custom jsp of portlet application ?

Thanks

Kamesh
Jelmer Kuperus
RE: liferay-util:include
2012年2月12日 上午12:39
答复

Jelmer Kuperus

等级: Liferay Legend

帖子: 1192

加入日期: 2010年3月10日

最近的帖子

1<%@include%>


Is the jsp include directive. The content of the file you are including is added at translation time. Eg. when the JSP file is compiled. So any code in the include is treated exactly as when had it been written inline in the jsp that does the include

1< jsp:include>


Is the jsp include tag. The contents of the path you are including are added at request time. You can also parameterize the request that's made by nesting jsp:param elements in this tag. You can only include paths that are relative to your servlet context (eg. in your own war file)

1<liferay-util:include>


Is the liferay inlude tag, afaik its kind of like jsp:include but let's you include files from other servlet contexts then your own, via it's servletContext attribute or portletId.


And then there's a bunch of others also related to including, you did not mention yet. Like <jsp:forward> and <c:import>. What you should use depends on the situation
Kamesh Sampath
RE: liferay-util:include
2012年2月12日 上午5:10
答复

Kamesh Sampath

等级: Regular Member

帖子: 159

加入日期: 2010年5月26日

最近的帖子

thanks. but then when I use the <liferay-ui:include> to include a jsp file from my portlet plugin is not working, rather no error or jsp not inlcuded. I also tried putting down the servletContext="<%=this.getServletContext()%>" not sure what is the reason.

Is anyting am missing from this point of view ?
Fuad Efendi
RE: liferay-util:include
2012年4月27日 下午1:23
答复

Fuad Efendi

等级: Regular Member

帖子: 171

加入日期: 2007年4月5日

最近的帖子

This is super stupid, but make sure you have in portal-ext.properties

1    theme.jsp.override.enabled=true


"include" tag checks this value in Liferay v.6.1.0 CE GA1...
Kamesh Sampath
RE: liferay-util:include
2012年6月9日 上午2:15
答复

Kamesh Sampath

等级: Regular Member

帖子: 159

加入日期: 2010年5月26日

最近的帖子

thanks so much faud, we need this entry to make it work emoticon ... and actually it worked .
Uday Reddy
RE: liferay-util:include
2012年6月20日 上午4:42
答复

Uday Reddy

等级: New Member

帖子: 14

加入日期: 2011年11月8日

最近的帖子

Hi

I'm using 6.0 EE version.

When i used <liferay-util:include> tag, Neighter executed the included page, nor no error on the page.

I also included the entry in portal-ext.properties file too.

Please help me in this.
Mohammad Azharuddin
RE: liferay-util:include
2012年10月12日 上午6:12
答复

Mohammad Azharuddin

等级: Expert

帖子: 471

加入日期: 2012年9月17日

最近的帖子

Even i'm facing same problem.....can anyone help me please.....i include <%@ taglib uri="http://liferay.com/tld/util" prefix="liferay-util" %> in jsp file also i enable theme.jsp.override.enabled=true in portal-ext file
Thank you
Regards
Kowbathullah Gnaniyar
RE: liferay-util:include
2013年2月13日 上午2:31
答复

Kowbathullah Gnaniyar

等级: Liferay Master

帖子: 606

加入日期: 2007年12月19日

最近的帖子

Try this:


<liferay-util:include page="/next.jsp" servletContext="<%=this.getServletContext() %>">
Roberto Díaz
RE: liferay-util:include
2013年2月19日 下午12:30
答复

Roberto Díaz

等级: Junior Member

帖子: 40

加入日期: 2008年6月26日

最近的帖子

I have the same problem. I try with everything but it doesn't work. Anyone has any idea??

Thanks.

Gnaniyar Zubair:
Try this:


<liferay-util:include page="/next.jsp" servletContext="<%=this.getServletContext() %>">
Fabian Funkel
RE: liferay-util:include
2013年3月12日 上午1:11
答复

Fabian Funkel

等级: New Member

帖子: 4

加入日期: 2013年3月7日

最近的帖子

Adding that line:

1theme.jsp.override.enabled=true


to the portal-ext.properties worked for me. (Liferay 6.1.20-EE-GA2)

You have to restart the server afterwards, obviously.
Habib Zare
RE: liferay-util:include
2016年4月4日 上午5:37
答复

Habib Zare

等级: Junior Member

帖子: 58

加入日期: 2012年10月28日

最近的帖子

I do that in liferay 6.2 but it is not working.
please help me.
delang j
RE: liferay-util:include
2016年6月14日 下午8:22
答复

delang j

等级: Regular Member

帖子: 235

加入日期: 2008年7月13日

最近的帖子

Habib Zare:
I do that in liferay 6.2 but it is not working.
please help me.


please look at this link.
https://web.liferay.com/community/forums/-/message_boards/message/4315190