JSP syntax (4)

xiaoxiao2021-03-06  72

Redirect an HTML file, a JSP file, or a block.

JSP syntax

"} />

oral

"}>

Value = "{parameterValue | <% = express%>}" />

example

description

Tag Pass from a JSP file to another file with a request object containing a user request. The code below the tag will not be executed.

You can send parameters and values ​​to the target file, in this example, the parameters we passed are namedame, the value is Scott, if you use the tag, the target file must be a dynamic file, you can handle parameters .

If you use a non-buffered output, be careful when using . If you use , the JSP file already has data, then the file execution will be wrong.

Attributes

Page = "{relativeURL | <% = expression%>}"

Here is an expression or a string to illustrate the file or URL you will oriented. This file can be a JSP, block, or other file capable of handling the request object (such as ASP, CGI, PHP).

Send one or more parameters to a dynamic file, this file must be a dynamic file.

If you want to pass multiple parameters, you can use multiple in a JSP file. Name Specifies the parameter name, Value Specifies the parameter value.

Get the properties of the bean, used to display in the page

JSP syntax

example

Calendar of

description

This element will get the properties value of the bean and can be used or displayed in the JSP page. You must create it with before you use .

Elements have some restrictions:

You can't use to retrieve an attribute that has been indexed

You can use with the Javabeans component, but cannot be used with Enterprise Beans.

Attributes

Name = "beaninstancename"

Bean's name, by

Property = "PropertyName"

The attribute name of the specified bean.

skill:

In the JSP reference in Sun, if you use to retrieve the value is null, then NullPointerException will appear, and if you use the block or expression to retrieve its value, then appear on the browser NULL (empty).

Contains a static or dynamic file.

JSP syntax

oral

Examples

description

Elements Allows you to include dynamic files and static, which are different from the results of the files. If the file is just a static file, this includes adding the contents of the included file to the JSP file, and if this file is dynamically, then this containing file will be executed by the JSP compiler (this is similar to the ASP )

You can't judge a file from a file name to be dynamic or static, such as aspcn.asp may just contain some information, without having to execute. can handle these two files at the same time, so you don't need to include this file is dynamic or static.

If this included file is dynamic, you can also pass the parameter name and parameter value with . Attributes

Page = "{relativeURL | <% = expression%>}"

The parameter is a relative path, or represents a relative path expression.

Flush = "True"

Here you must use flush = "true", you can't use false values. The default is false

clause allows you to pass one or more parameters to dynamic files

You can use multiple in a page to deliver multiple parameters,

转载请注明原文地址:https://www.9cbs.com/read-92724.html

New Post(0)