Slashdot Mirror


Using J2EE and PHP together

An anonymous reader writes "There's an article in the May issue of the WebSphere Developer Technical Journal at IBM's developerWorks site on Pairing PHP with Java to meet the needs of a familiar web application scenario. The example consists of a Struts application deployed on WebSphere Application Server, which serves as the private content management tool, and a PHP 5 site to display that data to the public. Both parts of the application share a single Apache and DB2 instance."

3 of 41 comments (clear)

  1. PHP instead of JSP? by UberChuckie · · Score: 3, Interesting

    The answer to the "Why would you want to do this?" section was pretty much "because you can" and that PHP is supposed to be easier to learn vs JSP. Doesn't JSP provide the same functionality as PHP? Given the fact that you would have to know Java to do the J2EE part, I don't see how the JSP part can be a problem.

    It looked like a lot of work to get it running as well versus just dropping an EAR (or WAR) file and ask the app server to deploy it.

  2. Re:Wha...? by FriedTurkey · · Score: 3, Interesting

    If you RTFA it isn't talking about JSP. It is about using Java in the middleware (WebSphere) and PHP in the presentation layer (Apache).

    There is actually a lot of use for this as a web developer is often someone on a seperate team as the application business layer team.

    Why should a PHP web site be rewritten in Java/JSP to use a existing Java middleware module?

  3. Re:Wha...? by dereference · · Score: 3, Informative
    If you RTFA it isn't talking about JSP. It is about using Java in the middleware (WebSphere) and PHP in the presentation layer (Apache).

    With all due respect, this is quite incorrect. If you re-RTFA carefully, you'll see:

    The example consists of a Struts application deployed on WebSphere Application Server V5.1, which serves as the private content management tool for entering information by the Catabase team. A PHP 5 public site will display the content and enable users to search for animals based on their attributes. The database shared by both components is DB2 UDB Enterprise Server Edition Version 8.2. The Web server instance for both portions is Apache 1.3.

    So yes, basically they have a Struts part (hosted by WebSphere acting only as a J2EE Web Container) for the "internal" web site, and a PHP part for the "external" web site. The only things shared are the HTTP server (which invokes the PHP or Struts modules) and the database (which is read by PHP and read/written by Struts).

    There is no "middleware" to speak of here.