voyent
Messages posted by: tchoesang  XML
Profile for tchoesang -> Messages posted by tchoesang [10]
Author Message
Hi!

In our project we want to use icefaces and at the same time, we are interested in using the WIZARD component of woodstock. The idea was to click on a ice:commandbutton and to open the wizard component in a new page. Is there any way to have woodstock and icefaces together in one project and not in the same page.

I get the following error:

Code:
 SEVERE: Servlet.service() for servlet Faces Servlet threw exception
 java.lang.IllegalStateException: ICEfaces requires the PersistentFacesServlet. Please check your web.xml servlet mappings
 	at com.icesoft.faces.context.DOMResponseWriter.<init>(DOMResponseWriter.java:112)
 	at com.icesoft.faces.context.DOMContext.createTemporaryDOMResponseWriter(DOMContext.java:139)
 	at com.icesoft.faces.context.DOMContext.attachDOMContext(DOMContext.java:107)
 	at com.icesoft.faces.renderkit.dom_html_basic.TextRenderer.renderUIOutput(TextRenderer.java:89)
 	at com.icesoft.faces.renderkit.dom_html_basic.TextRenderer.renderEnd(TextRenderer.java:66)
 	at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeEnd(DomBasicRenderer.java:126)
 	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:833)
 	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:896)
 	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
 	at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:244)
 	at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:175)
 	at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:153)
 	at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
 	at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
 	at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
 	at com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.render(PartialTraversalLifecycle.java:106)
 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 	at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:267)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
 	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
 	at java.lang.Thread.run(Unknown Source)
 


I am using just-ice.jar instead of icefaces.jar and i have PersistentFacesServlet in web.xml

