I've recently got into Java EE which seems a bit confusing to me so I've tried to figure out how some of the components involved in developing web through Java EE work.
I've noticed that unlike a servlet you don't need to add a tag in web.xml
for a WebSocket, instead u use the @ServerEndpoint
annotation to map the socket to a URI. Now I see that there is the @Servlet
annotation that does kinda the same thing.
So I am curios, those two annotation are doing the same thing, and if so, is it any difference, in the case of a servlet, between using the annotaton or the xml tags ?