Create an @ApplicationScoped GuestbookBean that maintains a List of GuestbookEntry objects. The application should provide a form, similar to the one in Deitel Fig. 29.16 that enables a user to enter a name, an email address and a message. When the user submits the form, the GuestbookBean should create a GuestbookEntry object containing the submitted values and insert it at the beginning of the List of GuestbookEntry objects – this places the most recent entry first. The GuestbookBean should also provide a read-only property that returns the List of GuestbookEntry objects. The page should use a h:dataTable element to display all of the items in the List so the user can see all the guestbook entries so far.
Additional Notes:
• The GuestbookEntry objects are POJOs (Plain Old Java Objects). The GuestbookEntry class should not be a managed bean.
• The GuestbookBean is a managed bean (a backing bean).
• Display only one page in the application ([login to view URL]).
• Use a h:dataTable to display all of the items in the list with columns for name, email and message so the user can see all the guestbook entries so far.
• Use the h:inputTextarea component (instead of the h:inputText component) to input the message text.
• Don’t forget to validate the entries in the [login to view URL] code and display the appropriate error messages. All input fields are required. The name should be a maximum length of 30 characters and the email should be a valid email address format. The message should not be restricted in length.