Cleaning up view templates.

This commit is contained in:
Jeremy Grelle
2007-08-07 23:20:50 +00:00
parent ee34f5376a
commit 548ae759ee
36 changed files with 79 additions and 925 deletions

View File

@@ -11,4 +11,6 @@ public interface BookingService {
public Hotel readHotelById(Long id);
public Booking bookHotel(Hotel hotel, User user);
public void cancelBooking(Long id);
}

View File

@@ -44,6 +44,14 @@ public class JpaBookingService implements BookingService {
return booking;
}
@Transactional
public void cancelBooking(Long id) {
Booking booking = em.find(Booking.class, id);
if (booking != null) {
em.remove(booking);
}
}
@PersistenceContext
public void setEntityManager(EntityManager em) {
this.em = em;

View File

@@ -1,19 +0,0 @@
<?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-1.0.xsd">
<var name="username" class="String" scope="flow"/>
<var name="password" class="String" scope="flow" />
<start-state idref="login"/>
<view-state id="login" view="home.xhtml">
<transition to="loggedIn"/>
</view-state>
<end-state id="loggedIn"/>
</flow>

View File

@@ -38,9 +38,8 @@
<property name="expressionParser" ref="jsfExpressionParser"/>
<property name="flowLocations">
<list>
<value>/WEB-INF/flows/login-flow.xml</value>
<value>/WEB-INF/flows/main-flow.xml</value>
<value>/WEB-INF/flows/bookHotel-flow.xml</value>
<value>/flows/main/main-flow.xml</value>
<value>/flows/booking/bookHotel-flow.xml</value>
</list>
</property>
</bean>

View File

@@ -1,34 +0,0 @@
<!DOCTYPE div PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<div xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:s="http://jboss.com/products/seam/taglib">
<div class="section">
<h1><h:outputText rendered="#{not empty conversationList}" value="Workspaces"/></h1>
</div>
<div class="section">
<h:form>
<h:dataTable value="#{conversationList}" var="entry">
<h:column>
<h:commandLink action="#{entry.select}" value="#{entry.description}"/>
&#160;
<h:outputText value="[current]" rendered="#{entry.current}"/>
</h:column>
<h:column>
<h:outputText value="#{entry.startDatetime}">
<s:convertDateTime type="time" pattern="hh:mm"/>
</h:outputText>
-
<h:outputText value="#{entry.lastDatetime}">
<s:convertDateTime type="time" pattern="hh:mm"/>
</h:outputText>
</h:column>
</h:dataTable>
</h:form>
</div>
</div>

View File

@@ -1,185 +0,0 @@
div.seam-date
{
margin-top: 5px;
border: 1px solid #AAAAAA;
background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
background-color: #FFFFFF;
color: #505050;
font-family: Tahoma, Arial, Helvetica, sans-serif;
font-size: 12px;
}
table.seam-date td {
font-family: Tahoma, Arial, Helvetica, sans-serif;
font-weight: 11px;
}
.seam-date-monthNames
{
width: 70px;
border: 1px solid #dddddd;
border-right: 3px solid #444444;
border-bottom: 3px solid #444444;
background-color: #ffffff;
font-size: 12px;
cursor: pointer;
font-family: Tahoma, Arial, Helvetica, sans-serif;
font-weight: normal;
}
a.seam-date-monthNameLink, a.seam-date-monthNameLink:visited
{
text-align: center;
display: block;
color: #555555;
}
a.seam-date-monthNameLink:hover
{
background-color: #CCCCCC;
color: red;
}
.seam-date-years
{
height: 10em;
overflow: auto;
width: 60px;
border: 1px solid #dddddd;
border-right: 3px solid #444444;
border-bottom: 3px solid #444444;
background-color: #ffffff;
font-size: 12px;
cursor: pointer;
font-family: Tahoma, Arial, Helvetica, sans-serif;
font-weight: normal;
}
a.seam-date-yearLink, a.seam-date-yearLink:visited
{
text-align: center;
display: block;
color: #555555;
}
a.seam-date-yearLink:hover
{
background-color: #CCCCCC;
color: red;
}
tr.seam-date-header
{
padding: 2px 0px 2px 0px;
}
td.seam-date-header
{
padding: 0px 8px 0px 8px;
text-align: center;
color: gray;
font-family: Tahoma, Arial, Helvetica, sans-serif;
font-weight: bold;
font-size: 12px;
}
td.seam-date-header-prevMonth
{
background-image: url("../img/cal-prev.png");
background-repeat: no-repeat;
background-position: center;
padding: 0px 2px 0px 2px;
width: 17px;
height: 16px;
margin-left: 2px;
}
td.seam-date-header-nextMonth
{
background-image: url("../img/cal-next.png");
background-repeat: no-repeat;
background-position: center;
padding: 0px 2px 0px 2px;
width: 17px;
height: 16px;
margin-right: 2px;
}
tr.seam-date-headerDays
{
color: white;
font-weight: normal;
}
tr.seam-date-headerDays > td
{
background-color: #CCCCCC;
border: 1px solid #AAAAAA;
color: white;
text-align: center;
width: 26px;
}
tr.seam-date-footer
{
background-color: white;
color: #505050;
font-weight: bold;
}
tr.seam-date-footer > td
{
text-align: center;
}
td.seam-date-inMonth
{
background-color: white;
color: black;
font-weight: normal;
cursor: pointer;
border: 1px solid #ece9d8;
}
td.seam-date-outMonth
{
background-color: white;
color: #999999;
font-weight: normal;
cursor: pointer;
border: 1px solid #ece9d8;
}
td.seam-date-selected
{
background-color: #CCCCCC;
border: 1px solid #AAAAAA;
color: black;
font-weight: normal;
}
td.seam-date-dayOff-inMonth
{
background-color: #efefef;
color: black;
font-weight: normal;
cursor: pointer;
border: 1px solid #ece9d8;
}
td.seam-date-dayOff-outMonth
{
background-color: #efefef;
color: #999999;
font-weight: normal;
cursor: pointer;
border: 1px solid #ece9d8;
}
td.seam-date-hover
{
background-color: #CCCCCC;
border: 1px solid #AAAAAA;
cursor: pointer;
color: red;
}

View File

@@ -32,13 +32,13 @@ input {
border: 1px solid #C3BBB6;
padding: 4px;
margin: 5px 0;
background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
background: #fff url(../images/input.bg.gif) 0 0 repeat-x;
}
select {
border: 1px solid #C3BBB6;
padding: 4px;
margin: 5px 0;
background: #fff url(../img/input.bg.gif) 0 0 repeat-x;
background: #fff url(../images/input.bg.gif) 0 0 repeat-x;
}ol, ul {
margin: 10px 0px 10px 6px;
}
@@ -52,27 +52,20 @@ fieldset {
----------------------------------------------- */
#document {
padding: 0 1px;
background: #fff url(../img/bg.gif) 0 0 repeat-y;
background: #fff url(../images/bg.gif) 0 0 repeat-y;
float: left;
border-bottom: 1px solid #C3BBB6;
}
#header {
float: left;
width: 758px;
height: 46px;
background: url(../img/hdr.bg.gif) 0 0 repeat-x;
height:76px;
background: url(../images/hdr.bg.gif) 0 0 repeat-x;
}
#container {
float: left;
width: 758px;
background: url(../img/hdr.bar.jpg) 0 0 repeat-x;
}
#sidebar {
float: left;
width: 190px;
margin-top: 96px;
padding: 20px 10px 0 10px;
background: url(../img/sdb.bg.gif) 0 0 no-repeat;
background: url(../images/spring-logo.jpg) 0 0 repeat-x;
}
#content {
float: left;
@@ -98,7 +91,7 @@ input[type="submit"], input[type="button"] {
color: #fff;
border: 1px solid #5D1414;
height: 26px;
background: #fff url(../img/btn.bg.gif) 0 0 repeat-x;
background: #fff url(../images/btn.bg.gif) 0 0 repeat-x;
border-style: none;
}
.center {
@@ -202,7 +195,7 @@ input[type="submit"], input[type="button"] {
}
#content table thead th {
border-left: 1px solid #D2C9C4;
background: #fff url(../img/th.bg.gif) 0 100% repeat-x;
background: #fff url(../images/th.bg.gif) 0 100% repeat-x;
border-bottom: 1px solid #D2C9C4;
padding: 6px;
text-align: left;
@@ -252,17 +245,3 @@ input[type="submit"], input[type="button"] {
color: #C7B299;
text-decoration: none;
}
/* Homepage Modifications
----------------------------------------------- */
#pgHome #container {
background: url(../img/hdr.ad.jpg) 0 0 repeat-x;
}
#pgHome #sidebar {
margin-top: 207px;
}
#pgHome #content {
margin-top: 183px;
}
#pgHome input[type="submit"] {
height: 30px;
}

