Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment 6 (Points: 100) Servlets and JSP Application Set Up Take the project that you made from last week and put it into a new

Assignment 6 (Points: 100) Servlets and JSP Application Set Up Take the project that you made from last week and put it into a new git project on gitlab. Ensure that JUnit is included in the Gradle dependency management file.

Java Files

In our customer support application, we are going to have some Plain Old Java Objects (POJO). Thesewill be Ticket.java, Attachment.java, and TicketServlet.java. make these three classes in your projectand setup JUnit tests for them. Attachment will be a Java Bean. A Java Bean is a class with private fields and getter and setter methods for those fields, but nothing else. The fields for Attachment will bea name for the attachment and a byte array to store the contents of the attachment.

Ticket will be a class that defines each customer's issue in a ticket form. The Ticket fields will be customer name, subject, body of the ticket, and a hash map to store the attachments that go with theticket.

The class will have the regular getters and setters for those fields. Ticket will also have a method to get an individual attachment and a method to get all of the attachments.

Along with those two methods will also be the following methods: addAttachment and getNumberOfAttachments.

Make sure that there are tests for each method of these two classes. These classes are the only ones thatwe will be writing tests for.

TicketServlet will be our servlet file that will handle the requests for tickets from the user. We will need a Hash map that will keep track of our tickets. There will be the override of doGet anddoPost methods. There will be some additional methods that will pull up our jsp pages that we will talkabout further down in this assignment.

The doGet will check the request parameter using a switch that will then call the correct method basedon which parameter is in the request.

JSP Files viewTicket - will be a jsp page that displays an individual ticket listTickets - will be a jsp page that displays all the tickets ticketForm - will be a jsp page that gives a form to create a new ticket

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