Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

Daniel Hartin
Daniel Hartin
18,106 Points

Java - JAXRS have you used it?

Hi Guys

I've been tasked with creating a new app for the company I work for and I am struggling at the first hurdle as I have almost no server side coding experience. I am confident with both JAVA and the android SDK so this is no problem only time consuming. We have at work our own web server which I use in other apps to reference/download files directly (no security needed), but i'm struggling when I need that extra layer with an API so as not to expose the database to the client (and indeed the world).

I need to create a database that I can edit through a CMS (no problem here, I can create a java application). I'm am struggling however with how I could then expose this database to the web through an API of some kind. I did research ASP.NET but having little experience with C# and Visual Studio I decided against this. I came across JAX-RS which can be used to create a RESTful application using Java.

Now the JAX-RS looks a little awkward to get started with, not so much the coding but how do I deploy/host this on the web server (I thought this would be the easiest bit, I assumed I could simply drop the .jar/.exe on the server thus creating a URL and hey presto). I get a little lost when it come to packaging as a .war in a .ear and nowhere have I found anything which details how to deploy to your own web server as i'm kind of in a unique situation compared to most.

I realise this is quite specialised but any help would be appreciated especially if you can point to any tutorials/code examples. Again i'm confident I can get my head around creating the API with a bit of research but I don't know how I would host this to try it out and check my code through a URL.

Thanks Daniel