0

I'm going to start a new project with instant message support.

I find that there is no good long polling solution in PHP, but there is some good ones in Java EE.

I'm wondering if I can integrate PHP and Java EE to get the function? Or should I just use Java EE instead of PHP?

2 Answers 2

2

Keeping the number of development platforms to a minimum is always a good idea. It will keep deployment requirements low, gives less operational complexity and gives the best possible integration.

If you want to replace PHP by Java, you have lots of frameworks you can use to replace PHP. A good option would be the Stripes framework it’s an easy to use MVC framework that does not need much configuration.

An other very workable solution would be using Java in the backend for filling the database. And use PHP in the frond-end and use the database to retrieve data. This way the integration is limited to a shared database.

If you would like to have a direct integration between PHP and Java, things start to get more complex. It could be implemented by either web services or the faster php-java-bridge. But I don’t think you need this and if you do, I would seriously consider migrating the whole project to Java.

For an implementation example of the php-java-bridge see: How to share session between Java and PHP

Sign up to request clarification or add additional context in comments.

Comments

0

You CAN build your application with PHP together with Java EE. The PHP is to generate HTML, and Java EE supports Comet.

Actually, Facebook generates HTML with Apache server. I bet Facebook web pages are written in PHP. And the Comet server of chatting is written in ErLang hosted in Mochiweb. Two languages & servers works fine together.

The decision is up to your own preference.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.