JSP Learning Notes (i)-----overview

Source: Internet
Author: User
Tags client access
js| notes

1.JSP is a shorthand for Java Server pages.

2. Web applications developed with JSP are cross-platform.

3.JSP Technology is an extension of the servlet technology. The servlet is platform-Independent, 100% Java server-side components of pure java.

4. The following is a simple JSP page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD><TITLE>欢迎访问网上商店</TITLE></HEAD>
<BODY>
<H1>欢迎</H1>
<SMALL>欢迎,
<!-- 首次访问的用户名字为"New User" -->
<% out.println(Utils.getUserNameFromCookie(request)); %>

To set account information, please click

<A HREF="Account-Settings.html">这里</A></SMALL>
<P>

The rest of the page ...

5. Here is a simple comparison of JSP and other similar or related technologies:

1). JSP compared to active Server Pages (ASP)

Microsoft's ASP is a technology similar to JSP. There are two advantages to JSP compared with ASP. First, dynamic parts are written in Java, not VB script or other Microsoft languages, and are more powerful and easier to use. Second, JSP applications can be ported to other operating systems and to non-Microsoft Web servers.

2). JSP compared to the pure servlet

JSP does not add any functionality that cannot be implemented by the servlet in nature. However, it is more convenient to write static HTML in the JSP without having to use the PRINTLN statement to output each line of HTML code. More importantly, with the separation of content and appearance, the tasks of different natures in page making can be easily separated: for example, HTML design by a page design expert, while leaving room for the servlet programmer to insert dynamic content.

3). JSP and server-side contains (Server-side Include,ssi) compared

SSI is a widely supported technique for introducing external code into static HTML. JSP is more sophisticated in this regard because it can generate dynamic content with a servlet rather than a stand-alone program. In addition, SSI is actually used only for simple inclusion, not for "real" programs that can process form data and Access databases.

4). JSP is compared with JavaScript

JavaScript can dynamically generate HTML on the client side. Although JavaScript is useful, it can only handle dynamic information that is based on the client environment. In addition to cookies, HTTP status and form submission data are not available for JavaScript. In addition, JavaScript cannot access server-side resources, such as databases, directory information, and so on, because it is running on the client.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.