JSP Beginners must master the grammar points

Source: Internet
Author: User
Tags version

If you are unfamiliar with Java programming, you may want to take a look at Sun's guidelines. However, web creators do not need to do much Java development. In addition to some method calls, you should use as little Java code as possible in your JSP pages.

With these tips in mind, let's take a look at the JSP directives and the scripting elements, and then we'll explain JavaBeans and suppressed objects. There are five kinds of JSP directives and script elements. In JSP version 1.0, most JSPs are surrounded by a tag that starts with "<%" and ends with "%>." After the updated JSP 1.1 specification was introduced, there was an XML-compatible version.

JSP directives and script elements

Directives < %@ directive %>
  Declarations < %! declaration %>
  Expressions < %= expression %>
  Code Fragment/Scriptlet < % code fragment %>
  Comments < %-- comment --%>

Instructions

JSP directives are designed for the JSP engine. They don't directly produce any visible output, but just tell the engine how to handle the rest of the JSP pages. These directives are always enclosed in the "<%@?%>" tag. The two most important directives are "pagepage" and "Include". The "Taglib" directive is not in the discussion column, but it can be used to create a custom tag with JSP1.1.

"Page" instructions are seen almost at the top of all JSP pages. Although not necessary, it allows you to specify:

Where to find the supported Java categories:

<%@ page import= "Java.util.Date"%>

Where to turn on the Web surfers when there is a Java run problem:

<%@ page errorpage= "errorpage.jsp"%>

and whether you need to manage the user's session-level information, which may come from multiple pages (further in the JavaBeans section below):



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.