Preface

Comment

Declaration

Expression

Scriptlet

EL Expression

Directives

Attribute Directive

Include Directive

Page Directive

Tag Directive

Taglib Directive

Variable Directive

Standard Actions

<jsp:attribute>

<jsp:body>

<jsp:element>

<jsp:doBody>

<jsp:forward>

<jsp:getProperty>

<jsp:include>

<jsp:invoke>

<jsp:output>

<jsp:plugin>

<jsp:root>

<jsp:setProperty>

<jsp:text>

<jsp:useBean>

JavaServer Pages (JSP) v2.0  Syntax Reference

Core Syntax

Description

Comment

Documents the JSP page but is not inserted into the response.

Declaration

Declares a variable or method valid in the scripting language used in the page.

Expression

Contains an expression valid in the scripting language used in the page.

Scriptlet

Contains a code fragment valid in the scripting language used in the page.

EL Expression

Contains an expression in the JSP Expression Language (EL). See Expression Language section below for the syntax.

Directives

Description

Attribute Directive

Declares an attribute of the custom tag defined in the tag file.

Include Directive

Includes a resource of text or code when the JSP page is translated.

Page Directive

Defines attributes that apply to an entire JSP page.

Tag Directive

Similar to the page directive in a JSP page, but applies to tag files instead of JSP pages.

Taglib Directive

Defines a tag library and prefix for the custom tags used in the JSP page.

Variable Directive

Defines an expression language variable exposed by the tag to the calling page.

Standard Actions

Description

<jsp:attribute>

Used as a substitute for attributes of standard or custom actions.

<jsp:body>

Explicitly defines an element body. This tag is required if the enclosing element contains any jsp:attribute tags.

<jsp:element>

Dynamically generates an XML element

<jsp:doBody>

Evaluates the body of the tag used by the calling page to invoke this tag file.

<jsp:forward>

Forwards a request to an HTML file, JSP page, or servlet.

<jsp:getProperty>

Inserts the value of a bean property into the response.

<jsp:include>

Includes a static resource or the result from another web component

<jsp:invoke>

Evaluates a fragment attribute.

<jsp:output>

Specifies the XML declaration or the document type declaration in the request output of a JSP document or a tag file that is in XML syntax.

<jsp:plugin>

Causes the execution of an applet or bean. The applet or bean executes in the specified plugin. If the plugin is not available, the client displays a dialog to initiate the download of the plugin software.

<jsp:root>

Defines standard elements and namespace attributes of tag libraries.

<jsp:setProperty>

Sets a bean property value or values.

<jsp:text>

Encloses template data.

<jsp:useBean>

Instantiates or references a bean with a specific name and scope.

宏飞网络是你学习web开发、测试web程序实例、和培养职业技能的首选网站。我们提供例子也许有些简单,但对理解基本概念有帮助。

我们尽量避免在教程、参考及例子中出现错误,但不能保证所有的内容都是正确的。

你使用本网站时,我们默认你已经阅读并接受了我们的隐私政策。

Copyright 2003-2011宏飞网络 版权所有