View File

@@ -1,27 +0,0 @@
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Spring Web Stack: SWF + JSF Booking Sample</title>
<link href="/css/screen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="document">
<div id="header">
<div id="title"><img src="images/webflow-logo.jpg" alt="Spring Web Stack: SWF + JSF Booking Sample"/></div>
<div id="status">
Welcome #{user.name}
</div>
</div>
<div id="container">
<div id="content">
<ui:insert name="content"/>
</div>
</div>
<div id="footer">Created with Spring, Spring Web Flow, MyFaces, and Facelets</div>
</div>
</body>
</html>

View File

@@ -1,148 +0,0 @@
* {
margin: 0px;
padding: 0px;
border: none;
}
body {
font: 1em verdana, arial, sans-serif;
background: #CCCCCC;
}
div#main {
margin-left: 0px;
width: 751px;
background: #ecefdf;
}
div#top,div#pictures{
}
div#pictures img {
float:left;
}
img#head1 {
margin-right: 3px;
}
img#head2 {
margin-right: 4px;
}
div.trail {
clear:both;
margin-left: 50px;
margin-top: 0px;
margin-right: 50px
}
div.foot {
margin-left: 50px;
margin-right: 50px;
margin-top: 50px;
text-align: center;
font-size: .5em;
height: 36px;
}
div.trail h1 {
margin-top: -30px;
margin-left: -50px;
font-size: 1.2em;
font-weight: bold;
padding-left: .4em;
}
div.trail h2 {
float: left;
font-size: 1em;
font-weight: bold;
padding-left: .4em;
}
div.trail h3 {
float: left;
font-size: .8em;
font-weight: bold;
margin-left: -1.4em;
margin-bottom: 1em;
}
div.trail p {
clear: both;
margin-top: 20px;
font-size: .8em;
text-decoration: none;
}
div#next_trail {
margin-left: 36px;
}
div.numbox {
border: thin solid black;
margin-left: -.8em;
float: left;
background: #ffffff;
padding: .2em .35em .3em;
font-style: normal;
font-weight: bold;
font-size: 1.4em;
}
div.figure {
text-align: center;
font-size: .6em;
margin-top: 30px;
}
div.figure img {
display: block;
margin-right: auto;
margin-left: auto;
}
code {
font: 1.1em "Courier New", Courier, mono;
}
code.block {
white-space: pre;
font: 10pt "Courier New", Courier, mono;
display: block;
border-style: dashed;
border-width: thin;
padding: .5em;
background: #ffffff;
margin: 20px;
}
div.foot_image {
float: left;
height: 86px;
}
a:active {
color : #666666;
text-decoration: none;
}
a:hover {
color : #000000;
background-color : #D6E0FE;
text-decoration: none;
}
a:link {
color : #005EB6;
text-decoration: none;
}
a:visited {
color : #888888;
text-decoration: none;
}

