Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Kamesh Sampath
liferay-util:include
11 febbraio 2012 20.55
Risposta

Kamesh Sampath

Punteggio: Regular Member

Messaggi: 159

Data di Iscrizione: 26 maggio 2010

Messaggi recenti

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
12 febbraio 2012 0.39
Risposta

Jelmer Kuperus

Punteggio: Liferay Legend

Messaggi: 1192

Data di Iscrizione: 10 marzo 2010

Messaggi recenti

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
12 febbraio 2012 5.10
Risposta

Kamesh Sampath

Punteggio: Regular Member

Messaggi: 159

Data di Iscrizione: 26 maggio 2010

Messaggi recenti

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
27 aprile 2012 13.23
Risposta

Fuad Efendi

Punteggio: Regular Member

Messaggi: 153

Data di Iscrizione: 5 aprile 2007

Messaggi recenti

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
9 giugno 2012 2.15
Risposta

Kamesh Sampath

Punteggio: Regular Member

Messaggi: 159

Data di Iscrizione: 26 maggio 2010

Messaggi recenti

thanks so much faud, we need this entry to make it work emoticon ... and actually it worked .
Uday Reddy
RE: liferay-util:include
20 giugno 2012 4.42
Risposta

Uday Reddy

Punteggio: New Member

Messaggi: 14

Data di Iscrizione: 8 novembre 2011

Messaggi recenti

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 azaruddin
RE: liferay-util:include
12 ottobre 2012 6.12
Risposta

mohammad azaruddin

Punteggio: Expert

Messaggi: 455

Data di Iscrizione: 17 settembre 2012

Messaggi recenti

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
13 febbraio 2013 2.31
Risposta

Kowbathullah Gnaniyar

Punteggio: Liferay Master

Messaggi: 603

Data di Iscrizione: 19 dicembre 2007

Messaggi recenti

Try this:


<liferay-util:include page="/next.jsp" servletContext="<%=this.getServletContext() %>">
Roberto Díaz
RE: liferay-util:include
19 febbraio 2013 12.30
Risposta

Roberto Díaz

Punteggio: Junior Member

Messaggi: 39

Data di Iscrizione: 26 giugno 2008

Messaggi recenti

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
12 marzo 2013 1.11
Risposta

Fabian Funkel

Punteggio: New Member

Messaggi: 4

Data di Iscrizione: 7 marzo 2013

Messaggi recenti

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.