Thread: why use JSP

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    2
    Rep Power
    0
    Why use jsp as opposed to perl,php,or python?
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    North Canton, Ohio, USA
    Posts
    3
    Rep Power
    0
    JPS is built off of JavaScript (If I'm remembering correctly) and it is much faster to pick up for someone who already knows JavaScript instead of learning an entirely new language. Just IMHO
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    35
    Rep Power
    14
    JSP is not build off JavaScript, but is a Java-based technology. You'll want to use it in a Java-based environment (i.e. WebSphere); the nice thing is that you can just mix HTML and Java instead of writing out all HTML code as you would have to do in a servlet (a la PHP or ASP).
    For the rest, it just depends on your server environment and personal preference. I don't know about the performance issues involved.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    0
    Rep Power
    0
    Heya....

    [1] JSP (Java Server Pages) have nothing to do with javascript... Visca, i think your getting mixed up with ASP (Active Server Pages), which can be scripted using javascript or vbscript.

    [2] Anyway, back to your question keliikuli.. JSP has certain advantages over perl, php, and several other scripting languages because it is impliments an idea known as 'page compilation':

    When you write a page that has jsp in it to do something dynamic (connect to a database, or do some other bit of work for ya), you save it as a regular text file (with the .jsp or .jhtml extention or whatever your server is set up to use for JSP pages).

    Now, the first time that page is loaded off the server... it is compiled into a java servlet & loaded into memory. Each time a subsiquent request is made to the page, the server just uses the allready-compiled page that it has in memory to do its stuff. BUT something like PHP is never compiled & loaded into memory, each time someone accesses that page, the entire document is Interpreted. Since compiled languages are faster than interpreted ones, the first advantage that JSP has over the others is general speed.

    There are other advantages aswell, JSP alows you to keep much more of your code seperate from the html than other html embedded languages, by using java beans. Jjava beans basically let you keep all the logic of your page (like the code to connect to a database, manipulate data etc..) in a seperate file known as a java bean. then from within your html page - all you do is use one tag to 'use' the bean, and then a few other short tags to send data to&from the bean....


    JSP & JjavaServlets are generally indopendant of the operating system & web server.... you can develop your jsp pages, or java servlets on a windows machine, move them onto a freebsd machine, and then if the site moves - plonk them onto something nice like a solaris box, without having to do many modifications to the code - whereas with perl or other stuff, it can get a bit messy.....

    Theres tons of other reasons to use JSP/Servlets.... check out jspin.com for some more resources - and servlets.com has some good stuff on servlets/jsp

    KQ
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    35
    Rep Power
    14
    JSP is not build off JavaScript, but is a Java-based technology. You'll want to use it in a Java-based environment (i.e. WebSphere); the nice thing is that you can just mix HTML and Java instead of writing out all HTML code as you would have to do in a servlet (a la PHP or ASP).
    For the rest, it just depends on your server environment and personal preference. I don't know about the performance issues involved.

IMN logo majestic logo threadwatch logo seochat tools logo