View File

@@ -3,9 +3,8 @@
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:s="http://jboss.com/products/seam/taglib"
xmlns:a="https://ajax4jsf.dev.java.net/ajax"
template="template.xhtml">
template="/template.xhtml">
<!-- content -->
<ui:define name="content">
@@ -45,99 +44,88 @@
</h:outputText>
</div>
</div>
<s:validateAll>
<f:facet name="aroundInvalidField">
<s:span styleClass="errors"/>
</f:facet>
<f:facet name="afterInvalidField">
<s:div styleClass="errors">
<s:message/>
</s:div>
</f:facet>
<div class="entry">
<div class="label"><h:outputLabel for="checkinDate">Check In Date:</h:outputLabel></div>
<div class="input">
<s:decorate id="checkinDateDecorate">
<h:inputText id="checkinDate" value="#{booking.checkinDate}" required="true">
<f:convertDateTime pattern="MM/dd/yyyy"/>
<a:support event="onblur" reRender="checkinDateDecorate"/>
</h:inputText>
<s:selectDate for="checkinDate">
<h:graphicImage url="img/dtpick.gif" style="margin-left:5px;cursor:pointer"/>
</s:selectDate>
</s:decorate>
</div>
</div>
<div class="entry">
<div class="label"><h:outputLabel for="checkoutDate">Check Out Date:</h:outputLabel></div>
<div class="input">
<s:decorate id="checkoutDateDecorate">
<h:inputText id="checkoutDate" value="#{booking.checkoutDate}" required="true">
<f:convertDateTime pattern="MM/dd/yyyy"/>
<a:support event="onblur" reRender="checkoutDateDecorate"/>
</h:inputText>
<s:selectDate for="checkoutDate">
<h:graphicImage url="img/dtpick.gif" style="margin-left:5px;cursor:pointer"/>
</s:selectDate>
</s:decorate>
</div>
</div>
<div class="entry">
<div class="label"><h:outputLabel for="beds">Room Preference:</h:outputLabel></div>
<div class="input">
<s:decorate>
<h:selectOneMenu id="beds" value="#{booking.beds}">
<f:selectItem itemLabel="One king-size bed" itemValue="1"/>
<f:selectItem itemLabel="Two double beds" itemValue="2"/>
<f:selectItem itemLabel="Three beds" itemValue="3"/>
</h:selectOneMenu>
</s:decorate>
</div>
</div>
<div class="entry">
<div class="label"><h:outputLabel for="smoking">Smoking Preference:</h:outputLabel></div>
<div id="radio" class="input">
<s:decorate>
<h:selectOneRadio id="smoking" value="#{booking.smoking}" layout="pageDirection">
<f:selectItem itemLabel="Smoking" itemValue="true"/>
<f:selectItem itemLabel="Non Smoking" itemValue="false"/>
</h:selectOneRadio>
</s:decorate>
</div>
</div>
<div class="entry">
<div class="label"><h:outputLabel for="creditCard">Credit Card #:</h:outputLabel></div>
<div class="input">
<s:decorate id="creditCardDecorate">
<h:inputText id="creditCard" value="#{booking.creditCard}" required="true">
<a:support event="onblur" reRender="creditCardDecorate"/>
</h:inputText>
</s:decorate>
</div>
</div>
<div class="entry">
<div class="label"><h:outputLabel for="creditCardName">Credit Card Name:</h:outputLabel></div>
<div class="input">
<s:decorate id="creditCardNameDecorate">
<h:inputText id="creditCardName" value="#{booking.creditCardName}" required="true">
<a:support event="onblur" reRender="creditCardNameDecorate"/>
</h:inputText>
</s:decorate>
</div>
</div>
<div class="entry">
<div class="label"><h:outputLabel for="creditCardExpiryMonth">Credit Card Expiry:</h:outputLabel></div>
<div class="input">
<s:decorate>
<h:selectOneMenu id="creditCardExpiryMonth" value="#{booking.creditCardExpiryMonth}">
<f:selectItem itemLabel="Jan" itemValue="1"/>
<f:selectItem itemLabel="Feb" itemValue="2"/>
@@ -159,11 +147,9 @@
<f:selectItem itemLabel="2008" itemValue="2008"/>
<f:selectItem itemLabel="2009" itemValue="2009"/>
</h:selectOneMenu>
</s:decorate>
</div>
</div>
</s:validateAll>
<div class="entry errors">
<h:messages globalOnly="true"/>
@@ -181,21 +167,4 @@
</div>
</ui:define>
<!-- sidebar -->
<ui:define name="sidebar">
<h1>Workspace management</h1>
<p>
As you can see, Seam makes it easy to work in multiple windows or multiple browser
tabs. But you can even switch between multiple tasks inside a single browser tab!
The "Workspaces" section showcases this advanced feature.
</p>
<p>
<a href="#" onclick="window.open('exp/workspaceExp.html','exp','width=752,height=500,scrollbars=yes');">
How does the workspace list work?
</a>
</p>
</ui:define>
</ui:composition>

