voyent
Icefaces facelets dynamic content include exception  XML
Forum Index -> General Help Go to Page: 1, 2 Next 
Author Message
maxi_ng

Joined: 11/Jan/2008 00:00:00
Messages: 92
Offline


Code:
 javax.faces.FacesException: Problem in renderResponse: /content-facelet.jspx @55,55 src="#{navigationBean.link}" Could not Resolve Variable [Overflow]: navigationBean
 	com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:294)
 	com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:161)
 	com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
 	com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
 	com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
 	com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:18)
 	com.icesoft.faces.webapp.http.core.PageServer$1.respond(PageServer.java:25)
 	com.icesoft.faces.webapp.http.servlet.ServletRequestResponse.respondWith(ServletRequestResponse.java:161)
 	com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet$ThreadBlockingRequestResponse.respondWith(ThreadBlockingAdaptingServlet.java:36)
 	com.icesoft.faces.webapp.http.core.PageServer.service(PageServer.java:30)
 	com.icesoft.faces.webapp.http.core.MultiViewServer.service(MultiViewServer.java:56)
 	com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer$Matcher.serviceOnMatch(PathDispatcherServer.java:50)
 	com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:19)
 	com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:19)
 	com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:29)
 	com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:106)
 	com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:35)
 	com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
 	com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
 	com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:79)
 	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 


and netbeans showing
Code:
 The attributes for a standard action cannot be deferred expressions
 

on this line
<ui:include src="#{navigationBean.selectedPanel.link}"/>
The page I use is copy of content-facelet.jspx from dynamic-includes-tutorial
But I don't see this warning in the sample that icefaces provide.
I don't understand what I am missing.

I try to follow everything from that sample to create my own.
I attach my source, please help me, I have been stuck in this for a week.
 Filename MaxiStocks.rar [Disk] Download
 Description
 Filesize 4556 Kbytes
 Downloaded:  209 time(s)

Marioko

Joined: 14/Nov/2006 00:00:00
Messages: 125
Offline


make sure that link variable is not null. You can use c:if tag to test that.

<c:if test="#{navigationBean.link!=null}">
<ui:include src="#{navigationBean.link}"/>
</c:if> 
balavenky


Joined: 04/Apr/2008 00:00:00
Messages: 37
Offline


Hi
I have this same issue. I am checking for null also.


Code:
 ...
 ...
 <ice:panelGroup styleClass="componentBox">
             	   <ice:panelDivider dividerPosition="20" id="paneldiv"
 	                    orientation="vertical" style="width: 100%; height: 750px;">	                    
 	             <f:facet name="first">	             	
 	             	<ice:panelGroup style="padding: 10px;">
                 		<ice:tree id="root"
                 	        	value="#{root.model}"
                 	        	var="item"
                 	        	hideRootNode="false"
                 	        	hideNavigation="false"
                 	        	imageDir="./css/css-images/" >
                 	    		<ice:treeNode>                    
             		    		    <f:facet name="icon">
 			    		    	<ice:panelGroup style="display: inline;">
 			                         	<h:graphicImage value="#{item.userObject.icon}"/>
 			    	            	</ice:panelGroup>
             				    </f:facet>
                 	        	    <f:facet name="content">
                 	        		<ice:panelGroup style="display: inline;">           
                 	        		        <ice:commandLink id="cl" actionListener="#{item.userObject.nodeSelected}">
 								<ice:outputText id="TreeNode" value="#{item.userObject.text}"/>
                 	        			</ice:commandLink>
                 	        	    	</ice:panelGroup>
                 	        	    </f:facet>
                 	    		</ice:treeNode>
                 		</ice:tree>
                 	</ice:panelGroup>                	
                     </f:facet>	
                     <f:facet name="second">
               		<!-- Displayed Tabs -->              		
 			<ice:panelGroup style="padding: 10px;">
 			        <ice:panelTabSet var="tab"
 			                         value="#{dynamicTabbedPane.tabs}"
 			                         tabPlacement="top"
 			                         selectedIndex="#{dynamicTabbedPane.selectedTabIndex}"
 			                         summary="Selected Items1"
 			                         title="Selected Items2"
 			                         rendered="#{dynamicTabbedPane.numberOfTabs > 0}">
 			            <ice:panelTab label="#{tab.label}" title="#{tab.label}">
 			            <ice:outputText id="v" value="#{tab.content}"/>
 			            <c:if test="#{tab.content != null}">
 			            	<ice:outputText id="v2" value="#{tab.content}"/>
 	                          	<ui:insert>
 						<ui:include src="#{tab.content}"/>
 					</ui:insert>
 			            </c:if>
 			            </ice:panelTab>
 			        </ice:panelTabSet>
     			</ice:panelGroup>
     		   </f:facet>
                   </ice:panelDivider>
                 </ice:panelGroup>
 ...
 ...
 





