
September 29th, 2000, 06:10 AM
|
|
Junior Member
|
|
Join Date: Sep 2000
Posts: 0
Time spent in forums: < 1 sec
Reputation 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
|