View File

@@ -12,9 +12,7 @@
<start-state idref="displayHotel"/>
<!-- NOTE - for some reason leaving off the scope prefix from EL expressions is not working in the subflow -->
<view-state id="displayHotel" view="/hotel.xhtml">
<view-state id="displayHotel" view="/flows/booking/hotel.xhtml">
<render-actions>
<bean-action bean="bookingService" method="readHotelById">
<method-arguments>
@@ -38,7 +36,7 @@
<transition to="enterBookingDetails"/>
</action-state>
<view-state id="enterBookingDetails" view="/book.xhtml">
<view-state id="enterBookingDetails" view="/flows/booking/book.xhtml">
<transition on="reviewDetails" to="validateBooking"/>
<transition on="cancel" to="cancel"/>
</view-state>
@@ -49,7 +47,7 @@
<transition on="error" to="enterBookingDetails"/>
</action-state>
<view-state id="confirmBooking" view="/confirm.xhtml">
<view-state id="confirmBooking" view="/flows/booking/confirm.xhtml">
<transition on="confirm" to="completeBooking"/>
<transition on="revise" to="enterBookingDetails"/>
<transition on="cancel" to="cancel"/>

View File

@@ -3,8 +3,7 @@
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:s="http://jboss.com/products/seam/taglib"
template="template.xhtml">
template="/template.xhtml">
<!-- content -->
<ui:define name="content">
@@ -68,22 +67,4 @@
</div>
</ui:define>
<!-- sidebar -->
<ui:define name="sidebar">
<h1>Back button navigation</h1>
<p>
When you click "Confirm", the new booking is written to the database, the
conversation ends, and state associated with the conversation is automatically
destroyed by Seam. After you confirm your booking, try hitting the back button
on your web browser and clicking "Confirm" again. Seam makes it easy implement
applications that behave elegantly in response to the back, forward and refresh
buttons.
</p>
<p>
<a href="#" onclick="window.open('exp/confirmExp.html','exp','width=752,height=500,scrollbars=yes');">
What happens when the conversation ends?
</a>
</p>
</ui:define>
</ui:composition>

