I'm coding my first servlet (academic purpose) and I not have clear what is the proper way to do the interface with HTML client.
If the client requests are of many type, like "I want a coffee", "I want a pizza" etc, (actually I think I'll need only login and data send/request) however, how the servlet must handle these? considering that a servlet have only one get/post method.
A) one servlet (serverAddr/myApp/myServlet) that check with a parameter which request is received and call the proper function (with a switch. Don't sound good).
B) a servlet with specific purpose for each request, like "doCoffee" (serverAddr/myApp/coffee), "doPizza" (serverAddr/myApp/pizza) etc. In this case, I have many servlet that form the web application.
I hope have explained my question, thanks.