I am very very new in Spring Web Flow...this is my first experience with it
I have some problem trying to transition from one view to another view:
I have do the following things:
I have created this directory that manage a flow in my project: /MyWebApp/src/main/webapp/WEB-INF/flows/secured/sservizzi/
and in this directory I have put 3 files:
1) flow.xml that manage the flow: into this file I manage 2 steps: the first step show a view that is named view.xhtml and the second step have to show an other view named riassunto.xhtml
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"
parent="parent-flow">
<!--
Also see ../parent-flow.xml.
-->
<!-- Dichiara una variabile utenteBean di tipo specificato dall'attributo class -->
<var name="utenteBean" class="com.sogeit.fids.webfids.model.UtenteBean" />
<view-state id="view">
<transition on="suggest" to="riassunto">
<evaluate expression="utenteBean.metodoTest(flowRequestContext)"
result="viewScope.risultato" />
</transition>
</view-state>
<view-state id="riassunto"></view-state>
</flow>
Code: Select all
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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:p="http://primefaces.prime.com.tr/ui"
template="/WEB-INF/layouts/fids-template.xhtml">
<ui:define name="title">Ajax With PrimeFaces CommandButton</ui:define>
<ui:define name="notes">
<h5>Files to review:</h5>
<p>
Flow definition and view.xhtml in <span class="alt">src/main/webapp/WEB-INF/flows/ajax-primefaces</span><br/>
Java class <span class="alt">~/ajax/UserBean.java</span>
</p>
<hr/>
</ui:define>
<ui:define name="content">
<h:form>
<h:panelGrid columns="4" cellpadding="5">
<h:outputLabel for="nome" value="Nome:" style="font-weight:bold"/>
<p:inputText id="nome" value="#{utenteBean.nome}" />
<h:outputLabel for="cognome" value="Cognome:" style="font-weight:bold"/>
<p:inputText id="cognome" value="#{utenteBean.cognome}" />
<p:commandButton value="Suggest" action="suggest" execute="@form" update="@form"/>
</h:panelGrid>
<h:outputText value="Ciao #{utenteBean.nome} #{utenteBean.cognome}" id="display" />
</h:form>
</ui:define>
</ui:composition>
Code: Select all
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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:p="http://primefaces.prime.com.tr/ui"
template="/WEB-INF/layouts/fids-template.xhtml">
<ui:define name="title">Ajax With PrimeFaces CommandButton</ui:define>
<ui:define name="notes">
<h5>Files to review:</h5>
<p>
Flow definition and view.xhtml in <span class="alt">src/main/webapp/WEB-INF/flows/ajax-primefaces</span><br/>
Java class <span class="alt">~/ajax/UserBean.java</span>
</p>
<hr/>
</ui:define>
<ui:define name="content">
<p>OUTPUT TEST</p>
</ui:define>
</ui:composition>
The problem is that when I click the suggest command button does not transit on the second view and continues to be displayed first view
Why? What's wrong? how can I fix this?
Thanks
Andrea