View File

@@ -3,7 +3,7 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
template="template.xhtml">
template="/template.xhtml">
<!-- content -->
<ui:define name="content">
@@ -55,28 +55,4 @@
</div>
</ui:define>
<!-- sidebar -->
<ui:define name="sidebar">
<h1>Don't kill your database</h1>
<p>
Keeping conversational state in memory in the middle tier is a great way to
improve your application's scalability. It saves hitting the database every
time we refresh a page, to re-read the data we were just looking at five
seconds ago. By using Seam's conversation context, we get a natural cache
of data associated with the what the user is currently doing. By nature,
this cache has a more efficient eviction policy than the MRU-type algorithms
used by a typical second-level data cache in an O/R mapping engine like
Hibernate (at least for some kinds of data). Of course, you should use
a clever combination of second-level caching and conversational data
caching to achieve the best performance for your application.
</p>
<p>
<a href="#" onclick="window.open('exp/bookingExp.html','exp','width=752,height=500,scrollbars=yes');">
How does the hotel booking wizard work?
</a>
</p>
</ui:define>
</ui:composition>

View File

@@ -11,12 +11,13 @@
<action-state id="findBookings">
<action bean="searchAction"/>
<transition to="main"/>
<transition on="success" to="main"/>
</action-state>
<view-state id="main" view="/main.xhtml">
<view-state id="main" view="/flows/main/main.xhtml">
<transition on="findHotels" to="findHotels"/>
<transition on="selectHotel" to="bookHotel-flow"/>
<transition on="cancelBooking" to="cancelBooking"/>
</view-state>
<action-state id="findHotels">
@@ -27,12 +28,21 @@
<subflow-state flow="bookHotel-flow" id="bookHotel-flow">
<attribute-mapper>
<input-mapper>
<mapping source="param.id" target="id" from="string" to="long"/>
<mapping source="param.hotelId" target="id" from="string" to="long"/>
</input-mapper>
</attribute-mapper>
<transition to="findBookings"/>
<transition on="*" to="findBookings"/>
</subflow-state>
<action-state id="cancelBooking">
<bean-action bean="bookingService" method="cancelBooking">
<method-arguments>
<argument expression="param.bookingId" parameter-type="long"/>
</method-arguments>
</bean-action>
<transition on="success" to="findBookings"/>
</action-state>
<end-state id="loggedIn"/>
</flow>

View File

