Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Shira Rand
liferay-util:include is ignored
March 21, 2013 3:02 AM
Answer

Shira Rand

Rank: New Member

Posts: 15

Join Date: February 13, 2013

Recent Posts

After reading this thread and trying every advise in it, I still can't get liferay-util:include to work.

I'm using Liferay 6.1.1-ce-ga2.
I added the following line to my portal-ext.properties file.
1theme.jsp.override.enabled=true

My test code is this:
1<jsp:include page="/html/portlet/test.jsp">
2<jsp:param value="test" name="test"/>
3</jsp:include>
4<liferay-util:include page="/html/portlet/test.jsp" servletContext="<%=this.getServletContext()%>">
5<liferay-util:param value="test" name="test"/>
6</liferay-util:include>

test.jsp looks like this:
1<%=request.getParameter("test")%>

result is this:
null


The reason I also used jsp:include is to make sure I'm including the file right.
It works, but without really passing the parameter (as expected).

Any suggestions?

Thanks in advance!
Shira Rand
RE: liferay-util:include is ignored
March 24, 2013 5:20 AM
Answer

Shira Rand

Rank: New Member

Posts: 15

Join Date: February 13, 2013

Recent Posts

I managed to find the problem.
I had to add "docroot" to the include path in order for it to work.
Hitoshi Ozawa
RE: liferay-util:include is ignored
March 24, 2013 5:43 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7952

Join Date: March 23, 2010

Recent Posts

I had to add "docroot" to the include path in order for it to work.


Are you sure? When you deploy your portlet, is there a "docroot" directory? Normally, it's just a "html" directory.
Shira Rand
RE: liferay-util:include is ignored
March 24, 2013 5:48 AM
Answer

Shira Rand

Rank: New Member

Posts: 15

Join Date: February 13, 2013

Recent Posts

100% positive.
I was surprised myself.
The most annoying part about this is that you don't get any indication anywhere that the file is not found.