Code:
 <ice:outputText id="v" value="#{tab.content}"/>
 <c:if test="#{tab.content != null}">
       	<ice:outputText id="v2" value="#{tab.content}"/>
  	<ui:insert>
 		<ui:include src="#{tab.content}"/>
 	</ui:insert>
 </c:if>
 


is not getting executed.

The tab.content is returning right jspx page, it is getting printed out in ice:outputText, but not shown in <ui:include> !!!
It is showing the tab header, but not the included page.

Marioko

Joined: 14/Nov/2006 00:00:00
Messages: 125
Offline


mmm rare.. :(

EDIT:
Remove ui:insert

also make sure that in include page you dont have <f:view> tags, normally in my include pages the root tag is a ice:panelGroup
balavenky


Joined: 04/Apr/2008 00:00:00
Messages: 37
Offline


Hi,
Nope..not working.

It is not printing any values if I have it like:

Code:
 <c:if test="#{tab.content != null}"> 
    <ice:outputText id="v2" value="#{tab.content}"/>
 	<ui:insert>
 		<ui:include src="#{tab.content}"/>
 	</ui:insert>
 </c:if>
 


If I move that <ice:outputText..> out of <c:if..> it prints the name of the page:
Code:
 <ice:outputText id="v2" value="#{tab.content}"/>
 <c:if test="#{tab.content != null}"> 
 	<ui:insert>
 		<ui:include src="#{tab.content}"/>
 	</ui:insert>
 </c:if>
 


so, the value is not null for tab.content, then why it is failing the c:if condition?


If I have something like this (without if condition):
Code:
 	<ui:insert>
 		<ui:include src="test1.jspx"/>
 	</ui:insert>
 

it prints correctly with out any error!!


But if I have something like this:

Code:
 	<ui:insert>
 		<ui:include src="#{tab.content}"/>
 	</ui:insert>
 


it is throwing following exception: (may be because tab.content is not valid???), but it is having the page name!!

Code:
 20:35:56,881 INFO  [STDOUT] Added a new tab id=2-1010-formula_0-1, label=formula_0, content=formula.jspx
 20:36:40,537 ERROR [D2DFaceletViewHandler] Problem in renderResponse: /tree.jspx @35,57 value="#{root.model}" Could not
 Resolve Variable [Overflow]: root
 com.sun.facelets.tag.TagAttributeException: /tree.jspx @35,57 value="#{root.model}" Could not Resolve Variable [Overflow
 ]: root
         at com.sun.facelets.tag.TagAttribute.getValueExpression(TagAttribute.java:259)
         at com.sun.facelets.tag.jsf.ComponentRule$ValueBindingMetadata.applyMetadata(ComponentRule.java:90)
         at com.sun.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:36)
         at com.sun.facelets.tag.MetaTagHandler.setAttributes(MetaTagHandler.java:62)
         at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:144)
 ....
 ....
 ....
         at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
         at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
         at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
         at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
         at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:144)
         at com.sun.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:60)
         at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:73)
         at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
 Caused by: javax.el.ELException: Could not Resolve Variable [Overflow]: root
         at com.sun.facelets.el.VariableMapperWrapper.resolveVariable(VariableMapperWrapper.java:64)
         at com.sun.facelets.el.VariableMapperWrapper.resolveVariable(VariableMapperWrapper.java:60)
         at com.sun.facelets.el.VariableMapperWrapper.resolveVariable(VariableMapperWrapper.java:60)
         at com.sun.facelets.el.VariableMapperWrapper.resolveVariable(VariableMapperWrapper.java:60)
         at com.sun.facelets.el.VariableMapperWrapper.resolveVariable(VariableMapperWrapper.java:60)
         at com.sun.facelets.el.VariableMapperWrapper.resolveVariable(VariableMapperWrapper.java:60)
         at com.sun.facelets.el.VariableMapperWrapper.resolveVariable(VariableMapperWrapper.java:60)
 ....
 ....
 ....
 at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
         at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
         at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
         at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
         at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
         ... 1 more
 Caused by: java.lang.StackOverflowError
         at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:393)
         at java.lang.StringBuffer.append(StringBuffer.java:225)
         at com.sun.facelets.el.VariableMapperWrapper.resolveVariable(VariableMapperWrapper.java:64)
         at com.sun.facelets.el.VariableMapperWrapper.resolveVariable(VariableMapperWrapper.java:60)
         at com.sun.facelets.el.VariableMapperWrapper.resolveVariable(VariableMapperWrapper.java:60)
 


Marioko

Joined: 14/Nov/2006 00:00:00
Messages: 125
Offline


try removing ui:insert tags..