@@ -2,10 +2,9 @@
<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:s="http://jboss.com/products/seam/taglib"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a="https://ajax4jsf.dev.java.net/ajax"
template="template.xhtml">
template="/template.xhtml">
<!-- content -->
<ui:define name="content">
@@ -42,27 +41,27 @@
<div class="section">
<h:outputText value="No Hotels Found" rendered="#{hotels.rowCount==0}"/>
<h:dataTable id="hotels" value="#{hotels}" var="hot" rendered="#{hotels.rowCount>0}">
<h:dataTable id="hotels" value="#{hotels}" var="hotel" rendered="#{hotels.rowCount>0}">
<h:column>
<f:facet name="header">Name</f:facet>
#{hot.name}
#{hotel.name}
</h:column>
<h:column>
<f:facet name="header">Address</f:facet>
#{hot.address}
#{hotel.address}
</h:column>
<h:column>
<f:facet name="header">City, State</f:facet>
#{hot.city}, #{hot.state}, #{hot.country}
#{hotel.city}, #{hotel.state}, #{hotel.country}
</h:column>
<h:column>
<f:facet name="header">Zip</f:facet>
#{hot.zip}
#{hotel.zip}
</h:column>
<h:column>
<f:facet name="header">Action</f:facet>
<h:commandLink id="viewHotelLink" value="View Hotel" action="selectHotel">
<f:param name="id" value="#{hot.id}"/>
<f:param name="hotelId" value="#{hotel.id}"/>
</h:commandLink>
</h:column>
</h:dataTable>
@@ -78,34 +77,36 @@
<div class="section">
<h:outputText value="No Bookings Found" rendered="#{bookings.rowCount==0}"/>
<h:dataTable id="bookings" value="#{bookings}" var="book" rendered="#{bookings.rowCount>0}">
<h:dataTable id="bookings" value="#{bookings}" var="booking" rendered="#{bookings.rowCount>0}">
<h:column>
<f:facet name="header">Name</f:facet>
#{book.hotel.name}
#{booking.hotel.name}
</h:column>
<h:column>
<f:facet name="header">Address</f:facet>
#{book.hotel.address}
#{booking.hotel.address}
</h:column>
<h:column>
<f:facet name="header">City, State</f:facet>
#{book.hotel.city}, #{book.hotel.state}
#{booking.hotel.city}, #{booking.hotel.state}
</h:column>
<h:column>
<f:facet name="header">Check in date</f:facet>
<h:outputText value="#{book.checkinDate}"/>
<h:outputText value="#{booking.checkinDate}"/>
</h:column>
<h:column>
<f:facet name="header">Check out date</f:facet>
<h:outputText value="#{book.checkoutDate}"/>
<h:outputText value="#{booking.checkoutDate}"/>
</h:column>
<h:column>
<f:facet name="header">Confirmation number</f:facet>
#{book.id}
#{booking.id}
</h:column>
<h:column>
<f:facet name="header">Action</f:facet>
<h:commandLink id="cancel" value="Cancel" action="cancelBooking"/>
<h:commandLink id="cancel" value="Cancel" action="cancelBooking">
<f:param name="bookingId" value="#{booking.id}"/>
</h:commandLink>
</h:column>
</h:dataTable>
</div>
@@ -114,27 +115,4 @@
</ui:define>
<!-- sidebar -->
<ui:define name="sidebar">
<h1>State management in Seam</h1>
<p>
State in Seam is <em>contextual</em>. When you click "Find Hotels", the application
retrieves a list of hotels from the database and caches it in the session context. When you
navigate to one of the hotel records by clicking the "View Hotel" link, a <em>conversation</em>
begins. The conversation is attached to a particular tab, in a particular browser window. You can
navigate to multiple hotels using "open in new tab" or "open in new window" in your web browser.
Each window will execute in the context of a different conversation. The application keeps state
associated with your hotel booking in the conversation context, which ensures that the concurrent
conversations do not interfere with each other.
</p>
<p>
<a href="#" onclick="window.open('exp/mainExp.html','exp','width=752,height=500,scrollbars=yes');">
How does the search page work?
</a>
</p>
</ui:define>
</ui:composition>

View File

@@ -1,59 +0,0 @@
<!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"
xmlns:s="http://jboss.com/products/seam/taglib">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Spring Web Stack: Spring Web Flow + JSF</title>
<link href="css/screen.css" rel="stylesheet" type="text/css" />
</head>
<body id="pgHome">
<f:view>
<div id="document">
<div id="header">
<div id="title"><img src="images/spring-logo.jpg" alt="Spring Web Stack: Spring Web Flow + JSF Demo"/></div>
</div>
<div id="container">
<div id="sidebar">
<h:form id="login">
<fieldset>
<div>
<h:outputLabel for="username">Login Name</h:outputLabel>
<h:inputText id="username" value="#{username}" style="width: 175px;"/>
<div class="errors"><h:message for="username"/></div>
</div>
<div>
<h:outputLabel for="password">Password</h:outputLabel>
<h:inputSecret id="password" value="#{password}" style="width: 175px;"/>
</div>
<div class="errors"><h:messages globalOnly="true"/></div>
<div class="buttonBox"><h:commandButton id="login" action="#{identity.login}" value="Account Login"/></div>
<div class="notes"><s:link id="register" view="/register.xhtml" value="Register New User"/></div>
</fieldset>
</h:form>
</div>
<div id="content">
<div class="section">
<h1>About this example application</h1>
<p>
This sample application demonstrates how easy it is to develop stateful web
applications using Spring Web Flow. Just register, login, and book a room to see
SWF in action.
</p>
<p>
Note: Please do NOT enter personal information or your credit card number in
this sample application.
</p>
</div>
</div>
</div>
<div id="footer">Created with Spring, Spring Web Flow, MyFaces, and Facelets</div>
</div>
</f:view>
</body>
</html>

