Foren
JSTL Param value in portlet
Rich Hirst, geändert vor 12 Jahren.
JSTL Param value in portlet
New Member Beiträge: 4 Beitrittsdatum: 11.10.11 Neueste Beiträge
Hi,
I'm trying to include some JSP code within another JSP (for e.g. footers and headers) and to pass a parameter to the included code.
I am unable to access the parameter except in the ROOT context(?).
So for example, in my portlet JSP I have:
Then in the "foot.jsp" file there is:
The result is:
If I move the footer from the custom portlet to ROOT/WEB-INF/jsp and remove the servletContext then it appears as it should:
Any help appreciated!
Rich
I'm trying to include some JSP code within another JSP (for e.g. footers and headers) and to pass a parameter to the included code.
I am unable to access the parameter except in the ROOT context(?).
So for example, in my portlet JSP I have:
<%@ page contentType="text/html" %>
<%@ page import="javax.portlet.*" %>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/util" prefix="liferay-util" %>
<portlet:defineobjects />
<p class="sstitle">Device Management</p>
<br>
Here we are
<liferay-util:include page="/WEB-INF/jsp/foot.jsp" servletcontext="<%= this.getServletContext() %>">
<liferay-util:param name="theparam" value="stuff" />
</liferay-util:include>
Then in the "foot.jsp" file there is:
<%@ page contentType="text/html" %>
<%@ page import="javax.portlet.*" %>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/util" prefix="liferay-util" %>
<h1>And here we are too!</h1>
${param.theparam}
The result is:
Device Management
Here we are
And here we are too!
${param.theparam}
If I move the footer from the custom portlet to ROOT/WEB-INF/jsp and remove the servletContext then it appears as it should:
Device Management
Here we are
And here we are too!
stuff
Any help appreciated!
Rich
Rich Hirst, geändert vor 12 Jahren.
RE: JSTL Param value in portlet (Antwort)
New Member Beiträge: 4 Beitrittsdatum: 11.10.11 Neueste Beiträge
Resolved
Had missed the page parameter:
Had missed the page parameter:
<%@ page isELIgnored="false" %>