I'm by no means a hugely experienced developer but after spending a short time working for an organisation that use Java EE extensively I now have learnt how to use and deploy pretty much the whole EE spectrum - Servlets, JSPs, Web Services, EJBs, JMS etc. That provides a huge arsenal for scalable web application development.
I think the reasons Java tends not to be used in the web app world and PHP / RoR not in the corporate world is down to the backgrounds of the developers. Web developers who come from a freelance web site building background are more familiar with PHP - its a very consumable technology for people that haven't got a lot of time to invest in learning technologies. Career software developers often are trained in Java development on the job once they graduate (from a degree which will likely have had a large Java component).
I personally don't know much about PHP, but I see the most likely platform to be future proof as Ruby on Rails. But for now I'm sticking with Java, it still has a fairly substantial future.