I’ve been working on web apps for a while now, using php and then Java. Of course I prefere coding in Java, it gives more flexibility, performance and lots of professional components and libraries. But I don’t like JSPs very much, PHP was more easy if only limited to front-end and simple Controller functionalities, moreover, PHP is well accepted by designers. So I’m thinking of using Php for View + Some simple controller tasks and Java for the rest of controller code + model. To implement this I would use apache for php and tomcat for J2EE stuff.
What do you think, is this an unnecessary waste of resources? Or does it make sense? How would you bridge the two?
I can appreciate why you would want to try this. JSP is one my least favorite technologies for building a web page, and I’ve been using it for a decade now. The easiest way to implement what you are looking for is to code up all your Java controllers as web services and invoke them from your PHP code. I would recommend using JSON as the data interchange as the parsing will be faster. Alternatively, you could take a look at some technologies that combine Java and PHP in interesting ways:
PHP/Java Bridge – http://php-java-bridge.sourceforge.net/pjb/how_it_works.php
Quercus – http://www.caucho.com/resin-3.0/quercus/
Zend also includes Java support in their server offering. You can read more on their product page.