September 16th, 2002, 02:23 AM
what can JSP do that PHP can't?
i'm not being an ***, i'm really asking
i run a simple website for a game server and it uses PHP. what could be done if i had JSP over PHP?
can i run PHP and JSP at the same time (like on the same page)?
PHP is fun
September 16th, 2002, 03:37 AM
Off the top of my head...
- jsp has an application object that can be useful for stuff.
- You can package servlet/jsp applications into .war files to make them easy to install on a different server.
- Java is a more powerful language than php (it's meant to do more stuff), and you have access to that in your jsps, so I'm sure this gives you extra features. Not that they're usually necessary/useful.
- You can forward a request in a jsp (haven't seen the same capability in php, but it could be there). This is useful when implementing a model/view/controller design.
- Vanilla jsp with javabeans is probably easier for a graphic designer to work with than vanilla php. Throw templating engines in there and all bets are off, though.
As for using them together on the same page, I think your best bet is going to be using php's java integration to access java classes. A jsp just gets compiled into a java servlet class, so functionally they're no different.
September 19th, 2002, 04:46 PM
The thing is with PHP, that when you want to create your own classes it just gets dirty.
In Java (JSP) it's so much easier by the use of beans.
September 22nd, 2002, 11:19 PM
JSP is a Web component of the J2EE architecture that has full access to all other Java-based resources such as E-mail, databases, and middleware components.
PHP has a lot to offer, just like JSP pages. You can access databases and E-mail, but access to middleware objects is absent.
JSP pages are good for larger projects because it is an object-oriented, strongly-typed language with rigorous compile-time checks. PHP is better for smaller projects because its object-oriented features are inferior and it has no type-checking, which makes it easier for developers to make mistakes.
I don't see PHP and JSP ever co-existing in a single file.
Since your site is simple, use PHP. There is no reason to switch if what you are doing now works well.