JSP:include
GOAL: Create a channel where the content changes depending on an attribute
in the profile server.
I have already added the attribute using the ipsadmin command.
I have already created the jsp channel using the JSP provider:
com.iplanet.portalserver.providers.jsp.JSPProvider
I added the necessaryp files: /desktop/LocalOffice/content.jsp and
/desktop/LocalOffice/edit.jsp
In the code for the page I want to use. The page works fine if I remove the
jsp:include line, but the include is the key to the whole page working.:
<%@ page language="java" contentType="text/html" %>
<%@ page import="com.iplanet.portalserver.providers.jsp.JSPProvider,
com.pegs.util.*,
portal.sup.*,
java.util.*,
%>
<%
JSPProvider p = (JSPProvider)pageContext.getAttribute("JSPProvider");
p.loadProperties("PegasusLocalOffice-*");
String office= p.getStringProperty("PegsboardLocalOffice", "localOffice",
"");
%>
<HTML>
<BODY>
<FONT FACE="[tag:iwtDesktop-fontFace1]" SIZE=-1>
<img src="/Pegsboard/images/intranet/pushpin.gif" width="10"
height="10"><B>Local Office News</B><BR>
<FONT SIZE=-2>
</FONT>
</FONT>
<% String url ="/Pegsboard/static/Channels/Intranet/" +office + "Office/"+
office + "Office.html"; %>
<jsp:include page="<%= url %>"flush="true" />
</BODY>
</HTML>
</BODY>
</HTML>
The problem is I am getting the following error:
Include: Invalid attribute, file
org.apache.jasper.JasperException: Include: Invalid attribute, file
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.(Compiled Code)
at java.lang.Exception.(Compiled Code)
at javax.servlet.ServletException.(ServletException.java:68)
at org.apache.jasper.JasperException.(JasperException.java:73)
at org.apache.jasper.compiler.Parser.checkAttributes(Compiled Code)
at org.apache.jasper.compiler.Parser$Include.accept(Compiled Code)
at org.apache.jasper.compiler.Parser.parse(Compiled Code)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1017)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1013)
at org.apache.jasper.compiler.Compiler.compile(Compiled Code)
at
com.iplanet.portalserver.providers.jsp.JspServletWrapper.loadIfNecessary(Jsp
ServletWrapper.java:54)
at
com.iplanet.portalserver.providers.jsp.JspServletWrapper.service(JspServletW
rapper.java:90)
at
com.iplanet.portalserver.providers.jsp.JSPProvider.processJspFile(JSPProvide
r.java:677)
at
com.iplanet.portalserver.providers.jsp.JSPProvider.processJspFile(Compiled
Code)
at
com.iplanet.portalserver.providers.jsp.JSPProvider.getContent(JSPProvider.ja
va:383)
at com.iplanet.portalserver.desktop.ProviderCaller.run(Compiled Code)
[3192 byte] By [
RobLoy] at [2007-11-25 4:29:30]

From the JSPProvider javadoc:
The JSP engine used by JSPProvider supports the
same set of JSP features as is supported by the iPlanet Web Server 4.1
that is included with Portal Server. This is the Servlet 1.1
specification without the following features:
tag libraries (<%@ taglib ... >, etc.)
dynamic include directive (<jsp:include>)
dynamic forwarding directive (<jsp:forward>)
Tom
Robert Loy wrote:
>
> GOAL: Create a channel where the content changes depending on an attribute
> in the profile server.
>
> I have already added the attribute using the ipsadmin command.
>
> I have already created the jsp channel using the JSP provider:
> com.iplanet.portalserver.providers.jsp.JSPProvider
>
> I added the necessaryp files: /desktop/LocalOffice/content.jsp and
> /desktop/LocalOffice/edit.jsp
>
> In the code for the page I want to use. The page works fine if I remove the
> jsp:include line, but the include is the key to the whole page working.:
> <%@ page language="java" contentType="text/html" %>
> <%@ page import="com.iplanet.portalserver.providers.jsp.JSPProvider,
>com.pegs.util.*,
>portal.sup.*,
>java.util.*,
> %>
> <%
>JSPProvider p = (JSPProvider)pageContext.getAttribute("JSPProvider");
>p.loadProperties("PegasusLocalOffice-*");
>String office= p.getStringProperty("PegsboardLocalOffice", "localOffice",
>"");
> %>
> <HTML>
> <BODY>
> <FONT FACE="[tag:iwtDesktop-fontFace1]" SIZE=-1>
> <img src="/Pegsboard/images/intranet/pushpin.gif" width="10"
> height="10"><B>Local Office News</B><BR>
> <FONT SIZE=-2>
> </FONT>
> </FONT>
> <% String url ="/Pegsboard/static/Channels/Intranet/" +office + "Office/"+
> office + "Office.html"; %>
> <jsp:include page="<%= url %>"flush="true" />
> </BODY>
> </HTML>
> </BODY>
> </HTML>
>
> The problem is I am getting the following error:
>
> Include: Invalid attribute, file
> org.apache.jasper.JasperException: Include: Invalid attribute, file
> at java.lang.Throwable.fillInStackTrace(Native Method)
> at java.lang.Throwable.fillInStackTrace(Compiled Code)
> at java.lang.Throwable.(Compiled Code)
> at java.lang.Exception.(Compiled Code)
> at javax.servlet.ServletException.(ServletException.java:68)
> at org.apache.jasper.JasperException.(JasperException.java:73)
> at org.apache.jasper.compiler.Parser.checkAttributes(Compiled Code)
> at org.apache.jasper.compiler.Parser$Include.accept(Compiled Code)
> at org.apache.jasper.compiler.Parser.parse(Compiled Code)
> at org.apache.jasper.compiler.Parser.parse(Parser.java:1017)
> at org.apache.jasper.compiler.Parser.parse(Parser.java:1013)
> at org.apache.jasper.compiler.Compiler.compile(Compiled Code)
> at
> com.iplanet.portalserver.providers.jsp.JspServletWrapper.loadIfNecessary(Jsp
> ServletWrapper.java:54)
> at
> com.iplanet.portalserver.providers.jsp.JspServletWrapper.service(JspServletW
> rapper.java:90)
> at
> com.iplanet.portalserver.providers.jsp.JSPProvider.processJspFile(JSPProvide
> r.java:677)
> at
> com.iplanet.portalserver.providers.jsp.JSPProvider.processJspFile(Compiled
> Code)
> at
> com.iplanet.portalserver.providers.jsp.JSPProvider.getContent(JSPProvider.ja
> va:383)
> at com.iplanet.portalserver.desktop.ProviderCaller.run(Compiled Code)