1) Most web hosts offer some provisions for JSP / Servlets (e.g. Tomcat). Even the least expensive website hosting services. Therefore, looking for another provider is not necessarily a bad idea.
2) Java code cannot talk directly to PHP code, and PHP code cannot talk directly to Java code.
3) HOWEVER: the same web server can be configured to run both PHP / Apache and Tomcat. For instance:
4) The same server can easily support both PHP / Apache and Tomcat as separate services. In other words, the same host (e.g. www.myserver.com) can easily run Apache / PHP (e.g. http://www.myserver.com:80 ) and Tomcat (e.g. http: //www.myserver .com: 8080 ) at the same time. This is a very common configuration.
5) Do not look at the "translators". Even if you find a tool that claims to be able to do this, converting from PHP to Java or Java to PHP will probably be more problems for me than it costs.
6) If there is not a lot of code, I would not consider web services (or Ajax) either.
7) Just find a provider that supports Apache / PHP, Tomcat and your database of choice; create a “home page” depending on what you like best and change your PHP and your JSP pages to rely on CSS to provide the same look.
This approach is the simplest ... and it may just be all you need!
Good luck.
source share