I cannot get the Richfaces wizard example to work in GateIn 3.1.
I am using JSF 1.2, Facelets 1.1.15, GateIn 3.1 GA, Richfaces 3.3.3, IE8.
I am reposting here as I have had good luck on stackoverflow in the past (originally posted on JBoss user forum but did not receive any responses).
I have created the files exactly as in the example but when I click Next button on the first page, the next page does not get included (display does not change).
I should add that I have the same problem trying to get Max Katz model wizard example described here:
http://mkblog.exadel.com/2010/06/richfaces-wizard-inside-modal-panel/
I am having same issue in IE8 and Chrome.
Note: I've also tried adding <redirect/> to the navigation-rules and when I click Next button then entire portlet goes to a blank page.
Is there any help in debugging this? I turned up log4j to DEBUG but don't see any hints as to what is wrong.
The other difference is that we use Spring.
Here is the faces-config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
version="1.2">
<application>
<view-handler>org.jboss.portletbridge.application.PortletViewHandler</view-handler>
<state-manager>org.jboss.portletbridge.application.PortletStateManager</state-manager>
</application>
<!-- SPRING INTEGRATION TO JSF -->
<application>
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
</application>
<application>
<locale-config>
<default-locale>en</default-locale>
<supported-locale>es</supported-locale>
<supported-locale>en</supported-locale>
</locale-config>
</application>
<application>
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
</application>
<managed-bean>
<managed-bean-name>profile</managed-bean-name>
<managed-bean-class>com.Profile</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>/richfaces/include/examples/wstep1.xhtml</from-view-id>
<navigation-case>
<from-outcome>next</from-outcome>
<to-view-id>/richfaces/include/examples/wstep2.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/richfaces/include/examples/wstep2.xhtml</from-view-id>
<navigation-case>
<from-outcome>previous</from-outcome>
<to-view-id>/richfaces/include/examples/wstep1.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>next</from-outcome>
<to-view-id>/richfaces/include/examples/finalStep.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/richfaces/include/examples/finalStep.xhtml</from-view-id>
<navigation-case>
<from-outcome>previous</from-outcome>
<to-view-id>/richfaces/include/examples/wstep2.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
Here is bean in spring-beans.xml:
<bean id="profile" class="com.Profile" scope="request" >
</bean>
Here is start.xhtml (exactly from demo):
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<style type="text/css">
.col1 { vertical-align:top; }
.col2 { vertical-align:top; width:450px; }
.wizard { width:400px; }
.wform td { vertical-align:top; }
.wfcol1 { text-align: right; white-space:nowrap;}
.wfcol2 { }
.wfcol3 { }
.s1row td { height:30px; }
.rich-message { color:red; }
.navPanel {
position:absolute;
bottom:0;
height:23px;
margin:0;
padding:2px;
}
</style>
<br/>
<h:panelGrid width="100%" columns="2" columnClasses="col1,col2">
<a4j:keepAlive beanName="profile" />
<rich:panel styleClass="wizard">
<f:facet name="header">
<h:outputText value="Using a4j:include for Wizard-like behaviour" />
</f:facet>
<h:form>
<a4j:include viewId="/richfaces/include/examples/wstep1.xhtml" />
</h:form>
</rich:panel>
</h:panelGrid>
<br/>
</ui:composition>
Here is wstep1.xhtml (this page gets loaded in portlet initially):
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<div style="position:relative;height:140px">
<h:panelGrid rowClasses="s1row" columns="3" columnClasses="wfcol1,wfcol2,wfcol3">
<h:outputText value="First Name:" />
<h:inputText id="fn" value="#{profile.firstName}" label="First Name" required="true" />
<rich:message for="fn" />
<h:outputText value="Last Name:" />
<h:inputText id="ln" value="#{profile.lastName}" label="Last Name" required="true" />
<rich:message for="ln" />
<h:outputText value="Company:" />
<h:inputText id="comp" value="#{profile.company}" label="Company" required="true" />
<rich:message for="comp"/>
</h:panelGrid>
<div class="navPanel" style="width:100%;">
<a4j:commandButton style="float:right" action="next" value="Next >>"/>
</div>
</div>
</ui:composition>
Here is portlet.xml:
<?xml version="1.0" encoding="UTF-8"?>
<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
version="2.0">
<portlet>
<portlet-name>Rule Portlet</portlet-name>
<display-name>Rule Editor</display-name>
<portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>
<init-param>
<name>javax.portlet.faces.defaultViewId.view</name>
<value>/start.xhtml</value>
</init-param>
<init-param>
<name>javax.portlet.faces.preserveActionParams</name>
<value>true</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
<title>Rule Editor</title>
</portlet-info>
</portlet>
</portlet-app>
Here is web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>Filter Portal</display-name>
<context-param>
<param-name>org.jboss.portletbridge.WRAP_SCRIPTS</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.portlet.faces.renderPolicy</param-name>
<param-value>ALWAYS_DELEGATE</param-value>
</context-param>
<context-param>
<param-name>org.ajax4jsf.RESOURCE_URI_PREFIX</param-name>
<param-value>rfRes</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.LoadStyleStrategy</param-name>
<param-value>ALL</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
<param-value>ALL</param-value>
</context-param>
<context-param>
<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>false</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-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>10</session-timeout>
</session-config>
<!-- Spring Configuration -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-beans.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<context-param>
<param-name>com.sun.faces.IS_SAVE_BINDINGS_STATE</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>facelets.BUILD_BEFORE_RESTORE</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>facelets.RESOURCE_RESOLVER</param-name>
<param-value>com.CustomResourceResolver</param-value>
</context-param>
</web-app>
I think there can be problem with three last params in your web.xml. They'r known to cause problems with AJAX (I also had these problems). There is only little documentation about these params. Although I found this comments about them:
<!-- Undocumented, so using "default"...(should be used in conjunction with following 2 parameters)
<context-param>
<param-name>com.sun.faces.IS_SAVE_BINDINGS_STATE</param-name>
<param-value>false</param-value>
</context-param>
-->
<!-- http://javaspecialist.wordpress.com/2010/05/30/performance-tuning-of-seam-jsf-richfaces-for-webapps/
BUILD_BEFORE_RESTORE:
Idea behind using buildBeforeRestore is to restore the view even if the associated session
has expired and thereby avoiding the ViewExpiredException.
Setting it to true, Facelets can build view before request processing
instead of state saving. But this will cause some other issues.
RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE:
In JSF 1.2 with Facelets, you can reduce the memory overhead by not saving
the ValueExpressions. But for this you also need to set
the BUILD_BEFORE_RESTORE to true, which can cause unpredictable behaviour
for the components.
This paramS from facelets is notorious for breaking some of the Ajax components.
Seen with Richfaces Ajax4jsf. There isn’t any documented work around for this.
Hence explicitly turn both BUILD_BE… and RECREATE… to false.
-->
And source of this knowledge:
http://code.google.com/p/java-education/source/browse/trunk/JPA-Spring-JSF/CZU-PEF-DataModelling/web-gui/src/main/webapp/WEB-INF/web.xml?spec=svn200&r=200
So I suggest commenting out this from your web.xml:
<context-param>
<param-name>facelets.BUILD_BEFORE_RESTORE</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>facelets.RESOURCE_RESOLVER</param-name>
<param-value>com.CustomResourceResolver</param-value>
</context-param>
Hope it will be of any help.
Related
I have 3 jsf pages :
welcome page : index.xhtml
second page : displayall.xhmtl containing a commandlink to the third page : login_jsf.xhtml
The problem is when I press navigator return button it's redirect to the welcome page instead of displayall.xhtml
here is the tag I use to redirect :
<p:commandLink id="login" action="login_jsf?faces-redirect=true" style="margin-right:20px">
<h:outputText value="Se connecter" />
</p:commandLink>
my web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>exemple_jpa</display-name>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
<context-param>
<param-name>com.sun.faces.numberOfViewsInSession</param-name>
<param-value>5</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.serializeServerState</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>primefaces.CLIENT_SIDE_VALIDATION</param-name>
<param-value>true</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
</web-app>
Add a navigation rule to your faces-config.xml (notice the "redirect" tag):
<navigation-rule>
<from-view-id>displayall.xhtml</from-view-id>
<navigation-case>
<from-outcome>login</from-outcome>
<to-view-id>login.xhtml</to-view-id>
<redirect />
</navigation-case>
</navigation-rule>
or make a navigation handler bean and call its related method from the commandLink:
#Named
#RequestScoped
public class NavigationHandler implements Serializable {
public String moveToLoginPage() {
return "login?faces-redirect=true";
}
}
and then:
<p:commandLink id="login" action="#{navigationHandler.moveToLoginPage}">
<h:outputText value="Se connecter" />
</p:commandLink>
I am wiritng a Portlet for Liferay and need the ace:fileEntry component. I already had some Issues I was finally able to solve. But now I'm facing a problem I can't understand.
When the viewpage where ace:fileEntry is included is openend, after plus minus 90 seconds there will be shown a popup with the message "Network Connection Interrupted" and I have to reload the page.
After some research I found the following lines in my browser-console:
[icepush.0086c.async-connection] closing previous connection...
[icepush.0086c.async-connection] connect...
[icepush.0086c.async-connection] empty response received
[icepush.0086c.async-connection] closing previous connection...
[icepush.0086c.async-connection] connect...
[icepush.0086c.async-connection] empty response received
[icepush.0086c.async-connection] closing previous connection...
[icepush.0086c.async-connection] connect...
[icepush.0086c.async-connection] empty response received
[icepush.0086c.async-connection] blocking connection stopped, too many empty responses received...
[icepush.0086c.async-connection] failed to connect, first retry...
[icepush.0086c] connection in trouble
[icepush.0086c.async-connection] closing previous connection...
[icepush.0086c.async-connection] connect...
[icepush.0086c.async-connection] empty response received
[icepush.0086c.async-connection] blocking connection stopped, too many empty responses received...
[icepush.0086c.async-connection] failed to connect, second retry...
[icepush.0086c] connection in trouble
[icepush.0086c.async-connection] closing previous connection...
[icepush.0086c.async-connection] connect...
[icepush.0086c.async-connection] empty response received
[icepush.0086c.async-connection] blocking connection stopped, too many empty responses received...
[icepush.0086c] connection to server was lost
I'm using the following Versions of Liferay and ICEFaces:
Liferay Portal 6.1.20-EE-GA2
Liferay-Faces-Bridge-Impl 3.1.2-ga3
ICEFaces 3.3.0
My web.xml looks like this:
<?xml version="1.0"?>
<web-app
version="3.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<!-- Instruct Mojarra to utilize JBoss-EL instead of the EL implementation provided by the servlet container. -->
<context-param>
<param-name>com.sun.faces.expressionFactory</param-name>
<param-value>org.jboss.el.ExpressionFactoryImpl</param-value>
</context-param>
<!-- Instruct ICEfaces to abstain from adding a random query parameter to resource URLs (which it does by default -->
<!-- in order to prevent caching of JavaScript resources like bridge.js in a servlet-based webapp). -->
<context-param>
<param-name>org.icefaces.uniqueResourceURLs</param-name>
<param-value>false</param-value>
</context-param>
<!-- Production wegen Test ob bestimmte Messages verschwinden -->
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Production</param-value>
</context-param>
<context-param>
<param-name>com.icesoft.faces.concurrentDOMViews</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.icefaces.mandatoryResourceConfiguration</param-name>
<param-value>dataTable richTextEntry fileEntry</param-value>
</context-param>
<!-- Although the FacesServlet will not be invoked by any portlet requests, it is required to initialize JSF. -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/icefaces/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Resource Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.CompatResourceServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>/xmlhttp/*</url-pattern>
</servlet-mapping>
<resource-ref>
<res-ref-name>mail/MailSession</res-ref-name>
<res-type>javax.mail.Session</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
My face-config.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
<application>
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
</application>
<lifecycle>
<phase-listener>com.liferay.faces.util.lifecycle.DebugPhaseListener</phase-listener>
<phase-listener>com.liferay.faces.util.lifecycle.ViewScopePhaseListener</phase-listener>
</lifecycle>
<navigation-rule>
<from-view-id>/views/*</from-view-id>
<navigation-case>
<from-outcome>warenkorb</from-outcome>
<to-view-id>/views/warenkorb.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>checkout</from-outcome>
<to-view-id>/views/bestellprozess.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>bestelluebersicht</from-outcome>
<to-view-id>/views/bestelluebersicht.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<to-view-id>/views/index.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/adminviews/*</from-view-id>
<navigation-case>
<from-outcome>neueKategorie</from-outcome>
<to-view-id>/adminviews/neueKategorie.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>verwaltungKategorie</from-outcome>
<to-view-id>/adminviews/verwaltungKategorie.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>neuerArtikel</from-outcome>
<to-view-id>/adminviews/neuerArtikel.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>absenderMail</from-outcome>
<to-view-id>/adminviews/absenderMail.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>bestaetigungsMail</from-outcome>
<to-view-id>/adminviews/bestaetigungsMail.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<to-view-id>/adminviews/index.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
My viewpage.xhtml where ace:fileEntry is placed looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ace="http://www.icefaces.org/icefaces/components"
xmlns:ice="http://www.icesoft.com/icefaces/component"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:body>
<ui:composition template="/adminviews/index.xhtml">
<ui:define name="content">
<ace:panel header="Neuen Artikel anlegen">
<ice:form>
<ace:textEntry id="artikelnr"
label="Artikelnummer:"
labelPosition="left"
required="true"
requiredMessage="required"
value="#{addingBean.newArtikel.artikelnummer}">
</ace:textEntry>
<br />
<ace:textEntry id="bezeichnung"
label="Bezeichnung:"
labelPosition="left"
required="true"
requiredMessage="required"
value="#{addingBean.newArtikel.bezeichnung}">
</ace:textEntry>
<br />
<ace:textEntry id="preis"
label="Einzelpreis (netto):"
labelPosition="left"
required="true"
requiredMessage="required"
value="#{addingBean.newArtikel.preis1}">
</ace:textEntry>
<br />
<ace:textEntry id="bestand"
label="Bestand:"
labelPosition="left"
required="true"
requiredMessage="required"
value="#{addingBean.newArtikel.bestand}">
</ace:textEntry>
<br />
<ace:textAreaEntry id="beschreibung"
label="Beschreibung:"
labelPosition="left"
value="#{addingBean.newArtikel.beschreibung}">
</ace:textAreaEntry>
<br />
<ace:simpleSelectOneMenu label="Steuerschlüssel:"
labelPosition="left"
value="#{addingBean.steuerId}"
required="true">
<f:selectItem itemValue="" itemLabel="bitte auswählen ..." />
<f:selectItems value="#{requestBean.allSteuerItems}"/>
</ace:simpleSelectOneMenu>
<br />
<ace:simpleSelectOneMenu label="Kategorie:"
labelPosition="left"
value="#{addingBean.kategorieId}">
<f:selectItem itemValue="null" itemLabel="keine Kategorie" />
<f:selectItems value="#{requestBean.allKategorieItems}" />
</ace:simpleSelectOneMenu>
<br />
<ice:commandButton value="Speichern"
actionListener="#{addingBean.addArtikel}"
action="default"/>
</ice:form>
<ice:form>
<ice:commandButton value="Abbrechen"
action="default"/>
</ice:form>
<h:form id="bildupload">
<ace:fileEntry id="bild"
label="Bildupload"
fileEntryListener="#{addingBean.bildListener}"
maxFileCount="1"
relativePath="/images/"/>
<h:commandButton value="Upload"/>
</h:form>
<ace:messages/>
</ace:panel>
</ui:define>
</ui:composition>
</h:body>
</html>
Does somebody of you know how to resolve the Problem or why this happens?
The Liferay Faces team has seen this happen in one of our test environments, and the workaround was to exclude the icepush.jar dependency from the project:
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>icefaces</artifactId>
<version>3.3.0</version>
<exclusions>
<exclusion>
<groupId>org.icepush</groupId>
<artifactId>icepush</artifactId>
</exclusion>
</exclusions>
</dependency>
I wrote a simple jsf web app on eclipse. My web app works fine when I run it on tomcat 7 server in eclipse. Now I am in the process of deploying it to a server host name = cheetah.arvixe.com.
to do this I have exported my web app as a war file and have unzipped this war file in the public_html folder of the arvixe server.
When I go to my website on my browswer, i get a blank page. When I look at the page source I see my index.xhtml with the jsf tags. I want to know why my page is not showing. Any ideas?
Here is my index.html code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<ui:composition template="/WEB-INF/templates/BasicTemplate.xhtml">
<ui:define name="content">
<h:form>
<h:panelGrid columns="2">
<h:outputText value="Name"></h:outputText>
<h:inputText id="userid" value="#{user2.userId }"></h:inputText>
<h:outputText value="Password"></h:outputText>
<h:inputSecret id="password" value="#{user2.pincode}"
required="true" requiredMessage= "#{vm['loginBean.password']}">
<h:messages for="password" style="color:red" />
</h:inputSecret>
</h:panelGrid>
<h:commandButton value="Register" action="query_results"></h:commandButton>
</h:form>
</ui:define>
</ui:composition>
</html>
and here is my web.xml code:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>Redlancelogin</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.xhtml</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<context-param>
<description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>resources.application</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
</web-app>
in my web-ing/lib i have the jsf-api.jar and jsf-imp.jar
please tell me why I keep getting a blank page when i deploy to the host server. Thank you in advance!!!!
I am running a web application using RichFaces 4.1.0, mojarra 2.0.2 and apache tomcat 6.0.32.
My app runs well in all the different browsers except IE9.
It stops working in IE 9 and does not generate any javascript error or tomcat logs.
It fails whenever an a4j re-render operation happens.
I cannot use due to design constraints the meta tag to set the IE9 in compatiblity mode.
Below is my code and web.xml:
<h:body>
<h:form>
<rich:tabPanel switchType="client">
<rich:tab header="Overview">
<span>Total Number of Applications</span>
</rich:tab>
<rich:tab header="Options" onheaderclick="refreshOptions();" >
<h:outputText value="Logging Level:" />
<rich:select id="optionsLogLevel"
value="#{optionsBean.logLevel}"
required="true"
requiredMessage="Logging Level is required">
<f:selectItems value="#{optionsBean.logLevelsList}" />
</rich:select>
</rich:tab>
</rich:tabPanel>
<a4j:jsFunction name="refreshOptions"
action="#{optionsBean.refreshOptions}"
render="optionsLogLevel" execute="#this" />
</h:form>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Production</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.enableEarlyMissingResourceLibraryDetection</param-name>
<param-value>true</param-value>
</context-param>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<listener>
<listener-class>com.mitel.bpi.webadmin.model.BPIWebAdminContextListener</listener-class>
</listener>
You are likely hitting JAVASERVERFACES-2063, which breaks ajax communications in IE9 due to mis-implemented browser detection in jsf.js.
Upgrading to Mojarra >= 2.1.7 will likely fix your problems. Upgrade RichFaces while you are at it, 4.1.0.Final is quite long in the tooth now.
Am using Richfaces 4.0/JSF 2.0/Tomcat. I have created the a page to render a panelMenu and dropDownMenu. However, panelMenu is just rendered as plain text while dropDownMenu is completely not rendered. See screen image:
When i try same with RichFaces 3.3.3, they are rendered correctly. However, i start getting an error that tag h:header is not recognized in my other pages. I have added the following files:-
richfaces-components-api-4.1.0.Final.jar
richfaces-components-ui-4.1.0.Final.jar
richfaces-core-api-4.1.0.Final.jar
richfaces-core-impl-4.1.0.Final.jar
sac-1.3.jar
guava-r09.jar
cssparser-0.9.5.jar
jsf-api.jar and jsf-impl.jar (2.0)
My code:
<h:body>
<h:form id="form2">
<rich:dropDownMenu value="MENU">
<rich:menuItem value="ITEM1"></rich:menuItem>
<rich:menuItem value="ITEM2"></rich:menuItem>
</rich:dropDownMenu>
</h:form>
<h:form id="form">
<h:panelGrid columns="2" columnClasses="cols,cols" width="400">
<rich:panelMenu style="width:200px" mode="ajax"
iconExpandedGroup="disc" iconCollapsedGroup="disc"
iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
iconCollapsedTopGroup="chevronDown">
<rich:panelMenuGroup label="Group 1">
<rich:panelMenuItem label="Item 1.1"
action="#{panelMenu.updateCurrent}">
<f:param name="current" value="Item 1.1" />
</rich:panelMenuItem>
<rich:panelMenuItem label="Item 1.2"
action="#{panelMenu.updateCurrent}">
<f:param name="current" value="Item 1.2" />
</rich:panelMenuItem>
<rich:panelMenuItem label="Item 1.3"
action="#{panelMenu.updateCurrent}">
<f:param name="current" value="Item 1.3" />
</rich:panelMenuItem>
</rich:panelMenuGroup>
</rich:panelMenu>
<rich:panel bodyClass="rich-laguna-panel-no-header">
<a4j:outputPanel ajaxRendered="true">
<h:outputText value="#{panelMenu.current} selected" id="current" />
</a4j:outputPanel>
</rich:panel>
</h:panelGrid>
</h:form>
</h:body>
My web.xml:
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>blueSky</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.CONTROL_SKINNING</param-name>
<param-value>enable</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
<param-value>ALL</param-value>
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
<param-value>com.sun.facelets.FaceletViewHandler</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-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
I finally got my answers from here. There were a number of issues:-
Turns out that RichFaces 4.0 renamed a number of parameters specified in web.xml e.g.
org.richfaces.SKIN (now org.richfaces.skin),
org.richfaces.CONTROL_SKINNING (now org.richfaces.enableControlSkinning) etc
Looks like skinning will not work without h:head tag.
Pretty confusing ....