View File

Before

Width:  |  Height:  |  Size: 163 B

After

Width:  |  Height:  |  Size: 163 B

View File

Before

Width:  |  Height:  |  Size: 221 B

After

Width:  |  Height:  |  Size: 221 B

View File

Before

Width:  |  Height:  |  Size: 218 B

After

Width:  |  Height:  |  Size: 218 B

View File

Before

Width:  |  Height:  |  Size: 152 B

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 571 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 618 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -15,24 +15,8 @@
</h:form>
</p>
<p>
<a href="controller.faces?_flowId=main-flow">Book Hotels</a> (launch with a regular anchor tag)
<a href="controller.swf?_flowId=main-flow">Book Hotels</a> (launch with a regular anchor tag)
</p>
<p>
This Spring Web Flow sample application is the JSF-based version of the familiar "Sell item" sample.
It illustrates the following concepts:
</p>
<ul>
<li>Using Spring Web Flow with JSF</li>
<li>Implementing a wizard using web flows.</li>
<li>Use of conversation scope.</li>
<li>Using expressions to apply dynamic flow navigation rules</li>
<li>Using continuations to make the flow completely stable, no matter how browser navigation buttons are used.</li>
<li>"Always redirect on pause" to benefit from the POST+REDIRECT+GET pattern with no special coding.</li>
<li>
Using "conversation invalidation after completion" to prevent duplicate submits of the same sale
while taking advantage of continuations to allow back button usage while the application transaction is in process.
</li>
</ul>
</div>
<hr/>
</f:view>

View File

@@ -1,81 +0,0 @@
<!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:s="http://jboss.com/products/seam/taglib"
template="template.xhtml">
<!-- content -->
<ui:define name="content">
<div class="section">
<h1>Change Your Password</h1>
</div>
<div class="section">
<h:form id="setpassword">
<f:facet name="aroundInvalidField">
<s:span styleClass="errors"/>
</f:facet>
<f:facet name="afterInvalidField">
<s:div styleClass="errors">
<s:message/>
</s:div>
</f:facet>
<fieldset>
<div class="entry">
<div class="label"><h:outputLabel for="password">Password:</h:outputLabel></div>
<div class="input">
<s:decorate>
<h:inputSecret id="password" value="#{user.password}" required="true">
<s:validate/>
</h:inputSecret>
</s:decorate>
</div>
</div>
<div class="entry">
<div class="label"><h:outputLabel for="verify">Verify:</h:outputLabel></div>
<div class="input">
<s:decorate>
<h:inputSecret id="verify" value="#{changePassword.verify}" required="true"/>
</s:decorate>
</div>
</div>
<div class="entry errors">
<h:messages globalOnly="true"/>
</div>
<div class="entry">
<div class="label">&#160;</div>
<div class="input">
<h:commandButton id="change" value="Change" action="#{changePassword.changePassword}"/>&#160;
<s:button id="cancel" value="Cancel" view="/main.xhtml"/>
</div>
</div>
</fieldset>
</h:form>
</div>
</ui:define>
<!-- sidebar -->
<ui:define name="sidebar">
<h1>Simple things should be easy</h1>
<p>
(And so should some complex things.) You shouldn't have to write four different classes
just to change a password. Traditional J2EE architectures require that developers spend
more time writing code to make the frameworks happy, than they ever get to spend writing
code to make the user happy. Seam lets you reduce the size of your code dramatically.
And that reduces bugs. And it makes refactoring easier. And it makes delivering new
functionality quicker. Productivity matters. But with Seam, JSF, EJB 3.0 and jBPM, you
don't need to sacrifice the ability to handle complex problems just to achieve great
productivity.
</p>
</ui:define>
</ui:composition>

View File

