PROJECT 4: SERVLET COOKIES |
In this project, you are going to use Cookies to personalize the eMovie-store for your customers. The specification below is only meant to be a guideline. If there are unanswered parts, you should try to make a decision yourself. Main purpose: implement a cookie so that an unregistered visitor can choose to register and input his/her favorite movie category; the rest of the project should stay the same as the last project. As long as you give the user an option to register and modify later their names and/or movie category preferences, you can design the workflow differently if you like. 1. Use Java servlet cookies to implement the following. If the user is new, the web site should generate an HTML page in the content area asking the customer for his name and a favorite movie category. In this project you only include one favorate movie category (e.g. "actions"). The options for the favorite movie categories should include at least three choices, one for each movie category that you have used in the last projects. If the user clicks the "submit" button, the user name must be non-empty, but the category is optional. If the user name is empty, they should get a error message, with an option to return to this page. All obtained information should be stored in the client side as cookies. After the user submits the information, a new welcome page is created by your servlet in the Main Area with a message "Welcome Mr. ***! Your favourite movie category is ***' as well as a hyperlink 'Go to your favorite movies!' which in turn links to the movie table of the customer's favorite category. You can design the interface any way you like, as long as you have a welcome message and links to browse and to go to the favorite movies. For example: assuming this is the first time Will Smith visits your store, he will see: After filling in his name and his favourite category ('action') here, he clicks the submit button. Now he will see the following page:
2. If this is a registered customer, a greeting message with the user name should be printed on a web page in which the movie table with the favoriate user category is displayed. 3. Add three more buttons or links in the left area: Home, Favourite
and Preference.
4. Please note that there will be only one HTML entry page and one servlet serving all the features described above (although you can include more than one class file in a package) 5. Put the URL of the entry page in your project hand-in table. Also, put all the source code of the servlet to a html document, and link to it from the project table.. |