jsp的指令标记有哪些_JSP指令标记

jsp的指令标记有哪些

Directive Tag gives special instruction to Web Container at the time of page translation. Directive tags are of three types: page, include and taglib.

指令标记在页面翻译时为Web容器提供特殊说明。 指令标记具有三种类型: pageincludetaglib

Directive Description
<%@ page ... %> defines page dependent properties such as language, session, errorPage etc.
<%@ include ... %> defines file to be included.
<%@ taglib ... %> declares tag library used in the page
指示 描述
<%@ page ... %> 定义页面相关的属性,例如语言,会话,errorPage等。
<%@ include ... %> 定义要包含的文件。
<%@ taglib ... %> 声明页面中使用的标签库

We'll discuss about include and taglib directive later. You can place page directive anywhere in the JSP file, but it is good practice to make it as the first statement of the JSP page.

稍后我们将讨论includetaglib指令。 您可以将页面指令放置在JSP文件中的任何位置,但是将其作为JSP页面的第一条语句是一种好习惯。

The Page directive defines a number of page dependent properties which communicates with the Web Container at the time of translation. Basic syntax of using the page directive is <%@ page attribute="value" %> where attributes can be one of the following :

Page指令定义了许多与页面相关的属性,这些属性在转换时与Web容器通信。 使用page指令的基本语法是<%@ page attribute="value" %> ,其中属性可以是以下之一:

  • import attribute

    导入属性

  • language attribute

    语言属性

  • extends attribute

    扩展属性

  • session attribute

    会话属性

  • isThreadSafe attribute

    isThreadSafe属性

  • isErrorPage attribute

    isErrorPage属性

  • errorPage attribute

    errorPage属性

  • contentType attribute

    contentType属性

  • autoFlush attribute

    autoFlush属性

  • buffer attribute

    缓冲区属性

导入属性 (import attribute)

The import attribute defines the set of classes and packages that must be imported in servlet class definition. For example

import属性定义了必须在servlet类定义中导入的类和包的集合。 例如

or

语言属性 (language attribute)

language attribute defines scripting language to be used in the page.

language属性定义要在页面中使用的脚本语言。

扩展属性 (extends attribute)

extends attribute defines the class name of the superclass of the servlet class that is generated from the JSP page.

extend属性定义了从JSP页面生成的servlet类的超类的类名。

会话属性 (session attribute)

session attribute defines whether the JSP page is participating in an HTTP session. The value is either true or false.

session属性定义JSP页面是否正在参与HTTP会话。 该值为true或false。

isThreadSafe属性 (isThreadSafe attribute)

isThreadSafe attribute declares whether the JSP is thread-safe. The value is either true or false

isThreadSafe属性声明JSP是否是线程安全的。 该值为true或false

isErrorPage属性 (isErrorPage attribute)

isErrorPage attribute declares whether the current JSP Page represents another JSP's error page.

isErrorPage属性声明当前的JSP页面是否代表另一个JSP的错误页面。

errorPage属性 (errorPage attribute)

errorPage attribute indicates another JSP page that will handle all the run time exceptions thrown by current JSP page. It specifies the URL path of another page to which a request is to be dispatched to handle run time exceptions thrown by current JSP page.

errorPage属性指示另一个JSP页面,它将处理当前JSP页面引发的所有运行时异常。 它指定另一个页面的URL路径,将请求发送到该页面以处理当前JSP页面引发的运行时异常。

contentType属性 (contentType attribute)

contentType attribute defines the MIME type for the JSP response.

contentType属性定义JSP响应的MIME类型。

autoFlush属性 (autoFlush attribute)

autoFlush attribute defines whether the buffered output is flushed automatically. The default value is "true".

autoFlush属性定义是否自动刷新缓冲的输出。 默认值是true”。

缓冲区属性 (buffer attribute)

buffer attribute defines how buffering is handled by the implicit out object.

buffer属性定义隐式out对象如何处理缓冲。

翻译自: https://www.studytonight.com/jsp/jsp-directive-tag.php

jsp的指令标记有哪些

你可能感兴趣的:(java,jsp,spring,servlet,session)