Jsp Versus Php - about differences between JSP and PHP

free web hosting
Free Web Hosting, No Ads > CONTRIBUTE > Technology

Jsp Versus Php - about differences between JSP and PHP

masrawy
Both of JSP and PHP are technologies used to build dynamic web sites, JSP embeds java syntax with html to create dynamic pages, while PHP is an open-source page scripting/templating system, but in the long run, JSP and Java provide a more powerful system.

Here is a list of reasons why JSP is better than PHP:

QUOTE
- Anything you can do with PHP, you can do with JSP; the reverse is not true

- JSP is much more powerful, since it has access to all the Java libraries. PHP only has access to PHP libraries

- JSP is Object-Oriented, so leads to cleaner code that's easier to debug, maintain, and improve. (PHP also allows objects, but the - object model is more primitive, and most scripted pages ignore PHP objects and just use normal variables.)

- The equivalent syntax in JSP is just as simple to learn, so you can get up and running just as quickly -- that is, there's no extra startup cost in using Java, at least not a significant one

- Java programmers (as opposed to 15-year-old hackers or HTML monkeys) appreciate the importance of a clean language with complex OO data structures and strong typing

- With JSP, if the code inside a page gets too big, or if you want to use it elsewhere, you can cut it out, make it into a Java class, and invoke it from anywhere in your application (even not from a page). With PHP, you're stuck inside the HTML box.

