- This topic has 2 replies, 2 voices, and was last updated 13 years, 10 months ago by dason.
-
AuthorPosts
-
dasonMemberI have the need to import external content into an ICEfaces page contained in a MyEclipse project. I had thought to use JSTL, but will settle for alternatives.
If I start with a Web project using Java EE 5, I can add JSF support and JSF Pages without a problem.
I can then use the JSTL tag <c:import …/> to grab what I need.However, when I go to the MyEclipse menu, and convert the project to an ICEfaces project by adding the 1.8.1 ICEfaces libraries, ICEfaces pages work, but the previously created JSF pages now throw an exception.
ICEfaces pages that use <c:import…/> also throw an exception.How can I get ICEfaces and the JSTL <c:import…/> statement to work together?
Here’s a little more detail:
MyEclipse Version: 8.6.1
ICEFaces Version: 1.8.1
Java EE version of the web project: 5Sample JSF Page that worked prior to adding ICEfaces support:
<%@ page language=”java” pageEncoding=”ISO-8859-1″%>
<%@ taglib uri=”http://java.sun.com/jsf/html” prefix=”h” %>
<%@ taglib uri=”http://java.sun.com/jsf/core” prefix=”f” %>
<%@ taglib uri=”http://java.sun.com/jsp/jstl/core” prefix=”c” %><%
String path = request.getContextPath();
String basePath = request.getScheme()+”://”+request.getServerName()+”:”+request.getServerPort()+path+”/”;
%><!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
<html>
<head>
<base href=”<%=basePath%>”><title>Test Include for JSF</title>
<meta http-equiv=”pragma” content=”no-cache”>
<meta http-equiv=”cache-control” content=”no-cache”>
<meta http-equiv=”expires” content=”0″>
<meta http-equiv=”keywords” content=”keyword1,keyword2,keyword3″>
<meta http-equiv=”description” content=”This is my page”>
<!–
<link rel=”stylesheet” type=”text/css” href=”styles.css”>
–></head>
<body>
<f:view>
Test JSF Include Page. <br/>
Revision: C. <br/><c:import url=”http://localhost:8080/IOP_ Template/Main.jspx”>
</c:import>
</f:view></body>
</html>Here is an ICEFaces Page that works fine without the <c:import… /> tag.
<?xml version=”1.0″ encoding=”ISO-8859-1″ ?>
<jsp:root version=”1.2″
xmlns:jsp=”http://java.sun.com/JSP/Page”
xmlns:f=”http://java.sun.com/jsf/core”
xmlns:h=”http://java.sun.com/jsf/html”
xmlns:c=”http://java.sun.com/jsp/jstl/core”
xmlns:ice=”http://www.icesoft.com/icefaces/component”>
<jsp:directive.page contentType=”text/html;charset=ISO-8859-1″ pageEncoding=”ISO-8859-1″ />
<f:view>
<ice:outputDeclaration
doctypeRoot=”html”
doctypePublic=”-//W3C//DTD HTML 4.01 Transitional//EN”
doctypeSystem=”http://www.w3.org/TR/html4/loose.dtd” />
<html>
<head>
<title>ICE Faces Include Test</title>
<link rel=”stylesheet” type=”text/css” href=”./xmlhttp/css/rime/rime.css”/>
</head>
<body><ice:outputText value=”IceFaces Include Test” /><br/>
<ice:outputText value=”Revision: B” /><br/>
<ice:form><ice:messages />
<c:import url=”http://localhost:8080/IOP_ Template/Main.jspx”>
</c:import></ice:form>
</body>
</html>
</f:view>
</jsp:root>Here is the exception that the ICEFaces page throws with <c:import… />:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: java.lang.Exception: javax.faces.FacesException: java.lang.UnsupportedOperationException
com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:179)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.lang.Exception: javax.faces.FacesException: java.lang.UnsupportedOperationException
com.icesoft.faces.context.View.servePage(View.java:142)
com.icesoft.faces.webapp.http.core.SingleViewServer.service(SingleViewServer.java:52)
com.icesoft.faces.webapp.http.common.ServerProxy.service(ServerProxy.java:11)
com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet$4.service(MainSessionBoundServlet.java:114)
com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:160)
com.icesoft.faces.webapp.http.servlet.SessionDispatcher$1.service(SessionDispatcher.java:42)
com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:19)
com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:63)
com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:62)
com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:153)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)Thank you very much for your help,
Dave
support-swapnaModeratordason,
JSTL in ICEfaces is only supported with Facelets. The <c:import> is not supported even by the Facelets. You can use <ui:include/> instead.
Have a look at the following posts :
http://www.icefaces.org/JForum/posts/list/8269.page.
http://www.icefaces.org/JForum/posts/list/4191.page
http://www.icefaces.org/JForum/posts/list/6562.pageYou can cross post it to the ICEFaces forum for further support.
Hope this helps.
dasonMemberThank you for your reply.
Unfortunately, <ui:include …/> doesn’t appear to let you pull in a page from another WAR file.
The <iframe> take is the only other thing I’ve been able to come up with. It is not ideal, but I think it will work for this particular problem.
Best,
Dave -
AuthorPosts