* Profile *
* 个人资料 *

Name: Teddy
Age: 28
Sex: Male

QQ: 75342688

* Archives *
* 存档文件 *

09/12/2004 - 09/19/2004
09/19/2004 - 09/26/2004
10/03/2004 - 10/10/2004
10/10/2004 - 10/17/2004
10/17/2004 - 10/24/2004

* Links *
* 链 接 *

Gmail
Blog Skin
Time
新华新闻
My E-mail
Yahoo

* Other *
* 其它内容 *

Google


Message Board
留 言 板

Name

URL or Email

Messages(smilies)

Minnesota Last Names

* Wednesday, October 06, 2004 *

Introduction to JSP



Choosing a server-side language used to be easy. Way back when, CGI was pretty much the only scripting option out there. Intrepid developers could write their own server extensions, but few were up to the challenge, and the gap between these two options (inefficient CGI scripts and extremely complex server extension development) was huge.

Microsoft tried to fill this hole with Active Server Pages (ASP), which allow developers to use simple scripting to access the server and its extensions. But while ASP gives you an efficient way to return dynamic content, it essentially limits you to Microsoft platforms, and even the simplest of scripting mistakes can cause the server to crash or hang, effectively bringing down your website.

Apparently in response to ASP, Sun Microsystems gave the world JavaServer Pages (JSP) technology, which is based entirely upon Sun's popular Java programming language and gives developers the advantages of developing in Java in a more relaxed, script-like environment. Behind the scenes, JSP pages are dynamically assembled into Servlets, which are simply Java classes. This means JSP supports the same modularity, reusability, platform-independence, and access to Java APIs that Java programming supports.

Thanks to its foundation in Java and its use of Java threads to handle incoming requests, JSP is a great deal more efficient than many other scripting languages, such as CGI. Its threading model and error handling also help prevent server hangs and crashes. And when the underlying Java Virtual Machine (JVM) makes use of Just In Time (JIT) compilation, the performance of well-written JSP can approach that of C++.

JSP also bests ASP by supporting the definition of tags that abstract functionality within a page, so tags can be defined in a tag library and then used within any JSP page. This makes for a better separation of page content from its code, which is one of Web development's prime directives. The less code scattered throughout the pages of a website, the easier the site is to maintain. Global changes need only be made to the tags defined in a central library, making time-consuming, page-by-page fixes things of the past.

For XML lovers, good news: JSP pages can be written in well-formed, valid XML by using XSLT. (For those of you who aren't XML-spawn, this simply means that JSP can make full use of a very powerful and widely accepted data format and all the tools and support that go with it.)

And unlike ASP, JSP is a lot less platform-specific and it doesn't rely as heavily on the company that created it for support or performance improvements. That said, there are some similarities between JSP and ASP. Here, let's closer look at how the two compare.

Teddy wished upon a star at 10/06/2004 05:41:00 pm

*******************

Designer: Zheng Ying
Please Contact Me: (006)016-3963025