blob: cd51bcf57c1a859e4100581c57b32faf4ba4dfac [file] [log] [blame]
<!--
#* Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.*#
-->
Demonstration of page flow design patterns. &nbsp; Please confirm course details:
<p/>
<table border="0" cellspacing="4" cellpadding="4">
<tr>
<td><b>Customer Name</b></td>
<td>$customer.name &nbsp; (Customer No. $customer.id)</td>
</tr>
<tr>
<td><b>Course Type</b></td>
<td>$courseBooking.courseType</td>
</tr>
<tr>
<td><b>Booking Date</b></td>
<td>$format.date($courseBooking.bookingDate, "dd MMM yyyy")</td>
</tr>
#if ($courseBooking.bookingNotes != "")
<tr>
<td><b>Booking Notes</b></td>
<td>$courseBooking.bookingNotes</td>
</tr>
#end
</table>
$form
<p>&nbsp;</p>
When the booking is confirmed the page will redirect to the last page:
<pre class="codeJava">
Long bookingId = getBookingService().insertCourseBooking(booking);
String path = getContext().getPagePath(LastPage.<span class="kw">class</span>);
setRedirect(path + <span class="st">"?bookingId="</span> + bookingId);
</pre>
This page flow design pattern is known as Post-Redirect.