JSP Study Notes (1) ----- Overview

Source: Internet
Author: User

1. jsp (preferred for SUN Enterprise Applications) is short for Java Server Pages.

2. Web applications developed using jsp (the preferred choice for SUN Enterprise Applications) are cross-platform.

3. jsp (preferred for SUN Enterprise Applications) is an extension of Servlet technology. Servlet is a platform-independent Java Server Component of 100% pure Java.

4. The following is a simple jsp (preferred for SUN Enterprise Applications) page:
<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN">
<HTML>
<HEAD> <TITLE> welcome to the online store </TITLE> </HEAD>
<BODY>
<H1> welcome </H1>
<SMALL> welcome,
<! -- The username for the first access is "New User" -->
<% Out. println (Utils. getUserNameFromCookie (request); %>
To set account information, click
<A href = "Account-Settings.html"> here </A> </SMALL>
<P>
The rest of the page ..
</BODY> </HTML>

 

5. The following is a simple comparison between jsp (the preferred choice for SUN Enterprise applications) and other similar or related technologies:

1). jsp (preferred for SUN Enterprise Applications) compared with Active Server Pages (ASP)

Microsoft ASP is a technology similar to jsp (preferred for SUN Enterprise applications. Jsp (the preferred choice for SUN Enterprise Applications) has two advantages over ASP. First, the dynamic part is written in Java, rather than VB Script or other Microsoft languages, which is more powerful and easy to use. Second, jsp (preferred for SUN Enterprise Applications) applications can be transplanted to other operating systems and non-Microsoft Web servers.

2). jsp (preferred for SUN Enterprise Applications) compared with pure Servlet

Jsp (the preferred choice for SUN Enterprise Applications) does not add any functionality that cannot be implemented by Servlet in essence. However, it is more convenient to compile static HTML in jsp (the preferred choice for SUN Enterprise applications), so you do not have to use println statements to output every line of HTML code. More importantly, with the separation of content and appearance, different types of tasks in page creation can be easily separated: for example, HTML design is performed by page design experts, at the same time, we also set aside space for Servlet programmers to insert dynamic content.

 

3). Compared with Server-Side Include (SSI), jsp (preferred for SUN Enterprise applications)

SSI is a widely supported technology that introduces external code in static HTML. Jsp (the preferred choice for SUN Enterprise Applications) is more comprehensive in this regard, because it can generate dynamic content using servlets rather than independent programs. In addition, SSI is actually only used for simple inclusion, rather than for "real" programs that can process form data and access the database.

4). jsp (the preferred choice for SUN Enterprise Applications) compared with JavaScript

JavaScript can dynamically generate HTML on the client. Although JavaScript is useful, it can only process dynamic information based on the client environment. In addition to cookies, HTTP status and form submission data are unavailable for JavaScript. In addition, because it is running on the client, JavaScript cannot access server resources, such as database and directory information.

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.