Forums Register Login

Creating a recipe database (Step 2: Creating webservices to access the database)

+Pie Number of slices to send: Send
Using Tomcat 8, I am creating a new web application called 'recipewebapp', while aiming to create the appropriate data structure 'recipewebapp'...
Using this web.xml file, this is what I have so far...



This is what this web.xml file corresponds with, according to what I have created in Tomcat 8 so far on my virtual machine:
C:\progs\tomcat8\webapps\recipewebapps\WEB-INF\classes\com\cs330\meals

I have created this web.xml file to access these three web services, which are accessible from the following URLs:

To retrieve all recipes (aka all values in my MySQL 'recipe' database).
http://localhost:8080/recipewebapp/reciperesources/rp1/recipes

To retrieve recipes by id (aka all values in my MySQL 'recipe' database by a specific given ID).
http://localhost:8080/recipewebapp/reciperesources/rp1/recipes/2

To retrieve recipes by numOfServings (greater than or equal to the parameter) (aka all values in MySQL 'recipe' database by a specfic variable called 'NumOfServings').
http://localhost:8080/recipewebapp/reciperesources/rp1/recipes/recipe?serving s=6

This is the MySQL database code in which the web.xml is associated with:


All of this seems right so far - however, now I have to create some java code to associate with both the web.xml code and the MySQL code alongside it, which looks like this so far... With my aim being to match what goes alongside the MySQL database code.



Unlike before, I have made some effort to re - type this code a little and make it match what's require of it in MySQL. If there are any suggestions on how I can tweak or improve this code, it would be greatly appreciated.
Thank You.
+Pie Number of slices to send: Send
Please edit your code to have proper indentation -- large blocks of unindented code are just too hard to read.
Look! I laid an egg! Why does it smell like that? Tiny ad, does this smell weird to you?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1070 times.
Similar Threads
Web server code not working properly
Creating a recipe database (Step 1: Creating a database via MySQL)
Need help with insert values into access
Too few parameters
Need help with simple recipe program
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 20:14:02.