0

I've written web services for a while using javax.ws.rs. But every time I've used them, I've had the server I was deploying them to (Tomcat 6.0) integrated directly with my IDE, so setting them up was all taken care of for me, behind the scenes.

Now, I'm trying to set up my own private server at home, and one of the things I'd like to do is have some Java services to perform some of the more hardcore processing. How do I actually get the service to be linked up with the URL specified by the combined @Path annotations?

asteri
  • 11,402
  • 13
  • 60
  • 84
  • http://vertx.io/ might be the way to go. – Robert Harvey May 20 '13 at 22:03
  • Are asking how to install and configure Tomcat? The Tomcat reference documentation will tell you that. Or do you mean something else? – Raedwald May 20 '13 at 22:20
  • I already have the Tomcat server up and running on `localhost`. I just don't know specifically how to get it so that I can navigate to, say, `/service/MyClass/myRESTMethod?` and have it redirect to my service. – asteri May 20 '13 at 22:40
  • Doesn't Java EE 6 specify that appservers should scan the classpath for annotated classes these days? I remember hearing something about that being added or at least considered. Maybe just packaging a WAR and dropping it in might work. (Although it might not with Tomcat because it's terrible idiosyncratic.) – millimoose May 20 '13 at 23:01
  • Also: [How to deploy a JAX-RS application?](http://stackoverflow.com/questions/2072295/how-to-deploy-a-jax-rs-application) – millimoose May 20 '13 at 23:02

2 Answers2

0

You will need to setup a Tomcat Webserver and deploy your web application there.

While deploying the web application you will specify a path to that application (e.G. 'test').

Then you can address your service like: http://myHostname.cx/test/service/MyClass/myRESTMethod?parameter=value

Angelo Fuchs
  • 9,825
  • 1
  • 35
  • 72
0

There are lots and lots of alternatives.

First question: what is your server? The answer appears to be "Tomcat".

Second question: what language do you feel most comfortable with? The answer appears to be "Java".

So check out these tutorials:

You don't need Jersey (or vortex.io, as Robert Harvey suggested) ... but they'll make your life easier.

'Hope that helps!

PS:

If you're using C# and IIS, this might be of interest:

http://msdn.microsoft.com/en-us/library/dd203052.aspx

paulsm4
  • 114,292
  • 17
  • 138
  • 190