Also check if there is more ui:includes and check for null,
bmaizel

Joined: 19/Sep/2007 00:00:00
Messages: 46
Offline


The <c:if> does not work in your case, because the condition in it
is only evaluated once, when facelets builds the component tree.
Here is an article about jstl tags in facelets, which explains it:

http://www.ilikespam.com/blog/c:foreach-vs-ui:repeat-in-facelets

Make sure the tab.content has a default value, and everything will work :)

Regards,
Boris Maizel
Marioko

Joined: 14/Nov/2006 00:00:00
Messages: 125
Offline


nice article i dont know that, this will improve my web.. thanks..

the thing is repleace the

<c:if test="#{tree.content!=null}">.. </c:if>

with

<ui:fragment rendered="#{tree.content!=null}">...</ui:fragment>

and should work.
balavenky


Joined: 04/Apr/2008 00:00:00
Messages: 37
Offline


Nope.. I am still getting the same EXCEPTION. It is complaining about

javax.faces.FacesException: Problem in renderResponse: /tree.jspx @35,57 value="#{root.model}" Could not Resolve Variable [Overflow]: root


I changed it to :

Code:
 <f:facet name="first">	             	
     <ice:panelGroup style="padding: 10px;">
         <ice:tree id="root" value="#{root.model}" var="item" hideRootNode="false" hideNavigation="false"                 	        	imageDir="./css/css-images/" >
 	    <ice:treeNode>                    
                 <f:facet name="icon">
  		    	<ice:panelGroup style="display: inline;">
                        	   <h:graphicImage value="#{item.userObject.icon}"/>
  			</ice:panelGroup>
              	</f:facet>
                 <f:facet name="content">
                      <ice:panelGroup style="display: inline;">           
                          <ice:commandLink id="cl" actionListener="#{item.userObject.nodeSelected}">
  	  		     <ice:outputText id="TreeNode" value="#{item.userObject.text}"/>
                           </ice:commandLink>
                      </ice:panelGroup>
                 </f:facet>
              </ice:treeNode>
          </ice:tree>
     </ice:panelGroup>                	
 </f:facet>	
 <f:facet name="second">
    <!-- Displayed Tabs -->              		
 	<ice:panelGroup style="padding: 10px;">
 	   <ice:panelTabSet var="tab" value="#{dynamicTabbedPane.tabs}" tabPlacement="top" selectedIndex="#{dynamicTabbedPane.selectedTabIndex}"  summary="Selected Items1"  title="Selected Items2"  rendered="#{dynamicTabbedPane.numberOfTabs > 0}">
 	            <ice:panelTab label="#{tab.label}" title="#{tab.label}">
 		            	<ui:fragment rendered="${tab.content != null}">
 					<ui:include src="${tab.content}"/>
 		            	</ui:fragment>
 	            </ice:panelTab>
            </ice:panelTabSet>
     </ice:panelGroup>
 </f:facet>
 
balavenky


Joined: 04/Apr/2008 00:00:00
Messages: 37
Offline


I split the jspx in to three files.

main.jspx:


Code:
<f:view xmlns:f="http://java.sun.com/jsf/core" 
         xmlns:h="http://java.sun.com/jsf/html" 
         xmlns:ice="http://www.icesoft.com/icefaces/component" 
         xmlns:ui="http://java.sun.com/jsf/facelets" 
         xmlns:c="http://java.sun.com/jstl/core" 
         xmlns:fn="http://java.sun.com/jsp/jstl/functions">
 
     <ice:outputDeclaration doctypeRoot="HTML"
         doctypePublic="-//W3C//DTD HTML 4.01 Transitional//EN"
         doctypeSystem="http://www.w3.org/TR/html4/loose.dtd" />
 
     <html>
     <head>
         <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></meta>
         <title>My Tree</title>
         <link href="./css/xp.css" rel="stylesheet" type="text/css" />
     </head>
     <body style="background-color:#ffffdd; font-size:.75em">    
         <ice:form id="mainForm">
             <ice:panelGroup styleClass="componentBox">  
     	        <ice:panelGroup styleClass="componentBox" style="text-align: center">
 	            <ice:outputText value="My Tree"/>
     		</ice:panelGroup>
     		<ice:panelGroup style="height:5%" />
     		<ice:panelGroup styleClass="componentBox">
             	   <ice:panelDivider dividerPosition="20" id="paneldiv" orientation="vertical" style="width: 100%; height: 750px;">	                    
 			<f:facet name="first">	             	
 				<!-- Display Tree -->
 				<ice:panelGroup style="padding: 10px;">
 					<ui:include src="tree.jspx"/>					
 	                    	</ice:panelGroup>                	
                         </f:facet>	
                         <f:facet name="second">
                   		<!-- Display selected nodes in tabs -->              		
 	    			<ice:panelGroup style="padding: 10px;">
 	    			        <ui:include src="tabbedPane.jspx"/>
         			</ice:panelGroup>
 	       		   </f:facet>
                    </ice:panelDivider>
                 </ice:panelGroup>
             </ice:panelGroup>
         </ice:form>
     </body>
     </html>
 </f:view>



