CSE3OAD/CSE4OAD – Assignment 2
The aims of the assignment are:
• To implement web services for making available resources regarding a collection of recipes.
The recipes are those that you have worked with in assignment 1.
Using Java Reflection and Servlet API
• To apply the relevant validation strategies to the grocery, using the Validation Framework
we built in Lab 07.
The following are provided in the recipeWS directory (of the zip file)
• The jar files for JSON conversion and MySQL driver (in directory lib)
• The Java files for validation (in directory validate) some of them need to be
You can adapt this file to your own need. However, the table name must be recipe, and the
structure of this table must be exactly the same as that shown in the SQL script.
• The class Recipe.java
• The class RecipeDSC.java
• The class Helper with methods for JSON conversions
• The class RecipeWS (To be COMPLETED)
Building Web Services
You are required to build the web services to
• Get all the recipes o Parameter: None o Data Sent
(to server): None
o Data Received (from server): JSON array representing all the recipes
• Get the recipe of a given id o Parameter: an id (to
be attached to the URL)
o Data Sent: None
o Data Received: JSON object representing the recipe
• Add a recipe o Parameter: None
o Data Sent: JSON object representing the recipe o Data Received: JSON object
representing the recipe
• Edit (update) a recipe o Parameter: an id (to be
attached to the URL) o Data Sent: JSON object
representing the edited recipe o Data Received:
JSON object representing the newly updated recipe
• Delete the recipe of a given id o Parameter: an id
(to be attached to the URL)
o Data Sent: None o Data Received: None
The URL for all requests should be: http://localhost:8080/recipeWS/recipes
Your program must be tested by Postman.
本网站支持淘宝 支付宝 微信支付 paypal等等交易。如果不放心可以用淘宝交易！
E-mail: firstname.lastname@example.org 微信:itcsdx