#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Posts
    56
    Rep Power
    12

    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
  2. #2
  3. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    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.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Location
    The Netherlands
    Posts
    6
    Rep Power
    0
    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.
  6. #4
  7. No Profile Picture
    Database Expert
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Posts
    20
    Rep Power
    0
    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.

IMN logo majestic logo threadwatch logo seochat tools logo