voyent
How to disable icefaces Direct-to-DOM renderers  XML
Forum Index -> General Help
Author Message
swamigee

Joined: 24/Apr/2007 00:00:00
Messages: 11
Offline


I have icefaces in my application. I would like to have a jsf page that is not rendered by icefaces. I followed the instructions in http://www.icefaces.org/docs/v1_5_3/htmlguide/devguide/keyConcepts12.html#1043744
Use "just-ice.jar" rather than "icefaces.jar"
I configured in web.xml
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jspx</url-pattern>
</servlet-mapping>

<!-- Persistent Faces Servlet Mappings -->
<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>/xmlhttp/*</url-pattern>
</servlet-mapping>

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

But when I invoke the jspx page I get the following exception

java.lang.IllegalStateException: ICEfaces requires the PersistentFacesServlet. Please check your web.xml servlet mappings
com.icesoft.faces.context.DOMResponseWriter.writeDOM(DOMResponseWriter.java:322)
com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:161)
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
org.apache.myfaces.webapp.MyFacesServlet.service(MyFacesServlet.java:74)
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)

Any ideas how to resolve this?
Thanks.
darren.northcott

Joined: 02/Jan/2007 00:00:00
Messages: 17
Offline


I will look int this further, however, try adding this to your web.xml...

<servlet-mapping>
<servlet-name>Blocking Servlet</servlet-name>
<url-pattern>/block/*</url-pattern>
</servlet-mapping>
swamigee

Joined: 24/Apr/2007 00:00:00
Messages: 11
Offline


I do have this mapping for Blocking Servlet already.
swamigee

Joined: 24/Apr/2007 00:00:00
Messages: 11
Offline


More info. The faces-config.xml has this entry.
<application>
...
<view-handler>
com.icesoft.faces.facelets.D2DFaceletViewHandler
</view-handler>


</application>
darren.northcott

Joined: 02/Jan/2007 00:00:00
Messages: 17
Offline


I am still looking into this issue, however, check out the migration tutorial on the .org. it may be of some help..
darren.northcott

Joined: 02/Jan/2007 00:00:00
Messages: 17
Offline


Ok, think we worked it out here:

in your web.xml:
instead of

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

map jsf to the faces servelt as such:

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

Then, do all your non icefaces work on standard jsp pages.

Give that a try and let us know. Hope this helps
swamigee

Joined: 24/Apr/2007 00:00:00
Messages: 11
Offline


I made the change that you suggested and tried still getting the same exception.

--My sample jsp file , ReportForm.jsp
--and I invoke the URL https://localhost:8443/ReportForm.jsf

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<html>
<h1>Report</h1>

<h:form>
<f:view>
<h:selectOneRadio>
<h:selectOneRadio value="#{ReportFormBean.reportType}">

<f:selectItems value="#{ReportFormBean.deviceTypes}" />
</h:selectOneRadio>
<h:commandButton value="Print" type="submit" action="#{ReportFormBean.execute}"></h:commandButton>
</h:selectOneRadio>
</f:view>
</h:form>
</html>
darren.northcott

Joined: 02/Jan/2007 00:00:00
Messages: 17
Offline


strange, I used your code in a similar jsp, but everything seemed to work, perhaps there is some underlying issue here. could you send a zip of your project to my email address and I will try to figure this out
darren.northcott

Joined: 02/Jan/2007 00:00:00
Messages: 17
Offline


here is the simple jsf code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<html>
<h1>Report</h1>
<f:view>
<h:form>


<h:outputText value="dddd"/>



<h:commandButton value="Print" type="submit" ></h:commandButton>


</h:form>
</f:view>
</html>


and here is my web.xml:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">



<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>



<context-param>
<param-name>javax.faces.application.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>

<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>true</param-value>
</context-param>


<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup> 1 </load-on-startup>
</servlet>

<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>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>

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


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

<session-config>
<session-timeout>5</session-timeout>
</session-config>

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

</web-app>
swamigee

Joined: 24/Apr/2007 00:00:00
Messages: 11
Offline


The difference in my web.xml is I have this entry.
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>

Looks like this overides the following mapping.
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
If the javax.faces.DEFAULT_SUFFIX is removed , I get

ERROR [com.icesoft.faces.facelets.D2DFaceletViewHandler] Problem in renderResponse: replacement
java.lang.NullPointerException: replacement
at java.util.regex.Matcher.replaceFirst(Matcher.java:844)
at java.lang.String.replaceFirst(String.java:1967)
at com.icesoft.faces.facelets.D2DFaceletViewHandler.getRenderedViewId(D2DFaceletViewHandler.java:232)
at com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:246)
at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:149)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:268)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
at com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet.service(PersistentFacesServlet.java:402)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

Any suggestions how to invoke jsps without being rendered by D2DFaceletViewHandler?
darren.northcott

Joined: 02/Jan/2007 00:00:00
Messages: 17
Offline


This may or may not help, check to see if you have the following in your faces-config, if not try adding it to see if it solves the problem:

<application>
<view-handler>
com.icesoft.faces.facelets.D2DFaceletViewHandler
</view-handler>
</application>

also, we have a ready-made app that uses myfaces and just-ice, pm me if you are interested in taking a look at it.
swamigee

Joined: 24/Apr/2007 00:00:00
Messages: 11
Offline


I have that entry in faces-config already.
I would like to take a look at that app.
alejandrosv

Joined: 07/Jul/2008 00:00:00
Messages: 1
Offline


I have the same problem.
I'm trying to copy a xhtml file from a previous example proyect where I didn't use ICEFaces.
I start from the AppFuse JSF-Modular archetype... I have copy the "persons.xhtml", but it doesn't work.

Now, I have remove everything from the file, and just when I add the tag <h:form> to my xhtml file, I get the same exception that you say.
rainwebs


Joined: 24/Jul/2007 00:00:00
Messages: 237
Offline


AppFuse integration

ICEfaces book . ICEcube . ICEfusion . ICEfaces Technical Blog Award
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team