Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need some help creating this Java program on NetBeans IDE(You can use another IDE if you want) Assignment Instructions Below: ' Develop a web

I need some help creating this Java program on NetBeans IDE(You can use another IDE if you want)

Assignment Instructions Below:

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
' Develop a web application named hwE. The application must meet the following requirements. The purpose of this application is to take user's book order request. When the application is deployed. it must display a book list page, which is a JSF' page [see Figl}. Make your own book list {Fig.lil is just an example]. Now. this book list must not be hardcoded or read from a text le. Instead. it must be read from MySQL database named th. particularly from table named Book. One way to do this is to use servlet as landing page. and let the servlet forward data to J SP. Each book must be displayed with its cover image. title. price. and an Add to Cart button. Do not download any image le into your project. Instead. provide a link to each image to display it (this information must be stored under Carer column of Book table of your database). User may click on Add to Can button to add one book at a time to the cart. Each time Add to Cart button is clicked. the app displays the can; page. which is another J SP page [see Fig.@). This page must display a table of books selected by the user so far. As shown in Fig. each selected book must be displayed with its cover image1 title. price1 amount. quantity textbox with an Update button. and a Remove item button. User may update the quantity for each selected book using the quantity textbox and Update button. Each time the Update button is clicked. the table must be updated and redisplayed. User may also entirely remove a book in the table using Remove Item button. Each time the Remove button is clicked. the table must be updated and redisplayed. If user enters [l in the quantity textbox and click Update, it has the same effect as clicking on Remove Item. The cart page also provides Continue Shopping button. If this button is clicked. the browser goes back to the book list page. Then user may add more books. Note that all the previously selected books should stay selected, no matter how many times the user goes back and forth between book list and cart pages. The cart page also provides Checkout button. If this button is clicked. we consider that the user has made the nal decision to purchase all the selected books, so browser moves to the sign-in page (another J SP) (see Fig. II. As shown in Fig.@. the sign-in page takes user's login infonnation including email address and password. Then. the app searches the database hwfn. particularly the table named User, to check if (1) the email address exists. and {2) if the password matches the data stored in the User table. If the email exists and the password matches the data, the browser moves to the thank you page (Fig). If the email exists but the password doesn't match. the browser re-displays the sign-in page with a message: \"The password does not match. Please try again." (see Fig.l:4I). If the email doesn't exist in the database. the browser moves to the registration page {Fig.l) where the user can sign up for the rst time. Once the user clicks Join Now button. the user information (email, password. rst name. last name} must be inserted into the database {User table}. so next time a roturning user should be able to bypass this registration page. After the Join Now button is clicked. the browser moves to thank you page. As shown in Fig.@ the thank you page lists the user information followed by all the items selected by the user. with total charge in the bottom row. The thank you page allows user to click on Return button to go back to the book list page. However. once this button is clicked. the cart is reset so the user will have to start over with an empty cart. - Before you start coding. you should rst create a database Ins-5. tables User and Book. and also a database user named student with a password sesame. - To do this. download creste.dstsbase_hw5 . sql from Canvas and run this script on MvSQL Work- bench while connecting to your local MySQL database server. Study the details of this sql script to see how the tables Use 1: and Book are structured. - Before executing creste_ttatabsse_hw5. so 1. add 50L commands to the script to insert your brutks into Book table. lling Cover. title. and Price columns. - You should submit your {modied} create_database_hw5 . sql as well. - Make sure your web application is properly set up with the exact same database conguration as above. including database tit-r5. tables User and Book. database user student. and password sesame. otherwise your program might not run properly when graded. - Once your program is submitted. it will be tested on the grader's computer that runs the same-named database has and the tables User and Book created by the same sql script as above. Make sure to zip all your files into hw5 . zip, then submit your hw5 . zip as a single file. Do all the assignments on NetBeans using Java language.* Create the database named hw5, its tables, and a database user DROP DATABASE IF EXISTS hw5; CREATE DATABASE hw5; USE hw5; CREATE TABLE User ( UserID INT NOT NULL AUTO_INCREMENT, Email VARCHAR (50), FirstName VARCHAR(50), LastName VARCHAR (50) , Password VARCHAR(50), PRIMARY KEY (User ID) INSERT INTO User (Email, FirstName, LastName, Password) VALUES ( 'bat@gmail. com', 'Bat', 'Man', 'bat' ), ('spider@gmail. com', 'Spider', 'Man', 'spider' ), ( ' super@gmail. com', 'Super', 'Man', 'super" ); -. Create student and grant privileges DELIMITER / / CREATE PROCEDURE drop_user_if_exists ( ) BEGIN DECLARE userCount BIGINT DEFAULT 8 ; SELECT COUNT(*) INTO userCount FROM mysql. user WHERE User = 'student' and Host = 'localhost'; IF userCount > 0 THEN DROP USER student@localhost; END IF; END ; 1/ DELIMITER ; CALL drop_user_if_exists() ; CREATE USER student@localhost IDENTIFIED BY 'sesame' ; GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON hw5.* TO student@localhost; USE hw5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions