HTML and CSS Reference
In-Depth Information
Listing 2-25. The Initial Code of the confirm.xhtml Page
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<html xmlns=" "
xmlns:ui=" "
xmlns:h=" " >
<ui:composition template="/WEB-INF/templates/simple.xhtml">
<ui:define name="title">
<ui:define name="content">
<h:outputText value="#{bundle['survey.information.confirm']}"/>
<h:panelGrid columns="2">
<h:outputText value="#{bundle['']}"/>
<h:outputText value="#{flash.userName}"/>
<h:outputText value="#{bundle['survey.user.age']}"/>
<h:outputText value="#{flash.age}"/>
<h:outputText value="#{bundle['']}"/>
<h:outputText value="#{}"/>
<h:outputText value="#{bundle['survey.user.monthyIncome']}"/>
<h:outputText value="#{flash.monthlyIncome}"/>
<h:outputText value="#{bundle['survey.user.yearlyTravelAbroad']}"/>
<h:outputText value="#{flash.travelsAbroad}"/>
<h:outputText value="#{bundle['survey.user.oftenTravelBy']}"></h:outputText>
<h:outputText value="#{flash.travelBy}"/>
<h:commandButton value="#{bundle['']}"
<h:commandButton value="#{bundle['survey.actions.modify']}"
The confirmation page displays all of the entered survey information using the #{flash.attributeName} . From
this page, the user can either save the entered information and navigate to the final.xhtml page or modify the
information in the input.xhtml page.
However, if you click the "Modify" commandButton in order to modify the entered information, you will find the
input.xhtml fields are empty (in other words, the flash information is lost), which is logical because the flash scope
life ends once the confirm.xhtml page is rendered. In order to resolve this issue, all you need to do to keep the flash
Search WWH ::

Custom Search