@@ -1,119 +0,0 @@
<!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"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:a="https://ajax4jsf.dev.java.net/ajax">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>JBoss Suites: Seam Framework</title>
<link href="css/screen.css" rel="stylesheet" type="text/css" />
</head>
<body id="pgHome">
<div id="document">
<div id="header">
<div id="title"><img src="img/hdr.title.gif" alt="JBoss Suites: seam framework demo"/></div>
</div>
<div id="container">
<div id="sidebar">
<h1>Integrated multi-layer validation</h1>
<p>
Robust applications need data validation in several different places. Seam integrates Hibernate Validator,
a set of annotations for expressing data model constraints in your domain model classes. Then, these
constraints are applied almost completely transparently at three levels of the application: by Seam when
the user first enters data, by EJB before persisting data to the database, and, if you use Hibernate to
generate your database schema, by the database constraints themselves. Multi-layer validation hardens
your application and protects your data. Even better, it's self-documenting, and easy to change when
your business rules change.
</p>
<p>
<a href="#" onclick="window.open('exp/registerExp.html','exp','width=752,height=500,scrollbars=yes');">
What happens when I register?
</a>
</p>
</div>
<div id="content">
<div class="section">
<h1>Register</h1>
</div>
<div class="section">
<h:form id="register">
<fieldset>
<s:validateAll>
<f:facet name="aroundInvalidField">
<s:span styleClass="errors"/>
</f:facet>
<f:facet name="afterInvalidField">
<s:div styleClass="errors">
<s:message/>
</s:div>
</f:facet>
<div class="entry">
<div class="label"><h:outputLabel for="username">Username:</h:outputLabel></div>
<div class="input">
<s:decorate id="usernameDecorate">
<h:inputText id="username" value="#{user.username}" required="true">
<a:support event="onblur" reRender="usernameDecorate"/>
</h:inputText>
</s:decorate>
</div>
</div>
<div class="entry">
<div class="label"><h:outputLabel for="name">Real Name:</h:outputLabel></div>
<div class="input">
<s:decorate id="nameDecorate">
<h:inputText id="name" value="#{user.name}" required="true">
<a:support event="onblur" reRender="nameDecorate"/>
</h:inputText>
</s:decorate>
</div>
</div>
<div class="entry">
<div class="label"><h:outputLabel for="password">Password:</h:outputLabel></div>
<div class="input">
<s:decorate>
<h:inputSecret id="password" value="#{user.password}" required="true"/>
</s:decorate>
</div>
</div>
<div class="entry">
<div class="label"><h:outputLabel for="verify">Verify Password:</h:outputLabel></div>
<div class="input">
<s:decorate>
<h:inputSecret id="verify" value="#{register.verify}" required="true"/>
</s:decorate>
</div>
</div>
</s:validateAll>
<div class="entry errors">
<h:messages globalOnly="true"/>
</div>
<div class="entry">
<div class="label">&#160;</div>
<div class="input">
<h:commandButton id="register" value="Register" action="#{register.register}"/>&#160;
<s:button id="cancel" value="Cancel" view="/home.xhtml"/>
</div>
</div>
</fieldset>
</h:form>
</div>
</div>
</div>
<div id="footer">Created with JBoss EJB 3.0, Seam, MyFaces, and Facelets</div>
</div>
</body>
</html>

View File

@@ -1,58 +0,0 @@
body {
width: 720px;
margin: 0px;
padding: 0px;
}
div#logo {
width: 720px;
height: 73px;
background: #86AEA5;
}
div#navigation {
width: 720px;
height: 15px;
background: #E2F3B8;
text-align: right;
}
div#content {
width: 720px;
padding: 5px;
}
div#insert {
width: 120;
float: right;
text-align: right;
}
.buttonBar {
height: 1.5em;
text-align: right;
}
div#copyright {
width: 720px;
}
div#copyright p {
text-align: center;
font-family: Tahoma, sans-serif;
font-size: 75%;
color: div#336633;
margin-left: 5px;
font-weight: bold;
clear: both;
}
.readOnly {
color: rgb(192, 192, 192);
}
.error {
color: red;
font-weight: bold;
font-family: Arial, sans-serif;
}

View File

@@ -5,13 +5,13 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Spring Web Stack: SWF + JSF Booking Sample</title>
<link href="/css/screen.css" rel="stylesheet" type="text/css" />
<link href="/swf-booking-jsf/css/screen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="document">
<div id="header">
<div id="title"><img src="images/webflow-logo.jpg" alt="Spring Web Stack: SWF + JSF Booking Sample"/></div>
<div id="title"><img src="/swf-booking-jsf/images/webflow-logo.jpg" alt="Spring Web Stack: SWF + JSF Booking Sample"/></div>
<div id="status">
Welcome #{user.name}
</div>