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"/>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.