Create a Web Application to perform CRUD operations

Assignment Help JAVA Programming
Reference no: EM132268840

Java EE Programming Assignment - Dynamic Web Application with Servlets, JSP, JSTL and EL

Overview - In Assignment, you create a Web Application to perform CRUD operations on a data structure that stores information about customers. Unlike a more realistic examples, no database is involved: the customer, account and address information is stored in memory and accessed by the class CustomerManager from assignment 1 and 2.

Users can add customers and lookup customer information by selecting customer's account number from a list. Users can also delete and update a customer.

Instructions -

1. Get the start-up code by downloading the file Assignment3StartupWeb.war from eCentennial under Student Activities -> Assignments.

2. Open Eclipse. Using a new workspace is recommended.

a. Work in the Java EE perspective or the Web perspective.

b. If your workspace does not already have one, create a new Wildfly server.

c. Make sure your Wildfly server starts successfully.

3. Import the startup WAR. During the import:

a. Change the Web project name to include your group name. For example, for group called ABC, the project should be called Assignment3_ABC_Web.

b. Specify target runtime Wildfly.

c. Do not add your WAR to an EAR.

d. When the import is complete, verify that your Web project has packages of Java classes.

4. Look at the code you are given. Package assignment3.dto contains three data transfer objects and package assignment3.data contains model layer class.

Take note of public methods in the model layer because your servlets must call them.

a. Class Customer is a JavaBean that represents one customer. The Customer class has fields accountNo, name, mobilePhone, homePhone, emailAddress, status, account, address. Note that account and address fields are also collections, which says a customer can have multiple accounts and addresses. The Customer class also has a default constructor that takes all arguments and it has the standard methods such as toString(), hashCode() and equals().

b. Class CustomerManager is a singleton that stores customer information in memory a data structure of type Map<String, Customer>. In addition to public CRUD methods getCustomer(), addCustomer(), deleteCustomer() and updateCustomer(), getgetAllCustomers() public method returns a Collection that holds all customers.

5. Create a welcome page, index.jsp.

a) This page should have a button or link to add a customer.

b) This page should display all Customers in a tabular format and users should be able select them to view, delete or update.

6. Create the page addCustomer.jsp.

a. Design of this page is up to your imagination. You can either get Account and Address information on the same page where you get customer information or you can create separate jsp pages to collect Account and Address data. However, if you create separate pages, you need to make sure that account and address belong to the same customer you are trying to add. Use AccountNo to connect them. Your UI design should allow end user to add as many Address and Account as possible. In order words, your page should be dynamic to accept multiple addresses and accounts.

b. If the user clicks Add, a servlet creates a new Customer object and adds it to the data structure. If the user clicks Cancel, the servlet responds with index.jsp. Keep in mind Customer object would have Address and Account collections.

7. Write a servlet to process the add-customer form.

a. Put all servlets in a Java package called assignment3.servlets.

b. Later, you will add exception handling for user-input errors. For now, assume users always enter valid data.

c. When done, the servlet returns the user to index.jsp.

a. Decide what scope customers should be stored in. Consider the following:

i. This Web application has no log-in and customer objects have no associated owner.

ii. The deployed application may be made available to many people.

b. You can't avoid duplicating some of the information also stored in class Customer but minimize the amount of data stored outside the model-layer. You should NOT have more than one customer with the same account number.

c. Use <href> tag also to display one link for each stored customer. Ideally, the link (URL) should include Customer account number so that users can click on it.

8. Write a servlet to get customer information when the user clicks customer's account on index.jsp. The servlet then responds to the user with a JSP page that shows details of a customer.

9. Create showCustomer.jsp JSP page to display customer details.

a. The display- customer JSP page may look similar to the add- customer form where data values can be edited except account number.

b. If the user clicks Cancel, the servlet redisplays index.jsp.

c. If the user clicks Update, a servlet updates the customer form the data structure and then redisplays index.jsp.

d. If the user clicks Delete, a servlet deletes the customer form the data structure and then redisplays index.jsp.

10. Test and make sure users can add, update and delete customers.

a. Do new customers appear on index.jsp when customers are added?

b. Do new names disappear from index.jsp when customers are deleted?

c. Do you see updated values on index.jsp when customers are updated?

d. When the happy path works, (the application handles all good user input) export your project to a WAR.

11. Add error handling. Handle exceptions the following ways:

a. To report a CustomerNotFoundException or a DuplicateCustomerException, write another JSP page to display error messages.

