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.
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
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?
isn't Java bad enough already?!
I would say isn't it good enough already?
plus, both interpretetive performance hogs...
Java isn't interpreted. In any case, what do you propose be used for web applications?
#!/
"Java isn't interpreted."
sorry, call it just-in-time compilation if you like, but no matter how you look at it, it's still a language (bytecodes) being translated to another language ( native ASM ) in execution-time ( execution of the JVM, that is ). That's interpretation for me, not compilation.
"In any case, what do you propose be used for web applications?"
How about Ocaml, Python, Scheme, Haskell or Ruby? Powerful, modular, flexible and concise languages for a powerful, modular and flexible environment like the web...
or perhaps just wait for Links...
I don't feel like it...
Take a look at Concerto. Yes, I work for this company.
dominionrd.blogspot.com - Restaurants on
sorry, call it just-in-time compilation if you like, but no matter how you look at it, it's still a language (bytecodes) being translated to another language ( native ASM ) in execution-time ( execution of the JVM, that is ). That's interpretation for me, not compilation.
Strange, sure sounds like compilation to me. Just compilation that's delayed until it's needed. Interpretation implies that it is done on every execution, not just the first.
Ocaml, Python, Scheme, Haskell or Ruby?
All of which are either interpreted or just-in-time compiled, if I'm not mistaken.
Not that I disagree with your choices, some of these are great languages, but don't complain about an aspect of another language that your own preferences have in common with it.
Don't turn ProxyRequests On; use RewriteRules to specify what proxying to perform. This should be secure.
compilation that's delayed until it's needed. Interpretation implies that it is done on every execution, not just the first.
Interpretation that way is no more ever since old basic days. These days, almost all "interpreted" languages either compile the concrete syntax to some form of bytecode and then execute it, or simply compile it once to bytecode and load that fast, instead. Ruby and Python work that way.
Anyway, yes java compiles to native "just-in-time" just once -- at start-up time. At that time, it's being interpreted. It's also interpreting anytime some new module is loaded, at execution time, when it too will be translated from bytecode to native ASM. Also, it's a performance hog for the loads of stupid libraries that suffer the same process and are needed by even rather simple programs.
All of which are either interpreted or just-in-time compiled, if I'm not mistaken.
Haskell and Ocaml compilers generate fast native ASM, ahead-of-time.
I don't feel like it...
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.