Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
PHP Programming Java

Using J2EE and PHP together 41

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."
This discussion has been archived. No new comments can be posted.

Using J2EE and PHP together

Comments Filter:
  • PHP instead of JSP? (Score:3, Interesting)

    by UberChuckie ( 529086 ) on Friday May 13, 2005 @05:24PM (#12524428) Homepage

    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.

    • by Jagungal ( 36053 )
      If you know J2EE then you also should have no problems with Tapestry http://jakarta.apache.org/tapestry/ [apache.org] or JSF.

      PHP and JSP and the like are nothing but a parameterised buggy nightmare.

    • Well, almost. My client is purchasing a medical database application that runs on Tomcat and MySQL (save the flames, please), and I already have two projects planned that will add functionality that the vendor doesn't provide.
      1. A sign-in kiosk in the patient waiting room for new patients to input their personal information (name, address, insurance provider,reason for visit, etc.).
      2. An externally-accessible portal for the clinic's customers (they do a lot of occupational medicine) to view information regardi
    • Doesn't JSP provide the same functionality as PHP?

      No. PHP is an interpreted language with loosely typed variables, late binding and variable substitution in strings, all of which features are useful for quickly building web applications.

      JSP is just a flimsy front end onto Java Servlets, which are a much more powerful but rather harder to use environment for building larger and more complex web systems.

      The two complement each other rather well, IMO.
  • Hahah.. I hope this is a lower volume app. I'd be curious to know a bit more about the memory footprint of this combo.


  • Just go the whole java way - use something like tapestry:httpjakartaapacheorgtapestry [tapestry] Throw away the the parameter parsing and the buggy nightmare that is scripting languages imbedded in html.

    I have tried going back to the old PHP - JSP way of doing things and it is sooo painful.

    • Just go the whole java way - use something like tapestry:httpjakartaapacheorgtapestry Throw away the the parameter parsing and the buggy nightmare that is scripting languages imbedded in html.


      That's way too many frameworks. I just use one of them, it's called Freemarker [sf.net], check it out. Lots of features, decent speed, very easy to use and great documentation. Sure puts JSP to shame. I used it on my forum software with ldap authentication [sourceforge.net] (shameless plug) and it made my life easier.
      • That's way too many frameworks. I just use one of them

        Nope you don't - here is a quote from your link:

        FreeMarker is not a Web application framework. It is suitable for a component in a Web application framework,

        Maybe you should consider using a real framework like tapestry. http://jakarta.apache.org/tapestry/ [apache.org]
        • Nope you don't - here is a quote from your link:
          FreeMarker is not a Web application framework. It is suitable for a component in a Web application framework,


          That's actually one of its best features. Think about it. It can be used ANYWHERE. Even for configuration files. It just reads objects stored on a data model and lets you do stuff with them.

          But people use it especially as a replacement for JSP. Check the a href="http://freemarker.sourceforge.net/docs/pgui _ misc_servlet.html">docs.

          Why would i use
  • Why do people try to create solutions for problems that don't exist?

    Some people like PHP, some people like JSP, let's just leave it at that. For the people that like both, USING both would not only be confusing but extremely resource intensive.
    • Re:Wha...? (Score:4, Interesting)

      by FriedTurkey ( 761642 ) * on Friday May 13, 2005 @06:43PM (#12525196)
      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?
      • Re:Wha...? (Score:3, Informative)

        by dereference ( 875531 )
        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 th

        • They may be running on the same server but it is still middleware processing business logic. It doesn't have to be on another physical box to be middleware [wikipedia.org].
          • They may be running on the same server but it is still middleware processing business logic.

            Right...but that wasn't my point at all. I wasn't disputing that "middleware" is involved (although I must say I disagree with the broadness of the second definition of the term in Wikipedia). I was instead suggesting that it was misleading to imply that the example included Java middleware under a PHP presentation layer. They've got a Java presentation tier with a Java business tier and a database back end. Th

            • OK I got what your saying now compadre. The PHP doesn't talk to the Java middleware.
            • Yeah, that article was a total waste of time.

              The first half was completely superfluos stuff...

              "The 'web' is a shortened version of the acronym I.N.T.E.R.W.E.B which was invented by Marc Andresson at Darpa in 1989, in collaboration with Vint Cerf (who claims he just cribbed Al Gore's notes from "Love Canal", a nuclear particle physics thriller documentary)

              And the second half is simply:

              type ./configure && make && make install to install Apache with PHP. And don't forget to make sure you h
  • Sure.. (Score:3, Interesting)

    by Joff_NZ ( 309034 ) on Friday May 13, 2005 @10:00PM (#12526356) Homepage Journal
    We've been using this mix ourselves for a little while now... the main core of the application is deployed on JBoss, where all the heavy processing occurs, with scheduled jobs etc running via Quartz

    The web-based components that the users interact with are written in PHP5 - a decision that was not made based on any sort of execution speed differences that may or may not exist between PHP and JSP, but on the shorter development time we were going to have with PHP

    Whole thing works very well :-)

If you can't learn to do it well, learn to enjoy doing it badly.

Working...