Demonstration of page flow design patterns.

#if ($courseBooking) Course Booking Completed
Booking No. $courseBooking.id
Booking Created $format.date($courseBooking.createdAt, "dd MMM yyyy - h:mm:ss a")
Customer Name $customer.name
Customer No. $customer.id
Course Date $format.date($courseBooking.bookingDate, "dd MMM yyyy")
Course Type $courseBooking.courseType
#else No course booking has been made. #end

Create Another Booking ?

 

The LastPage gets the booking details from a "bookingId" URL request parameter.
String bookingId = getContext().getRequest().getParameter("bookingId=");

CourseBooking courseBooking = getBookingService().findCourseBookingByID(new Integer(bookingId));
The advantage of the Post-Redirect pattern is that it will not make the POST request again of the previous page even if the users does a refresh.

To prevent users from submitting the order twice by pressing the back button, the StartPage of this page flow uses a form submit check.

public class StartPage extends BorderedPage {
    ..
    
    public boolean onSecurityCheck() {
        return form.onSubmitCheck(this, "/invalid-submit.html");
    }
}