Jsp: include action
Jsp: useBean action
A further description of jsp: useBean
Jsp: setProperty action
Jsp: getProperty action
Jsp: forward action
Jsp: plugin action
--------------------------------------------------------------------------------
JSP actions use tags in XML syntax to control the behavior of the Servlet engine. JSP actions can be used to dynamically Insert Files, reuse the JavaBean Component, redirect users to another page, and generate HTML code for the Java Plug-in.
JSP actions include:
Jsp: include: Introduce a file when the page is requested.
Jsp: useBean: Find or instantiate a JavaBean.
Jsp: setProperty: Set attributes of JavaBean.
Jsp: getProperty: outputs the attributes of a JavaBean.
Jsp: forward: Transfers requests to a new page.
Jsp: plugin: generate the OBJECT or EMBED tag for the Java Plug-in based on the browser type.
Jsp: include action
This action inserts the specified file into the page being generated. The syntax is as follows:
<Jsp: include page = "relative URL" flush = "true"/>
The include command has been introduced earlier. It introduces the file when the JSP file is converted into a Servlet. the jsp: include action here is different, the file is inserted when the page is requested. The introduction time of the jsp: include action file determines that its efficiency is slightly lower, and the Referenced File cannot contain some JSP code (for example, the HTTP header cannot be set ), but it is much more flexible.
For example, the following JSP page inserts four news summaries into a "What's New ?" Page. Only the four files need to be changed when the news abstract is changed, but the main JSP page can not be modified:
WhatsNew. jsp
<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN">
<HTML>
<HEAD>
<TITLE> What's New </TITLE>
</HEAD>
<Body bgcolor = "# FDF5E6" TEXT = "#000000" LINK = "# 0000EE"
VLINK = "# 551A8B" ALINK = "# FF0000">
<CENTER>
<Table border = 5 BGCOLOR = "# EF8429">
<TR> <th class = "TITLE">
What's New at JspNews.com </TABLE>
</CENTER>
<P>
Here is a summary of our four most recent news stories:
<OL>
<LI> <jsp: include page = "news/Item1.html" flush = "true"/>
<LI> <jsp: include page = "news/Item2.html" flush = "true"/>