views:

77

answers:

4

I develop Java applications with Eclipse that process data. So far I only developed stand alone applications that take data from file or database, process the data, and output the results to the console/file/database.

I would like put my application online. I never did any web development, but from my understanding, the only difference is that my code needs to be on a web server that can get http requests from users, and return http response based on my application's result.

I would like to get advice on the easiest way I can do this. What technology do I need to learn and what tools I can use for making the transition easier. I would also like to separate my code from the code related to the web stuff.

Thanks a lot!

A: 

The easiest is most likely to learn how to write a simple servlet, how the HTML looks that you want to generate and then adapt your existing application to run inside the servlet code, and print html instead of just plain text.

This is described in the servlet part of the Java JEE tutorial (which is not great, but a start)

http://java.sun.com/javaee/5/docs/tutorial/doc/bnafe.html

If you want a more accessible book, I can recommend the Head First series. http://oreilly.com/catalog/9780596005405

For a web container, Apache Tomcat is fine. http://tomcat.apache.org/

Thorbjørn Ravn Andersen
+1  A: 

The simplest approach to developing Java web applications is via the Servlet specification. This lets you load your application into a Servlet container (such as Jetty or Tomcat), which handles the HTTP-side invocation issue. Your servlet is then a front-end for your front end agnostic processing application.

Since all applications require a user interface, take a look at the myraid of possible templating languages available. Velocity is always a safe pick. This will help you seperate the user interface from the adapter code.

Yann Ramin
A: 

While you investigate alternatives, Java Web Start may be the fastest way to get your existing application online. Here's a trivial example.

trashgod
A: 

Thanks guys for your answers. I had to login in with a new account so I can't reply directly.