i. A CustomerNotFoundException should never occur if your code is working properly but allow write the JSP page so that one page can display a variety of messages.

ii. The error page must include a link to index.jsp so the user can try again.

b. When users submit the add-customer form with missing or invalid information, exceptions of type CustomerDataException should occur. In this situation, use the fact that JSP expressions that evaluate to null are not displayed.

i. Modify the add-customer servlet to redisplay the add- customer input form after a CustomerDataException occurs.

ii. Pass the exception message back to the JSP. Also pass the values that the user entered previously so that the user can see the error.

iii. Add expressions to the add- customer form to display the error message (if there is one) and to display what the user typed previously into the entry fields.

12. When you are ready to submit, export your Web project into a WAR and call the file with your group name such as Assignment3_ABC_Web.war.

a. To make sure your solution includes source, do one of:

i. Import your WAR back into your workspace but into a new Web project with a different name. Check that the new project contains all your files including Java source.

ii. Open your WAR with a utility such as WinRAR or WinZip. Look for files with extension .java in folder \WEB-INF\classes\assignment3\servlets.

b. Remove all projects from the server and stop the server before you exit from Eclipse.

13. Upload your WAR file along with README file to the Assignment folder under Assessments on eCentennial. Double check that your WAR file includes java files as well.

Attachment:- Assignment Files.rar

Reference no: EM132268840

Questions Cloud

How the notion of the moral good present in utilitarianism : Analyze how the notion of the moral good present in utilitarianism, and the characteristics that you identified in particular, shape the approach to solving.
What is the purpose of the tool : MAN2021 Write a 300-word report describing the strategic management tool you chose and why you selected it. Explain how the tool works and why it will be.
What mistakes and best practices have you seen : What mistakes and best practices have you seen? What would you change and why?
Techniques are the most valuable for your strategic plan : What forecasting tools and techniques are the most valuable for your Strategic Plan? What assumptions are you making?
Create a Web Application to perform CRUD operations : COMP303 Java EE Programming Assignment - Dynamic Web Application with Servlets, JSP, JSTL and EL, Centennial College, Canada. Create a Web Application
Explain how fixed cost differ from variable cost : Explain how fixed cost differ from a variable cost. Use specific examples to solidify your point of view.
Write a perl script to automate task : CMT304 Programming Paradigms - Cardiff University - Script programming and Quantum Computing - need to maintain the directory structure when storing the removed
Write a memo based upon the hypothetical company : As you know human resources professionals are often required to write memos to express their views on how employees are treated to improve the effectiveness.
Covenant of good faith and fair dealing : The "covenant of good faith and fair dealing" as related to employment-at-will implies that excellent performance over an extended period of time grants

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create a login form

In this week's lab, we will create a login form, validate a user based on their login name and password, and allow them to access the system or not

  Programming sorting algorithms

Describe an approach to modifying the Sorts.java program so that after calling a sorting method the program prints out the number of swaps needed by the sorting method.

  What balance will be stored

Let Account be the bank account class discussed. What balance will be stored in acct1, acct2, and acct3 after the following statements have been executed

  Define a collection of nodes that are arranged

Defines a collection of nodes that are arranged in a linear order. The order in a linked list is determined by a reference in each node.

  Create a program that accepts a 10-digit phone number

Create a program that accepts a 10-digit phone number (no 1 in front) and tells the user if the message is a toll-free number.

  Explain a gui interface using advanced java swing classes

Implement a threads and a GUI interface using advanced Java Swing classes. The project will be graded according the criteria for the final project

  Creation of classes and objects

Introduction of programming using the Java language. The foundation of object-oriented programming will be th topic here. This will include creation of classes and objects, object responsibilities and characteristics, and UML class diagrams

  Create a non-gui based java application

Create a non-GUI based Java application that calculates weekly pay for an employee. The application should display text that requests the user input the name of the employee.

  Organizing the layout of each panel

Assignment class Student encapsulates the student information relevant for universities

  Solve computer science java validation problem

Computer Science, Operating Systems - Year 1Description:java validationProblem: Using NetBeans 7.2

  Draw an inheritance diagram show relationship among entities

Consider the following description. Every employee and every student is a person. Draw an inheritance diagram showing the relationship among the entities. Mark clearly the name of each entity.

  What is an illustration of a javascriptr framework in the

what is an example of a javascriptr framework? in the framework you have described what is an example of an application

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd