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>

Preface

All tags are case sensitive. A pair of single quotes is equivalent to a pair of double quotes. Spaces are not allowed between an equals sign and an attribute value.

The elements in a JSP page can be expressed in JSP syntax or XML syntax. The following rules apply:

Quoting Conventions

The following outlines quoting conventions for JSP pages expressed in JSP syntax.

Scripting Elements

EL Expressions

Template Text

Attributes

Typographic Conventions

code = fixed

bold = default

italics = user-defined

| = or

[ ] = optional

{ } = required choice

... = list of items

+ = can repeat

' ' = literal

() = grouped together

^ = anything other than

- = a range

Notes

Some action elements have attributes whose value can be computed at request time. In JSP syntax, the format of such a value is the same as a JSP expression: <%= expression %>. In XML syntax, the format of the value is %= expression %. When using the JSP expression language (EL), the format of the value in either syntax is ${ expression }.

EL expressions can be quoted by adding a backslash to the front of the expression when the expression language is enabled. This prevents the expression from being evaluated. Example: \${x+y} will display as ${x+y}.

All elements in XML syntax can contain an xmlns attribute that complies with the XML namespaces spec. This attribute is used to declare tag libraries and other namespaces. Within the start tag of an element, its syntax is [xmlns:taglibprefix="URI"]+.

All JSP standard actions and custom actions can contain a jsp:attribute standard element as a substitute for any of its attributes. The jsp:attribute syntax is <jsp:attribute name="attributeName" [ trim="true | false" ] />

If an action contains any jsp:attribute elements and the action also has a body, it must use the jsp:body tag to represent the body. The jsp:body syntax is<jsp:body> any elements or text </jsp:body>


 



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

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

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

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