关键词 > Java代写

Assignment 4 Enterprise Computing with Java

发布时间:2024-06-26

Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Assignment 4

Enterprise Computing with Java

In this assignment you will continue developing and enhancing functionality of the SRS application that you started working on in the previous assignment.

Objectives

•    Develop “Login” use case implementation in the SRS web application.

•    Add functionality and Java code needed for using the H2 database for managing the user personal information.

Requirements

Step 1. We start from adding the H2_784_DB database to maintain personal information about the user registered to the SRS application.

•    We will be using H2 relational database management system for supporting the SRS H2_784_DB database.

•    H2_784_DB database should have the following tables:

o STUDENT;

o COURSES;

o REGISTRAR.

•    STUDENT table should have the following columns:

o User_ID

o Password

o First_Name

o Last_Name o SSN

o Email

o Address

•    COURSES table should have the following columns:

o Course_ID

o Course_Title

•    REGISTRAR table should have the following columns:

o Course_ID

o Number_Registered

Note:

o The SRS system will use Data Source-based method of accessing the H2_784_DB database.

o The Data Source JNDI name to look up for connecting to WildFly Server has to be provided as initial parameters.

Once the H2_784_DB database is created and all required tables are defined, please go

ahead and develop Java code for accessing and manipulating with data in this database within the “User Registration” use case developed in previous assignment (as yiou remember, we

have simulated any access to the database back in ptresvious assignment. So, now we will replace that simulation code with real Java code for processing data in the H2_784_DB database controlled by H2 DB.

Step 2. To develop Login use case

•    The “Login” use case has to be developed using Java Servlets, JSPs and supporting Java Beans.

•    The “Login” use case will continue following MVC pattern, with the controller, Registration Controller Java Servlet, being developed in previous assignment.

•    The "Login" use case starts from presenting the following login form to the user:


•    If a user hasn’t registered yet, he/she has to click on “Register” button, then the SRS application will be dispatch to the “User Registration” use case that we have developed already in previous  assignment.

•    If a user is registered already, he/she can attempt to loigin using correct User ID and Password.

•    If both User ID and Password are correctly validated against data within STUDENT table in the H2_784_DB database, this user is going to be greeted with the following message:


with first_name and last_name retrieved from the STUDENT table in the H2_784_DB database.

•     During login process, the syntax validation of the User ID and Password parameters has to occur as follows:

o  the length for both should be 8-16 characters.

o  neither one can contain "space".

•     Then, the Login component will access the H2_784_DB database to validate an existence of the user account there.

If User ID and/or Password are invalid or do not match any data in STUDENT table, then the

application returns an appropriate error message and suggests the user trying to login again or to register with the SRS application.


•    After N unsuccessful attempts, the system terminates user session with an appropriate error     message. Note: a predefined number of login attempts must be defined as an initial parameter of the Login component provided by the web container as web application configuration

parameter (using web.xml file).

Note about H2_784_DB database:

o The H2_784_DB database used in the implementation has to be included in the "master" jar file and be physically located right at the highest level of JAR structure.

o All tables in the database have to be pre-defined and pre-populated with data to be used during the review and grading process.

o One existing combination of userID/password that can be used for reviewing and grading should be specified in README file.

o To unify the definition of DataSource for describing the database and therefore to

simplify the review and grading process, please use the following DataSource in your implementation:

data-source add --jndi-name=java:jboss/datasources/H2_784_JNDI --name=H2_784_DS

--connection-url=jdbc:h2:~/784/H2_784_DB;DB_CLOSE_DELAY=-1 --driver-name=h2

o Please ensure that your code uses this DataSource defined above.

What to Submit

Please create and submit one 'master' jar file containing.

•    Text-based README file describing content of your submission and detailed instruction of how to build it, package and deploy it on the WildFly Server, and how to execute it on the web

browser.

•    The full SRS web application directory with all Java components, Java source code, Java

compiled classes, configuration files, all other files necessary for packaging and deploying the SRS application.

The H2_784_DB database directory.

•    All the screen shots you collected working on this assignment (you can paste them into a Word document).

Submit your file to this Assignment item.