HeartAttackCat / TomcatDonutStore

Web development course server page.
0 stars 0 forks source link

Menu modification server let and HTML (or JSP) page. #22

Open MoonBasedKas opened 2 days ago

MoonBasedKas commented 2 days ago

We will need to design and create a server let that will allow an admin to modify the Menu (Access control will be a separate issue). The choice of using a servet let and/or JSP will be left to the implementor. You may also use seperate server lets to implement each action.

The Admin must be able to perform the following three actions:

  1. Add donut
  2. Modify donut
  3. Subtract donut

Add Donut For add donut, you will need to gather all the donut information except for an ID. The database will handle generating the id. You will want to encapsulate all of this information on the serverlet's end into a Donut object and call the insertDonut(Donut) method on DBfetcher.

Modify Donut For modify donut, you will need to gather all the donut information, including the ID. Encapsulate that into a Donut object on the server, let then call the modifyDonut(Donut) method on DBfetcher.

Delete Donut You will need to obtain a donut ID where you will call the deleteDonut(Int) method on DB fetcher. This will delete the donut from the database.

Upon completion Should prompt the user that the requested modification has been made and reload the page to show the updated menu.

The form(s): To achieve this, we can go about this a few different ways. I'm also open to any suggestions.

  1. Combine everything into a singular menu and determine which operation to do by which values are Null. (Confusing approach)
  2. Have a separate form for each.
  3. Have a form beforehand and use JavaScript or JSP to generate the desired form.
MoonBasedKas commented 1 day ago

For deleteDonut() and modifyDonut() if a given donut does not exist the methods will return -1 to let the caller know.

Korbrent commented 6 hours ago

I'm also open to any suggestions.

A drop-down selection for:

The form can remain the same with the fields just being properties of the donut.