- JSP's concept of state management and persistence is more explicit and powerful than PHP's. With JSP, you can specify whether a variable persists for the page, the request, the session, or the application (or if it's just local to the function). The JSP engine automatically does the right thing with cookies so you have access to the variable on later requests. With PHP, you just have "global" and "not global", you don't have automatic session management, and have to do your state thing manually with cookies or hidden variables.


any comments will be apppreciated.

Notice from rvalkass:

Anything you copy should be put in Quote tags.
Readme ~ Rules ~ AUP

 

 

 


Reply

evilguru
QUOTE(masrawy @ Mar 7 2008, 11:37 AM) *
- Anything you can do with PHP, you can do with JSP; the reverse is not true

Care to elaborate? Anything I can do in JSP I can also do in C, which I can also do in assembler. I can also do things in C which I can not do in Java (direct memory access, for example). Therefore using that logic all websites should be written in C.

QUOTE(masrawy @ Mar 7 2008, 11:37 AM) *
- JSP is much more powerful, since it has access to all the Java libraries. PHP only has access to PHP libraries

C has access to all of the PHP and Java libraries (using the appropriate bridges). C wins again.

QUOTE(masrawy @ Mar 7 2008, 11:37 AM) *
- JSP is Object-Oriented, so leads to cleaner code that's easier to debug, maintain, and improve. (PHP also allows objects, but the - object model is more primitive, and most scripted pages ignore PHP objects and just use normal variables.)

PHP5 supports almost exactly the same object model as Java. Abstract classes, interfaces, public, protected and private member variables/functions, pass by reference, static functions/variables.

Your second point (about developers ignoring such features) notwithstanding; the features of a language exploited by its respective community is irrelevant when comparing languages. The fact of the matter is they exit.

By inflection you are also categorically static that object orientated code is always better. I dispute that. If Java was multi paradigm (like PHP or C++) I wonder how many people would forgo the object orientated features in some situations.

QUOTE(masrawy @ Mar 7 2008, 11:37 AM) *
- The equivalent syntax in JSP is just as simple to learn, so you can get up and running just as quickly -- that is, there's no extra startup cost in using Java, at least not a significant one

The number of hosts supporting JSP is smaller than that of PHP. The PHP community is significantly larger (for the hobbiest sector anyway). I know both Java (I normally use Swing/SWT, so desktop apps) and can tell you it is a lot harder than PHP.

Try explaining to a beginner how to connect to a MySQL/PostgresSQL database in Java using JDBC and then compare it to the required PDO code.

QUOTE(masrawy @ Mar 7 2008, 11:37 AM) *
- Java programmers (as opposed to 15-year-old hackers or HTML monkeys) appreciate the importance of a clean language with complex OO data structures and strong typing

Again, this is not a language thing, but more a social one. Notwithstanding.

QUOTE(masrawy @ Mar 7 2008, 11:37 AM) *
- With JSP, if the code inside a page gets too big, or if you want to use it elsewhere, you can cut it out, make it into a Java class, and invoke it from anywhere in your application (even not from a page). With PHP, you're stuck inside the HTML box.

100% not true. On the lowest level PHP supports including of other PHP files. Boom, a simple template system. Further up the food chain there is Smarty (a true templating language) and even further up there is ezcComponents and the Zend Framework, which provide the MVC design pattern to PHP.

QUOTE(masrawy @ Mar 7 2008, 11:37 AM) *
- JSP's concept of state management and persistence is more explicit and powerful than PHP's. With JSP, you can specify whether a variable persists for the page, the request, the session, or the application (or if it's just local to the function). The JSP engine automatically does the right thing with cookies so you have access to the variable on later requests. With PHP, you just have "global" and "not global", you don't have automatic session management, and have to do your state thing manually with cookies or hidden variables.

PHP has sessions http://uk2.php.net/session . They are 100% transparent to both the programmer and user.

Regards, Freddie.

 

 

 


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : jsp, versus, php, differences, jsp, php

  1. What Will Be The Side Effects If We Can Move And Think On The Speed Of Light
    What differences can we see if we can think, move or do what ever with (3)
  2. Advertised Isp Speed Versus Actual Speed
    Why is the difference? (5)
    You may want to visit this topic. That topic gave me the this question.
    http://www.trap17.com/forums/page-3-t58513-s20.html My ISP advertise 1024/256 Kbit speed and
    network details do say 1024. But my actual download speed is 100 kb per second and my upload limit
    is 25 kps. So what's a Kbit? QUOTE(ivantoar @ Jun 11 2008, 08:49 AM) 394433 I
    run at 768 kbps and I can download at 90kbps (stable). ....
  3. Age Differences Of Friends
    (8)
    Just a discuss of what age differences you think should be between you and friends, should there be
    example: you are 17 and you have certain friends, what age differences should there be. 1 year
    older difference 2 year older difference 3 year older difference 4 year older difference 5 year
    older difference OR 1 year younger difference 2 year younger difference 3 year younger difference
    4 year younger difference 5 year younger difference....
  4. Final Fantasy Xiii/versus Xiii
    Two highly anticipated releases for the world-renowned franchise (1)
    GameTrailers.com has posted the extended trailer for the upcoming addition to Square Enix’s
    internationally acclaimed Final Fantasy franchise coming soon for the Playstation 3, Final Fantasy
    XIII. In this adventure which is set in the planet of Pulse, the main protagonist here is
    Lightning, a beautiful and resourceful ex-soldier who fights the ruling repressive authorities of
    the floating city of Cocoon. She appears as a strong, independent young woman with strawberry blonde
    hair. She uses the codename "Lightning" to hide her true identity. She was chosen by one of the ....
  5. Naruto Versus Sasuke
    Who do you think should win,Naruto or Sasuke? (3)
    The anime Naruto,the battle of Naruto ad Sasuke.Who wins!You choose!Count what vote you are
    for that person. /wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />....
  6. A Demonstration Of Floats, Clears And Absolute Positions
    See the differences here... (1)
    Got working on something the other day and came up with this small demonstration on the differences
    between several techniques using the same html code, but different CSS to position a block of four
    thumbnail images approximately the same ( well, similar at least ) onto a page and the resultant
    differences in the effect of the techniques. Have a look:
    http://www.jlhaslip.trap17.com/samples/mis...ions/index.html The first one uses floats to group
    the images into a fixed width block and then uses absolute positioning of the wrapper div to space
    them off the left hand si....
  7. Differences Between Trap17 & Qupis
    (3)
    I juz got my trap17 starter account when I found out about the alternative called qupis which seems
    to provide the same features but only restricted with ONE LINE TEXT AD at bottom of page. I hope
    someone can clarify this and if this is the case, then it will be just active participation in the
    forum VS 1 line of text ad. So what are the real differences and advantages for users of trap17 over
    those using the ad supported Qupis?....
  8. 3d Landscape In Swishmax (flash)
    some syntax differences but basically same as flash (1)
    OK! this tutorial is inspired by a game at addictinggames.com... im not sure how many of you
    have played it but here it is: God's Playing Field Its a cute little game... but when i first
    played it i though HOW DOES IT DO THAT!!! and by that i mean dot he 3d with the mouse
    and then today i finally got around to making it... I used one of the oldest tricks in the book...
    so lets educate you a lil about flash... Flash does not support 3D directly, you have to find some
    way to make your own. You could develop some complicated system for which you co....
  9. Ie And Firefox Layout Differences
    (10)
    I have had a go at making a website using CSS to dictate the layout (no tables used) and it works
    quite nicely in firefox but when i open it in IE it completely mangles the whole layout. Can
    someone tell me some techniques to prevent this and maybe point me to some helpful pages. Thanks.....
  10. Compare Two Vars And Highlight The Differences
    (7)
    I need a script that compares 2 variables, and looks for a difference between them. It will then
    highlight the words that are different, as shown in the image below: So in the left cell, the
    yellow text is the text that has been removed OR replaced. In the right cell, the green text is the
    text that has replaced some text in the left cell, OR new text. This script will be used to
    compare 2 versions of a document stored in the database, to see the difference between each change
    (all revisions are stored in the database). I know that it's possible with PHP, beca....
  11. Versus In Fantastico
    your opinion; what to choose; why? (3)
    Hello! I am now proudly hosted member(not this site). Well, i entered my Cpanel and i found a
    lots of options in fantastico so i need your opinion. What to choose? Why? CMS___________ QUOTE
    - DRUPAL - GEEKLOG - JOOMLA - MAMBO OPEN SOURCE - PHP NUKE - PHP WCMS - PHP WEBSITE - POST-NUKE -
    SITEFRAME - TYPO3 - XOOPS ....
  12. Whether To Use Adobe Live Cs2 Versus Dreamweaver Mx?
    (2)
    I have Dreamwesver MX And I am thinking about buying Adobe creative suite 2. I was thinking that
    the CS2 platform was good for adding windows media player and real player videos. thanks....
  13. Differences Of Squares
    (10)
    Hi guys , I just found out that the differences of squares form an arithmetic series with d = 2 ,
    but I can't figure out why : 3 5 7 9
    11 - notice the difference 1 4 9
    16 25 36 - the squares 1^1, 2^2, 3^3 ,
    4^4 , 5^5, 6^6....
  14. Windows 2000 Versus Windows Xp
    (19)
    ok so i'm in my last resort now since my pc is attacked by so many malware that my antimalware
    can't even remove. i'm tired of doing scans, it consumes too much of my time just to remove
    such problems. i'm currently using windows xp and we just found out that our copy is not
    genuine. this version has been installed like a couple of months ago, and i've already
    experienced so many virus attacks. i'm a busy person now and i can't afford to lose precious
    time just by doing scans and experience hangs while doing such scans. and i definitely can....
  15. Oracle And Cisco, What Are These,
    and the main parts and differences of both (4)
    Hey, pretty much a newb when it comes to comp programs/systems, and i saw things about Oracle and
    Cisco, and wanted to know what they are. LoL Shortened the Title and description so it doesn't
    wreck the Index page. ....
  16. Server Differences?
    Between Gamma & Delta (3)
    I uploaded a script as a free member and saw it worked so I decided to buy hosting. Then I uploaded
    the script as a paid member and it didn't work. The main thing I noticed is that the free member
    server's name is gamma and the paid one is delta. I am mostly worried because if I can't
    get my script to work, I can't keep staying hosted here. Is there any way that I can be a paid
    member and have my script still hosted on the gamma server? Delta's driving me nuts.
    /wacko.gif" style="vertical-align:middle" emoid=":wacko:" border="0" alt="wacko.gif" /> ....
  17. Amateur Versus Professional Art
    (19)
    I am an amateur artist. A few weeks back I, and another member of an art class I attend, set up a
    website to enable artists to display their work and hopefully received help and advice - or just
    general comments. The site caters for amateur and professional adults and there's also a gallery
    for kids. We've had loads of imput fron the kids and amateur adults but what a pain the
    professionals have proved to be. The only ones who have contributed so far are those we know
    personally, others ( without exception ) haven't even bothered to reply emails. So what'....
  18. Script Won't Work At Trap17 -- Version Differences?
    But works flawlessly in my machine... (12)
    Here is the code: CODE <?php $data_array = array(); $data_array2 =
    array(); $file_name = "menu_data.txt"; $handle =
    @fopen($file_name, "r"); if (!$handle)  {     echo "File
    Handle Not Available For Use"; exit;         } while (($data = fgetcsv(
    $handle, 1000, ",")) !== FALSE) {         if ( (strpos
    ($data[2],"$page=")))     {
                        $data_array[] =  t....
  19. Php Version Differences? Or Not?
    between the trap and XAMPP??? (5)
    The Trap uses php version 4.4.1 and I have downloaded and installed the XAMPP php Local Server
    configuration which includes php version 5.1.1 and mysql and perl etc, but this question relates to
    the php because that is where I am currently having difficulties. This is the script I am having
    problems with locally: http://www.trap17.com/forums/script-build-...nks-t33362.html Both places
    have the same identical files, code and data. Both are folders in the root directory. I have used
    phpinfo function to confirm the server root is what it should be (public_html and htdo....
  20. Pentium M Differences: 1.73ghz? 1.86? 2.1?
    (2)
    Hi. Trying to decide how fast a chip (Pentium M) to buy for my next notebook. The HP I'm
    looking at goes up to 2.13 GHz. I can afford to go with a 2.0 GHz, but can save $100 if I go
    with a 1.86. I can save more if I go with a 1.73. Any advice on Pentium M CPU speed? Any reason I
    should not buy the fastest one I can afford...without buying _the_ fastest (with the biggest price
    premium)? My experience tells me it's not worth the money to buy the _fastest_ CPU, but to go
    with a step down from the fastest. I'd appreciate any thoughts on this. Than....
  21. Favourite Versus Game Series
    Street Fighter Vs X-Men (Related) (3)
    My 3 favourites has to be Marvel Super Heros Vs. Street Fighter, Marvel Vs. Capcom and Marvel Vs.
    Capcom 2. And also who's your favourite character to play as in those games (Regular or Hidden)
    my favourites are :Cyber Akuma, Onslaught and Apocolypse. I haven't figured out how to play as
    Abyss yet. But I hope someone does know how to play as him.....
  22. Inspiron/latitude/precision Quality Differences?
    (6)
    Hi, are there differences in quality concerning the Latitude/Inspiron/Precision models? For
    example are the more expensive latitudes more sturdy, have higher quality components or are they all
    the same in all 3 different product lines? andrescasta....
  23. Frozen Versus Kubi
    Wallpaper Battle (15)
    Kubi's Entry. My Entry. Good luck have fun, first to 5 votes wins.....
  24. Remote Program Versus Kvm Switch Over The Net
    KVM on the NET Vs Remote Access Program (3)
    As go along and work in IT company I just realized the difference between the Remote Access program
    and the KVM over the NET. 1. First the KVM over the net used special device with firmware embedded
    on it. This work by assigning IP in to the piece of Hardware and with off course internet connection
    but found to be as expensive. 2. Remote program works also over the internet but need to installed
    both remote and the client programs. If the remote don't have a client program it will not be
    able to accessed. 3. KVM over the net works without installing any progra....
  25. Teamspeak 2 Vs Ventrilo
    The Differences Between The Leading Voice Chat Programs (10)
    The Main Reason for this post is to decide the popularity of the voice programs. Since i currently
    host both a Teamspeak server and Ventrilo server and am currently in the process of creating a
    website for my supporters. I would like your opinions as to which is the better program and why
    you think it is, since i will be basing these results on which Server i keep and provide statistics
    for on the website. For those that have not heard of these programs i will include a short
    description of each program and the websites they can be found at. TeamSpeak # Optimal ba....
  26. Browsers And Css
    Differences in displaying CSS (5)
    (This looks like the best place to post this.. /unsure.gif' border='0'
    style='vertical-align:middle' alt='unsure.gif' /> ) What do other users do to
    'work-around' the differences in displaying CSS attributes in different browsers? Mainly
    Internet Explorer which doesn't fully conform to CSS unlike the Mozilla browsers and where older
    browsers like Netscape 4.x which have only minimal CSS implementation. On my website, now that I
    have converted it to PHP, I use a couple PHP 'if' statements to detect the user's
    browser and link them to different....
  27. America Vs. The Rest Of The World
    Versus (43)
    If you live in America, would you rather vacation here, or in another part of the world? If you
    live in another part of the world, would you rather vacation there or in America? And which place
    is the best place to live: the USA or your country?....

    1. Looking for jsp, versus, php, differences, jsp, php

Searching Video's for jsp, versus, php, differences, jsp, php
Similar
What Will Be
The Side
Effects If
We Can Move
And Think On
The Speed Of
Light - What
differences
can we see
if we can
think, move
or do what
ever with
Advertised
Isp Speed
Versus
Actual Speed
- Why is the
difference?
Age
Differences
Of Friends
Final
Fantasy
Xiii/versus
Xiii - Two
highly
anticipated
releases for
the
world-renown
ed franchise
Naruto
Versus
Sasuke - Who
do you think
should
win,Naruto
or Sasuke?
A
Demonstratio
n Of Floats,
Clears And
Absolute
Positions -
See the
differences
here...
Differences
Between
Trap17 &
Qupis
3d Landscape
In Swishmax
(flash) -
some syntax
differences
but
basically
same as
flash
Ie And
Firefox
Layout
Differences
Compare Two
Vars And
Highlight
The
Differences
Versus In
Fantastico -
your
opinion;
what to
choose; why?
Whether To
Use Adobe
Live Cs2
Versus
Dreamweaver
Mx?
Differences
Of Squares
Windows 2000
Versus
Windows Xp
Oracle And
Cisco, What
Are These, -
and the main
parts and
differences
of both
Server
Differences?
- Between
Gamma &
Delta
Amateur
Versus
Professional
Art
Script
Won't
Work At
Trap17 --
Version
Differences?
- But works
flawlessly
in my
machine...
Php Version
Differences?
Or Not? -
between the
trap and
XAMPP???
Pentium M
Differences:
1.73ghz?
1.86? 2.1?
Favourite
Versus Game
Series -
Street
Fighter Vs
X-Men
(Related)
Inspiron/lat
itude/precis
ion Quality
Differences?
Frozen
Versus Kubi
- Wallpaper
Battle
Remote
Program
Versus Kvm
Switch Over
The Net -
KVM on the
NET Vs
Remote
Access
Program
Teamspeak 2
Vs Ventrilo
- The
Differences
Between The
Leading
Voice Chat
Programs
Browsers And
Css -
Differences
in
displaying
CSS
America Vs.
The Rest Of
The World -
Versus
advertisement



Jsp Versus Php - about differences between JSP and PHP



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE