MyEclipse Forums
This thread has been locked & this forum has been archived.
Please post new topics to Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
View previous topic Printable version Log in to check your private messages View next topic
Author Message
dason
Post subject: MyEclipse, ICEfaces, and JSTL  PostPosted: Feb 02, 2011 - 07:50 PM



Joined: Jul 26, 2010
Posts: 18

I 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: 5

Sample 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
 
 View user's profile Send private message  
Reply with quote Back to top
support-swapna
Post subject: RE: MyEclipse, ICEfaces, and JSTL  PostPosted: Feb 03, 2011 - 05:45 AM



Joined: Nov 11, 2010
Posts: 2489

dason,

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.page

You can cross post it to the ICEFaces forum for further support.

Hope this helps.

_________________
Swapna
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
dason
Post subject: RE: MyEclipse, ICEfaces, and JSTL  PostPosted: Feb 03, 2011 - 01:32 PM



Joined: Jul 26, 2010
Posts: 18

Thank 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
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits