Web Assignment 3
Please add the ability to list/show Supplier
You will need to code/configure:
a Servlet
a list Suppliers jsp
a show Supplier jsp
edit the index.jsp to add the link to list Suppliers jsp
I want to see all the Supplier details
On the show Supplier jsp, I want to see a list of Products
for the Supplier, I want to see a link from the displayed
Product to the show Product jsp to see the details for
the Product
On the show Product jsp, I want a link from the Supplier id
field to the show Supplier jsp to see the details for the
Supplier of that Product
Warning!!! to get showSupplier to run
I need to call doPost() in the SupplierServelt
and pass a field named "supplier"
containing the SupplierId
If I make a link, then I am running doGet()
so how do I get a form post submit on
a "link" type field
I cheat... I use JavaScript
in showProduct.jsp, I have:
${product.supplierId}
(Click to see Supplier)
your SupplierDAO will need a method to findAllSuppliers
and a method to findSupplierById
your ProductDAO will need a method to findProductsBySupplier
your Supplier Entity class must be written and tested
REMEMBER: If you edit an Entity or Action class you must run
Maven Install to rebuild the jar file needed
by the web project
As a "starter" I will share a JavaScript file that
offers a Form POST and a GET link, you can use in your code
see: utility.js
Optional:
can you add the ability from the show page for the User to
get back to the list page?