Code:
 <?xml version="1.0" encoding="UTF-8"?>
 <web-app xmlns="http://java.sun.com/xml/ns/javaee"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5"
 	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee   http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
 	<context-param>
 		<param-name>javax.faces.CONFIG_FILES</param-name>
 		<param-value>/WEB-INF/faces-config.xml</param-value>
 	</context-param>
 	<filter>
 		<filter-name>UploadFilter</filter-name>
 		<filter-class>com.sun.webui.jsf.util.UploadFilter</filter-class>
 		<init-param>
 			<param-name>maxSize</param-name>
 			<param-value>1000000</param-value>
 		</init-param>
 		<init-param>
 			<param-name>sizeThreshold</param-name>
 			<param-value>4096</param-value>
 		</init-param>
 	</filter>
 	<filter-mapping>
 		<filter-name>UploadFilter</filter-name>
 		<servlet-name>Faces Servlet</servlet-name>
 	</filter-mapping>
 	<servlet>
 		<servlet-name>ThemeServlet</servlet-name>
 		<servlet-class>com.sun.webui.theme.ThemeServlet</servlet-class>
 		<load-on-startup>2</load-on-startup>
 	</servlet>
 	<servlet-mapping>
 		<servlet-name>ThemeServlet</servlet-name>
 		<url-pattern>/theme/*</url-pattern>
 	</servlet-mapping>
 	<servlet>
 		<servlet-name>Persistent Faces Servlet</servlet-name>
 		<servlet-class>
 			com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet
 		</servlet-class>
 		<load-on-startup>1</load-on-startup>
 	</servlet>
 	<servlet>
 		<servlet-name>Blocking Servlet</servlet-name>
 		<servlet-class>
 			com.icesoft.faces.webapp.xmlhttp.BlockingServlet
 		</servlet-class>
 		<load-on-startup>1</load-on-startup>
 	</servlet>
 	<servlet-mapping>
 		<servlet-name>Persistent Faces Servlet</servlet-name>
 		<url-pattern>*.iface</url-pattern>
 	</servlet-mapping>
 	<servlet-mapping>
 		<servlet-name>Persistent Faces Servlet</servlet-name>
 		<url-pattern>/xmlhttp/*</url-pattern>
 	</servlet-mapping>
 	<servlet-mapping>
 		<servlet-name>Blocking Servlet</servlet-name>
 		<url-pattern>/block/*</url-pattern>
 	</servlet-mapping>
 	<servlet>
 		<servlet-name>Faces Servlet</servlet-name>
 		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
 		<init-param>
 			<param-name>javax.faces.LIFECYCLE_ID</param-name>
 			<param-value>com.sun.faces.lifecycle.PARTIAL</param-value>
 		</init-param>
 		<load-on-startup>1</load-on-startup>
 	</servlet>
 
 	<servlet-mapping>
 		<servlet-name>Faces Servlet</servlet-name>
 		<url-pattern>*.faces</url-pattern>
 	</servlet-mapping>
 	<welcome-file-list>
 		<welcome-file>index.jsp</welcome-file>
 	</welcome-file-list>
 </web-app>
 
 



looking forward to some opinions.
Hi!

I am working on a custom component (dhtmlxtree). I have successfully created a custom component with html renderer for the dhtmlxtree and now i wanted to migrate to Direct-to-DOM rendering. But i get a casting error. My java class and renderer class are below with the tag class *.tld

Any idea is appreciated.

Thanks,
Chö

Code:
 package ddomDtree;
 
 import javax.el.ValueExpression;
 import javax.faces.component.UICommand;
 import javax.faces.context.FacesContext;
 
 public class Dhtmlxtree extends UICommand{
 
 	private String id;
 	public static final String COMPONENT_TYPE = "DhtmlxtreeDDom";
     public static final String DEFAULT_RENDERER_TYPE = "DhtmlxtreeDDomRenderer";
     
 	public static String getCOMPONENT_TYPE() {
 		return COMPONENT_TYPE;
 	}
 
 	public static String getDEFAULT_RENDERER_TYPE() {
 		return DEFAULT_RENDERER_TYPE;
 	}
 
 	public String getId() {
         ValueExpression vb = getValueExpression("id");
         if (vb != null) {
             id = vb.getValue(FacesContext.getCurrentInstance().getELContext()).toString();
         }
 
         return id;
     }
 
     public void setId(String id) {
         ValueExpression vb = getValueExpression("id");
         if (vb != null) {
             vb.setValue(FacesContext.getCurrentInstance().getELContext(),id);
         }
         this.id = id;
     }
 }
 
 


Code:
 package ddomDtree;
 
 import java.io.IOException;
 
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 
 
 
 import org.w3c.dom.Element;
 
 import com.icesoft.faces.context.DOMContext;
 import com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer;
 import com.icesoft.faces.renderkit.dom_html_basic.HTML;
 
 public class DhtmlxtreeRenderer extends DomBasicRenderer {
 	
 	public void decode(FacesContext facesContext, UIComponent uiComponent) {
 
     }
 
     public void encodeBegin(FacesContext facesContext, UIComponent uiComponent) throws IOException {
     	Dhtmlxtree dtree = (Dhtmlxtree) uiComponent;
     	
     	DOMContext domContext = DOMContext.attachDOMContext(facesContext, uiComponent);
     	 Element container = domContext.createRootElement(HTML.DIV_ELEM);
     	 container.setAttribute("id", dtree.getId());
     	 domContext.stepOver();
     }
 
 }
 
 


dhtmlxtree.tld
Code:
 <tag>
   <name>dhtmlxtreeDDOM</name>
   <tag-class>ddomDtree.Dhtmlxtree</tag-class>
    <body-content>empty</body-content>
   <attribute>
    <name>id</name>
    <rtexprvalue>false</rtexprvalue>
    <description>id of the tree</description>
   </attribute>
  </tag>
 


Error message:
Code:
 SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
 javax.faces.FacesException: java.lang.ClassCastException: ddomDtree.DhtmlxtreeRenderer cannot be cast to javax.faces.render.RenderKit
 	at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:310)
 	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
 	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
 	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
 	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
 	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
 	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
 	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
 	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
 	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
 	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
 	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
 	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
 	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
 	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
 	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
 	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
 	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
 	at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 	at java.lang.reflect.Method.invoke(Unknown Source)
 	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
 	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
 Caused by: java.lang.ClassCastException: ddomDtree.DhtmlxtreeRenderer cannot be cast to javax.faces.render.RenderKit
 	at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:899)
 	at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:379)
 	at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:306)
 	... 24 more
 
Please find as attached the console print out of the error
Hi!

I have created a custom component (dhtmlxtree). The component itself when tested in a icefaces facelet project with its source code, it works and i am also able to deploy it as a war file.
But when i try to use the jar file and use it as a component in another icefaces facelet project: it gives error

SEVERE: Can't find TLD for location [http://www.w3.org/1999/xhtml]. JAR containing the TLD may not be in the classpath
Jul 1, 2008 11:05:54 AM com.icesoft.faces.component.style.OutputStyleRenderer encodeEnd

SEVERE: Error in OutputStyleRenderer
org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted.


The TLD file for the component is under: META-INF/facelet/dhtmlxtree.taglib.xml

Code:
 <?xml version="1.0"?>
 <!DOCTYPE facelet-taglib PUBLIC
         "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
         "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
 
 <facelet-taglib>
     <namespace>icedhtmlxtree</namespace>
     <tag>
         <tag-name>dhtmlxtree</tag-name>
         <component>
             <component-type>dhtmlxtree.DhtmlxtreeTag</component-type>
         </component>
     </tag>  
 </facelet-taglib>
 


Code:
 package dhtmlxtree;
 import javax.el.ValueExpression;
 import javax.faces.component.UICommand;
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.webapp.UIComponentTag;
 
 
 public class DhtmlxtreeTag extends UIComponentTag{
 	private String id;
 	
 	
 	public String getId() {
 		
         return id;
 	      
 	}
 
 	public void setId(String id) {
 		this.id = id;
 	}
 
 	
 
 	public void release() {
 		// the super class method should be called 
 		super.release();
 		id = null;
 		
 	}
 	
 	protected void setProperties(UIComponent component) {
 		// the super class method should be called 
 		super.setProperties(component);
 		if(id != null)
 			component.getAttributes().put("id", id);
 		
 		
 		
 	}
 	public String getComponentType() {
 		return "dhtmlxtree";
 	}
 
 	public String getRendererType() {
 		// null means the component renders itself
 		return null;
 	}
 
 }
 
 


Code:
 package dhtmlxtree;
 import java.io.IOException;
 import javax.faces.component.UIOutput;
 import javax.faces.context.FacesContext;
 import javax.faces.context.ResponseWriter;
 
 
 public class UIDhtmlxtree extends UIOutput {
 	
 	
 	public void encodeBegin(FacesContext context) throws IOException {
 		
 		ResponseWriter writer = context.getResponseWriter();
 		writer.startElement("div", this);
 			
 		writer.startElement("div", this);
 		String id = (String)getAttributes().get("id");		
 		if(id != null )
 			writer.writeAttribute("id", id, null);
 
 		writer.endElement("div");
 		
 	    
 	}
 
 	public void encodeEnd(FacesContext context) throws IOException {
 		ResponseWriter writer = context.getResponseWriter();
 	    writer.endElement("div");
 	}
 }
 


Any help would be great.

Thanks Chö
Hi Guys,

I am trying to create custom component of dhtmlxtree. For this custom tree, i have 2 attributes, id and style. I get the following error of argument type mismatch. i dont understand why?? As far as i can see, i am using String as argument.

Caused by: java.lang.IllegalArgumentException: Cannot invoke com.icecomponents.dhtmlxtree.DhtmlxTree.setStyle - argument type mismatch
at org.apache.commons.digester.Digester.createSAXException(Digester.java:3181)
at org.apache.commons.digester.Digester.createSAXException(Digester.java:3207)
at org.apache.commons.digester.Digester.startElement(Digester.java:1456)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1785)
at com.icesoft.faces.webapp.parser.Parser.parse(Parser.java:126)
at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:504)


my dhtmlxtree tag looks like this in index.xhtml

Code:
<scholion:dhtmlxtree id="dhtmlx" style="width:250; height:218;background-color:#f5f5f5;border :1px solid Silver;">
        </scholion:dhtmlxtree>   


And the getter and setter for style looks like this: Dhtmlxtree.java

Code:
public String getStyle() {
         if (style != null) {
             return style;
         }
       
         return "width:250; height:218;background-color:#f5f5f5;border :1px solid Silver;";
     }
 
     public void setStyle(String style) {
         this.style = style;
     }


Any Clue where i am making the mistake?

thanks for your time.

chö
Hi;

here is my email add: tchoesang@gmail.com

thanks,
choesang
Hi,

I know that Iceface provides the tree component but we have already implemented a set of functions with dhtmlxtree. Now we would like to have more flexibility in the future and would like to migrate on to Icefaces.

To check the feasibility of the migration on to Icefaces, i wanted to see how to make a custom component of the dhtmlxtree and to make a prototype using such a custom component.

thanks,
choesang
Hi George,

I am trying to integrate a java script tree component (http://www.dhtmlx.com/docs/products/dhtmlxTree/) in an iceface project. I found your post the closest tutorial on how to do it.

I downloaded your project from this post and i tried to compile the code in eclipse 3.3 with tomcat 6.0.

The project layout in eclipse looks like this:

-[iceDojo]
+[.metadata]
+[.settings]
+[build]
-[iceDojo]
+[dijit]
+[dojo]
+[dojox]
+[util]
-[src]
-[lu]
-[etat]
-[pch]
-[icefaces]
.....class
.....class
-[WebContent]
+[META-INF]
-[WEB-INF]
[lib]
faces-config.xml
web.xml
index.xhtml

ps: i have attached a screenshot of the layout

I have the following questions to ask:

1. i am not able to insert in faces-config.xml the managed beans like fishEyeBean or spinBean. Is it because it doesnt see the source files??

2. I get a HTTP status 404 resource not found? I am using *.xhtml file and it is defined in the web.xml file as default file


Can you throw me any light and tell me where i am making mistakes.

regards,
choesang




I solved the problem:

added in web.xml
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jspx</url-pattern>
</servlet-mapping>

Made sure that i have the following jars in my WEB-INF/lib
backport-util-concurrent.jar
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-discovery.jar
commons-fileupload.jar
commons-logging.jar
icefaces.jar
jsf-api-1.2.jar
jsf-impl-1.2.jar
jstl.jar

Hi,
I am trying to run the timezone tutorial under eclipse 3.3 with tomcat6. I am creating a new jsf project and trying to recreate the project inside eclipse. I succeeded in running the timezone1 but when i try to run timezone2, than i get an error:

exception

javax.servlet.ServletException: ICEfaces requires the PersistentFacesServlet. Please check your web.xml servlet mappings
javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)


root cause

java.lang.IllegalStateException: ICEfaces requires the PersistentFacesServlet. Please check your web.xml servlet mappings
com.icesoft.faces.context.DOMResponseWriter.<init>(DOMResponseWriter.java:112)
com.icesoft.faces.context.DOMContext.createTemporaryDOMResponseWriter(DOMContext.java:139)
com.icesoft.faces.context.DOMContext.attachDOMContext(DOMContext.java:107)
com.icesoft.faces.renderkit.dom_html_basic.TextRenderer.renderUIOutput(TextRenderer.java:89)
com.icesoft.faces.renderkit.dom_html_basic.TextRenderer.renderEnd(TextRenderer.java:66)
com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeEnd(DomBasicRenderer.java:126)
javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:833)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:896)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:244)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:175)
com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:153)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)

Can you please throw some light at where i am making the mistake.

Thanks,
choesang

PS: please find my web.xml file as attached
 
Profile for tchoesang -> Messages posted by tchoesang [10]
Go to:   
Powered by JForum 2.1.7ice © JForum Team