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."
PHP instead of JSP? (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.
Re:PHP instead of JSP? (Score:2, Informative)
PHP and JSP and the like are nothing but a parameterised buggy nightmare.
I'm doing this already (Score:3, Interesting)
Re:I'm doing this already (Score:2)
Take a look at Concerto [orionhealth.com]. Yes, I work for this company.
Re:PHP instead of JSP? (Score:2)
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.
PHP + Java + One Apache = Memory (Score:2)
Re:PHP + Java + One Apache = Memory (Score:2)
Re:Java Alternative (Score:3)
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 fe
Re:Java Alternative (Score:2)
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.
Re:Java Alternative (Score:1)
Why bother with PHP ? (Score:1)
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.
Correct Link ... (Score:1)
Re:Why bother with PHP ? (Score:3, Interesting)
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.
Re:Why bother with PHP ? (Score:1)
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]
Re:Why bother with PHP ? (Score:2)
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
Re: (Score:2)
Re:Wha...? (Score:4, Interesting)
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)
With all due respect, this is quite incorrect. If you re-RTFA carefully, you'll see:
Re:Wha...? (Score:2)
Re:Wha...? (Score:1)
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
Re:Wha...? (Score:1)
Re:Wha...? (Score:1)
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
Sure.. (Score:3, Interesting)
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
Re:god, no! (Score:1)
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?
Re:god, no! (Score:2, Insightful)
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 environme
Re:god, no! (Score:2)
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 ei
Re:god, no! (Score:1)
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
Re:Any secure way for Apache + Tomcat ? (Score:2)