I have a project which reqires me to develop a website and host data for my client. I wish to do it using Java.
As I always say, choose the right tool for the job. So why Java? The Java Web tier is relatively difficult to create applications for: you need to code all the behaviour, re-compile for every change (except JSPs/tag files) and re-deploy to the Web server. In general, this isn't something anyone can just pick up and do. Setting up the development environment alone can take a couple of days if you're not experienced.
If you're only doing a simple site with low-moderate traffic requirements, you're going to make your life a lot more complicated by using Java. Why not stick to something interpreted like PHP and speed up the development cycle? Using PHP5 you can effectively utilise OO programming too.
Secondly, Java containers consume a lot of resources. As a typical example, a
Tomcat instance allocates upwards of 256MB RAM before doing anything. Apache with PHP extensions is much smaller, in the order of 32MB RAM. You'll also have to find a host or administrator for Java apps, while there are plenty more Apache admins and hosts around.
On the flip side, if you need a high performance application or one backed by an extensive programming API, then Java is great. But expect to double your production time, much more if you're only just starting to learn it all.
Edit: You can use a Java Web framework to shave off the development time quite significantly. The tradeoff is that you have to learn that framework which itself can take days or weeks... so to start with it isn't all that fast.
[ November 04, 2008: Message edited by: Charles Lyons ]