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."
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.
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 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.
Well, even though it's obvious you don't know what the hell you're talking about, since you think J2EE == applets, go ahead and check this out.
Brain required, just FYI.
http://jakarta.apache.org/tapestry/
Slow? I hardly ever find Java slow. Is the VM slow to start up? Yes... but that really doesn't matter in most contexts where you would use it (i.e., a Web application that starts up once, then runs).
In general, Java is very fast.
That having been said, Perl is quite portable, and runs decently fast under something like mod_perl, where (once again) you incur the overhead of startup once, then the code runs many times.
I wish people would stop bringing up the speed of Java, then point to applets. Very few people use applets at all these days, Flash is becoming more attractive for many of those sorts of things and is darn faster. Even Java desktop applications seem plenty zippy to me most of the time (although in some, like JBuilder, I can totally tell when garbage collection is taking place, I get freezes of the interface at times like that... something is a little wonky in how that app is written).
It's a strange world -- let's keep it that way
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.
As a long time user of JBuilder, the old versions were terribly slow. No problems with version 9. I guess it also helps that I am on a faster computer than when I used earlier versions.
I still think the JBuilder Personal Edition is the best "free" Java development platform out there. It doesn't do servlet programming OTB but I found I could just add the servlet classes and then move the classes.
BTW: The parent is a troll.
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
The revolution will not be televised. It won't be on a friggin blog either
isn't Java bad enough already?!
just imagine all the verborragic redundancy of Java/Struts + loads of xml with PHP's "1 millions inconsistently named functions in the same namespace" + global variables abound...
plus, both interpretetive performance hogs...
I don't feel like it...
C#/.NET
My client was already sold on the system (they reviewed three competing products), and my promises of ease-of-extensiblilty utilizing PHP was icing on the cake :-)
Need a Linux consultant in New Orleans?
If I use Apache at port 80 and say Tomcat at port 8080 then I can use the Apache proxy to handle both Java and PHP requests. Unfortunately the Apache proxy can be abused by spammers (relaying). Is there any solution for this problem?
This is just stupid. I will use PHP on servers without Java, but that is it. I like both languages, but PHP is rather limited for large projects. PHP has no Interfaces and it is not really object oriented.
I still think the JBuilder Personal Edition is the best "free" Java development platform out there.
Have you tried Eclipse 3.0? I've worked with recent versions of JBuilder (as well as older ones), and I can say that Eclipse is MUCH better than JBuilder. JBuilder is completely horrible in comparison (at least with whatever version was out last summer, it was terrible, didn't even have proper refactoring features). Borland has even announced that they are porting to an Eclipse-based product.
JDeveloper, Oracle's IDE which was original based on an older version of JBuilder, is equally bad and I recommend staying away from that as well, especially the pretty lousy ADF framework that they push along with it.
I've heard good things about Netbeans 4.1, but haven't tried it out yet.
My problem is the amount of memory it takes to run tomcat on a webserver. I have a freebsd box with 512mb ram and half of it is just java & tomcat!
Even better. Perl with CGI::Fast. 4 times faster than some PHP scripts i've replaced.
Take a look at Concerto. Yes, I work for this company.
dominionrd.blogspot.com - Restaurants on
You'd be wise to stay with 9. I "upgraded" to X then 2005 and my system has never been the same since. It's slow, buggy, web projects are restructured, libraries go awol. Total mess. Maybe I just didn't rtfm, but it's been a nightmare.
An interesting discussion exists at Java vs PHP
Some strong arguments in favor and against using Java, PHP and both of them together.