Search code examples
javaweb-servicesjax-rsweb-infmeta-inf

Web Services in Unix. What should be the directory structure


I earlier got to create a simple RESTful webservice on my localhost using Eclipse IDE, Tomcat, and JAX-RS libraries.

I am now trying to move the same on to a different unix server which has Tomcat installed. I am not knowing how to get started as in what is equivalent to creating a "Dynamic Web Project" that I do in Eclipse. Do I need to just create a directory myself with all the sub-directories as created by Eclipse? Should this directory be placed in webapps folder in Tomcat container. Should META-INF and WEB-INF also be created by myself?

Where should I put my Java classes?

Can somebody please clarify this or direct me to any documentation about the same.


Solution

  • You need to package your application in a WAR file.

    The Sun Java EE 6 Tutorial has a chapter deciated to packaging.

    It's pretty easy to export a web application as a war in Eclipse.