Keep this file intact, copy your solution codes from your IDE and paste at the bottom of the file under ‘Answer’. Submit this word document with your codes. Do not change the format of the file to pdf or rar or anything else.
Design a HTML document to display the following and write a Java Servlet Program that represents a pseudo NJIT registration web application where students can perform two tasks 1) search for courses and 2) register in courses. This is achieved through interaction with database.
Following are minimum requirements:
You will develop a client side and a Servlet program that will work with a database.
- The client (front end) should have a title “NJIT Registration System” and display a welcome message “Welcome to course registration site of NJIT”.
- It will also display two radio buttons 1) ‘Course search’ and 2) ‘Course registration’.
- When you click on the radio button ‘Course search’ the following appears on the webpage:
- A. A drop down list box with label “Semester” and a submit button “Submit”.
- B. The drop down list box will show ‘select semester’ by default.
- C. When you click open the drop down list box it will have two more items “Fall2021” and “Spring2022”. Students should be able to select either.
- D. After selecting semester “Fall2021”, student clicks on the “Submit” button. It will send a query to the database and return a result that you will display on the webpage as follows.
- E. After selecting semester “Spring2022”, student clicks on the “Submit” button. It will send a query to the database and return a result that you will display on the webpage as follows.
- F. This presentation of data can be done in one of the two ways (both carry same marks):
- I. Like its shown here - a message format.
- II. Tabular format (in a table).
- When you click on the radio button “Course registration”, following appears on the webpage:
- A. A text box “CourseID”, a text box “Semester” and a button “Register”.
- B. Student will enter a CourseID, a semester and click on the button “Register”. This will send a query to the database which will have two possible outcome:
- I. If the query finds a match, display a message on the client like “You are registered in Artificial Intelligence for Fall 2021”.
- II. If the query doesn’t find a match, display a message on the client “The course is not offered”.
Handle the following errors with an appropriate message displayed on the webpage:
- On ‘Course Search’ option, when a student do not select Semester as “Fall2021” or “Spring2022” and click on the “Submit” button. This will send a query to the database which will not return anything. Do not code to check on the client. Let the query fail and that failure should reflect on the client.
- On “Course Registration’ option, when a student do not have input on ‘CourseID’ field and/or ‘Semester’ field and clicks on “Register”. This will send a query to the database which will not return anything. Do not code to check on the client. Let the query fail and that failure should reflect on the client.
- There can be other error situations too but this much is good enough for the test.
- Create a database “NJIT”.
- Create a table “Courses” in that database. The database should have only the required data as displayed on section 3D and 3E. Those four rows of data should be good enough.
There are 15 points for the design aspects and aesthetics. The points to consider is user friendly client, placing of components in a well-designed flow, good use of color and fonts to enhance look and feel. Appropriate and to the point messages (you can add your own language for any or all the messages).
This is what you have to submit (zip up all the files mentioned below and submit the zip file):
- Client program and Servlet program - paste the codes at the bottom under “Answer”.
- Screen shot of the client after you run the client program.
- Screen shot after radio button “Course Search” is checked.
- Screen shot of “Course search” option where a successful search is done and result is displayed on the client.
- Screen shot of “Course search” option after an unsuccessful course search is done and error message is displayed on the client.
- Screen shot after radio button “Course Registration” is checked.
- Screen shot of “Course registration” option after a successful course registration.
- Screen shot of “Course registration” option after an unsuccessful course registration.
- Screen shot of the content of your table “Courses” (run a select * from courses and then take the screen shot).