Apache Web Server, Java Web Services - Hello World Tutorial

Does anyone know where I can find a good tutorial on configuring apache and java web service (Hello World)?

I'm new to Apache and Java Web Services (do I need Tomcat?). I need a simple Java web service that can receive a simple HTTP request from a client (e.g. www.somedomain.com/service/001/notify). The idea is that the client makes an Http request and the Java web service receives the request and runs the appropriate Java code on the host.

Sorry for the gaps in my knowledge, so I need to have a tutorial.

In short, I would like to do this:

CUSTOMER:

new Request("www.somedomain.com/service/001/notify"); 

JAVA WEB SERVICE:

 public void notify(int serviceID){ System.out.println("Service " + serviceID + " says 'Hello!'"); } 
+4
source share
1 answer

This video is a bit outdated; but this is a good tutorial for an absolute beginner .

In addition, Tomcat is what is called a servlet container. To see the difference between servlet containers and web services, here is a useful thread: The difference between servlet and web service

You must remember that Tomcat is just one of many options. If you must use it for study / work, then go. But if you have the freedom of choice, I would recommend using a java application for google applications (the tutorial is here: http://code.google.com/appengine/docs/java/gettingstarted/ ). Under the hood, they use Derby (I think most Google products run Derby, but I don't know for sure).

The reason I recommend it is because from my experience with installing the servlet kernel, etc. so far has been the easiest. It also has a free hosting quota that you can keep as it will obviously be a trivial / training experience. In terms where servlet containers are better than others, I don’t think it will matter at your exposure level. Despite the fact that I have been talking with them for several years, for me it does not really matter ...

+4
source

Source: https://habr.com/ru/post/1390884/


All Articles