The configuration in faces-config doesn't work
index.xhtml:
Code: Select all
<f:view xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:i="http://primefaces.prime.com.tr/touch"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui">
<i:application icon="/WebContent/images/logo.png">
<!--LoginView-->
<i:view title="Login" id="home">
<h:form>
<i:tableView id="panel" display="group" >
<i:rowGroup id="name" title="Name: " rendered="true">
<i:rowItem>
<h:inputText id="loginName" value="#{LoginController.name}"/>
</i:rowItem>
</i:rowGroup>
<h:commandButton value="Login" action="#{LoginController.login}" />
</i:tableView>
</h:form>
</i:view>
</i:application>
</f:view>
Code: Select all
<f:view xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:i="http://primefaces.prime.com.tr/touch"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui">
<i:application icon="/WebContent/images/logo.png">
<!--LoginView-->
<i:view title="success" id="home">
<h:form prependId="false">
<i:tableView id="panel" display="group" >
Success
</i:tableView>
</h:form>
</i:view>
</i:application>
</f:view>
Code: Select all
<?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>
com.sun.facelets.FaceletViewHandler
</view-handler>
</application>
<managed-bean>
<managed-bean-name>LoginController</managed-bean-name>
<managed-bean-class>beans.LoginController</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>index.xhtml</from-view-id>
<navigation-case>
<from-action>#{LoginController.login}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>success.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>