tree.jspx :

Code:
<f:view xmlns:f="http://java.sun.com/jsf/core" 
         xmlns:h="http://java.sun.com/jsf/html" 
         xmlns:ice="http://www.icesoft.com/icefaces/component" 
         xmlns:ui="http://java.sun.com/jsf/facelets" 
         xmlns:c="http://java.sun.com/jstl/core" 
         xmlns:fn="http://java.sun.com/jsp/jstl/functions">
            
     <ice:tree id="root" value="#{root.model}" var="item" hideRootNode="false" hideNavigation="false" imageDir="./css/css-images/">
 	<ice:treeNode>                    
 		<f:facet name="icon">
 			<ice:panelGroup style="display: inline;">
 				<h:graphicImage value="#{item.userObject.icon}"/>
 			</ice:panelGroup>
 		</f:facet>
 		<f:facet name="content">
 			<ice:panelGroup style="display: inline;">           
 				<ice:commandLink id="cl" actionListener="#{item.userObject.nodeSelected}">
 					<ice:outputText id="TreeNode" value="#{item.userObject.text}"/>
 				</ice:commandLink>
 			</ice:panelGroup>
 		</f:facet>
 	</ice:treeNode>
     </ice:tree>
     
 </f:view>



right side panel (tabbedPane.jspx):

Code:
<f:view xmlns:f="http://java.sun.com/jsf/core" 
         xmlns:h="http://java.sun.com/jsf/html" 
         xmlns:ice="http://www.icesoft.com/icefaces/component" 
         xmlns:ui="http://java.sun.com/jsf/facelets" 
         xmlns:c="http://java.sun.com/jstl/core" 
         xmlns:fn="http://java.sun.com/jsp/jstl/functions">
         
         <c:if test="#{dynamicTabbedPane.numberOfTabs > 0}">
             <ice:panelTabSet var="tab" value="#{dynamicTabbedPane.tabs}" tabPlacement="top"
 			selectedIndex="#{dynamicTabbedPane.selectedTabIndex}"
 			summary="Selected Items1" title="Selected Items2">
 		<ice:panelTab label="#{tab.label}" title="#{tab.label}">
 			<ui:include src="#{tab.content}"/>
 			<!--	
 			<ice:outputText value="#{tab.content}"/>
 			-->
 		</ice:panelTab>
 	   </ice:panelTabSet>
 	</c:if>
 </f:view>



In the tabbedPane.jspx, again the <ice:outputText value="#{tab.content}"/>
prints the value, but <ui:include src="#{tab.content}"/> throws an exception. Any ideas????. I tried with ui:fragment also, that didn't help.


philip.breau


Joined: 08/May/2006 00:00:00
Messages: 2989
Offline


Make sure that #{tab.content}, always resolves to non-null. So, you might need to initialize it to a 'blank.jspx' (or whatever) before setting it dynamically.

Philip

.
balavenky


Joined: 04/Apr/2008 00:00:00
Messages: 37
Offline


nope..I tried everything, setting blank.jspx (and I have valid blank.jspx page), checking for not-null, used ui:fragment, c:if also. nothing helped :-(
Marioko

Joined: 14/Nov/2006 00:00:00
Messages: 125
Offline


heeeeeeeyyy remove those f:view from include pages.. Only main page should have f:view.

If you want you can use f:subview instead f:view in your include pages..
balavenky


Joined: 04/Apr/2008 00:00:00
Messages: 37
Offline


thanks Marioko..but that did not help either. Here are my jspx files..let me
know what I am doing wrong. <ui.include> works when I explicitly give out
the page name, but it is throwing the above exceptions (scroll-up) when I
tried to insert the page dynamically. The value I am inserting for the page IS
NOT NULL!!.
 Filename jspx.jar [Disk] Download
 Description
 Filesize 4 Kbytes
 Downloaded:  312 time(s)

balavenky


Joined: 04/Apr/2008 00:00:00
Messages: 37
Offline


I am stuck with this problem for last 2-3 days. Do you know why this is happening?

Code:
<c:set var="foo" scope="page" value="#{tab.content}"/>
 <ice:outputText value="#{foo}"/>
 <ui:include src="#{foo}"/>
 


ice:outputText prints a NON-NULL value and
ui:include throws an exception !!!
 
Forum Index -> General Help Go to Page: 1, 2 Next 
Go to:   
Powered by JForum 2.1.7ice © JForum Team