I am following this tutorial to create a REst service using Jersey.
Sometimes I donβt completely understand what the author of the textbook means, but these are the steps that I have performed so far:
1) Created a dynamic web project and named it: de.vogella.jersey.first
2) Installed Maven dependencies on eclipse
3) Converted my project into a Maven project (this means that you created the pom.xml file)
4) Added necessary dependencies in pom.xml so that I can use jersey without having to manually add jar files. I added the following xml:
<dependencies> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-server</artifactId> <version>1.17.1</version> </dependency> </dependencies>
5) The author suggests creating a java class and providing some code. I can only assume that he wants us to create a new package in the src folder, name it de.vogella.jersey.first , and then create a java class and name it Hello and put the code there. Here is what I did.
6) Then he offers to open the web.xml . However, there is no such file in the project. Therefore, I continue and create such a file in the path WebContent/WEB-INF/lib . I am posting the code that it offers.
7) The next step, which I do not understand the most. It talks about the web.xml we just added, and more specifically it states:
The parameter "com.sun.jersey.config.property.package" determines in which package the knitwear will search for web service classes. This property should point to your resource classes. "
8) The last step opens the URL http://localhost:8080/de.vogella.jersey.first/rest/hello in my browser. However, I get HTTP Status 404 - /de.vogella.jersey.first/rest/hello
What should I replace com.sun.jersey.config.property.package with exactly?
Are the steps that I have performed so far correct, or am I misinterpreting something?