JSP pages and simple instructions

Source: Internet
Author: User

?JSP (Java Server Pages) refers to the following:? Embed the Java scripting language in HTML? Compile and execute embedded Java scripting language commands by the JSP engine in the application server? Then returns the entire page information generated to the client Page Composition? JSP directives directive function:

Control the overall structure of the servlet generated by this page

? general form of instruction:

<%@ directive {attr= "value"}%>

? directive instruction Category

1. Page directive

Role: Indicates the information related to the page.

2.include instruction

Role: Contains another file to enable reuse of the page.

3.taglib instruction

Function: Indicates the tag library used by this JSP page. page directive

Role: Indicates the information related to the page.

Note: In a JSP page, the page directive can appear more than once, but each property can only appear once, and the repeating property setting overrides the previous setting, but the Import property is an exception and can have multiple import operations.

Basic syntax Format:

<%@ page Page_directive_attr_list%>

Page directive Common Properties

include instruction

function : include another file (html,jsp,text , etc. ) , the contents of the file

included in this JSP in the page

Syntax :<%@ include file= "top.jsp "%>

taglib instruction

function : Indicates this jsp syntax : <%@ taglib uri= "Taglibraryuri" prefix= "TagPrefix"%>

Property

description

Language= "Java"

languagevariable tellsServerwhich language will be used in the file,JSPin the current specification,Javais aJSPthe only supported language

extends= "Package.class"

extendsvariable defines theJSPPage generated byservletin general, this attribute is used very little.  

Import= "Package.*,package.class"

Importvariable and any oneJavathe first part of the program. Importthe value of a variable is a series of comma-separated lists that indicate the packages and classes that you want to introduce.  

JSP pages and simple instructions

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.