tags:

views:

97

answers:

3

Hi! I've worked a lot with php/mysql on linux servers, including frameworks, orm etc. Now I want to give GWT and Java a try!

Installing GWT SDK, Eclipse plugin etc and running a "Hello world" is no problem. The server is running automagically in the background, taken care of by Eclipse. But when it comes to setting it up my self, there seems to be confusingly many options. Jetty? Tomcat? Glassfish? How are those related/combinable to/with Apache?

Are there any good resources or tutorials for setting up java development and server environments suited for one like me with PHP background? Maybe pointing out the possiblities of running PHP and Java on the same server?

Regards / Jonas

A: 

Becoming more familiar with Java is always a good step - especially if your experience is only/mainly with PHP - while learning the syntax might not be that hard, the framework take a bit longer

GWT can be used purely on the client side of things if you want (i.e. only in the client browser - with other web frameworks running on the server) so replacing your PHP knowledge on the web server side is not required

A nice place to start (with setting up your environment) would be with Eclispe and the GWT plugin for it. This allows you to run your app from within Eclipse without having to setup a full application server or having to initially worry about stuff like Tomcat

saret
Aha! But not using java means not using GWT-RPC, right? Pure Json for data transfer, I guess. There doesn't seem to be much of RESTful client stuff in GWT core...
Cambiata
Haven't worked in GWT for awhile - but as far as I remember you do loose GWT-RPC by doing this. Guess it depends on what you're doing - if you're just working on a new site it would make sense to utilize Java end to end, however if the site/web-services/backend already exists then replacing it with Java wouldn't make sense.
saret
Setting up the server environment is a bit more difficult as different servlet/jsp servers are different. How to set this up will often differ depending on what framework is chosen. Setting up a dev environment is relatively easier though - (code.google.com/webtoolkit/gettingstarted.html)
saret
Yep, getting dev environment up is easy. Preferrably I would like to run PHP and Java solutions side by side on the same server...
Cambiata
+1  A: 

Jetty, Tomcat and Glassfish are all Servlet containers (well, Glassfish is much more but in the context of a GWT application, it is). They deal with running your GWT application's backend (the server endpoint of RPC calls).

What you call "Apache" is probably Apache's HTTP Server. Tomcat is also produced by Apache. It is not uncommon to want both running on the same server, with the HTTP Server serving up mainly static or non-Servlet content and Tomcat handling servlet requests. This seems to be a good lead: Tomcat-Apache HOWTO

Mark Peters
Thank you, Mark! "Glassfish is much more" - does this mean that Glassfish is the best GWT alternative?
Cambiata
Not necessarily. You might find Glassfish to be much more enterprisey (read: overkill) than you want to deal with for your specific application. On the other end of the spectrum, Jetty is a HTTP Server/Servlet container that is written in pure Java with a focus on minimality and portability (it can be deployed in an embedded environment, for example).You'll need to decide what's best for you, but if you're familiar with a LAMP setup Tomcat is probably a great choice. It's in the middle of the spectrum, and focuses on doing one thing: being a Servlet container.
Mark Peters
Thank you Mark! Tomcat's my cat :-)
Cambiata
A: 

I'd like to add something to the above answers - you don't need a Java server to work with GWT. It's only required if you use GWT-RPC for communication with server. If you want to use, say, JSON via PHP scripts, no problem - you can just use Apache/httpd for that.
Either way, I'd recommend using an external server over the one included with GWT, since it's a custom version of Jetty and from my experience it tends to get moody when it comes to some more advanced stuff.

Just my 2 cents :)

Igor Klimer