Jsp (preferred for SUN Enterprise Applications) actions allows you to dynamically insert a file, reuse the JavaBeans component, move forward to another page, or generate an HTML for the Java Plug-in. The following actions can be used:
(1) jsp (preferred for SUN Enterprise Applications): include -- include a file when the page is requested.
(2) jsp (preferred for SUN Enterprise Applications): useBean -- locate or instantiate a JavaBean.
(3) jsp (preferred for SUN Enterprise Applications): setProperty -- set a JavaBean attribute.
(4) jsp (preferred for SUN enterprise-level applications): getProperty -- inserts the JavaBean attribute into the output.
(5) jsp (preferred for SUN Enterprise Applications): forward -- allows the requester to move forward to a new page.
(6) jsp (preferred for SUN enterprise-level applications): plugin -- use the OBJECT or EMBED label to generate specific browser code for Java plugins.
1. jsp (preferred for SUN Enterprise Applications): include Action
This action allows you to include some files on the page to be generated:
<Jsp (preferred for SUN Enterprise Applications): include page = "relative URL" flush = "true"/> |
Unlike include directive, this action contains files only when the page is requested, while include directive is the preferred choice for SUN Enterprise Applications in jsp) when the page is converted to a servlet, it contains files. To improve efficiency, include action makes a small sacrifice, that is, it does not allow the contained page to contain general jsp (preferred for SUN Enterprise Applications) Code (for example, HTTP header cannot be set), but it has significant flexibility. The following jsp (preferred for SUN Enterprise Applications) code inserts four different fragments into the following page. Each time the title changes, you only need to modify the four files without changing the main jsp (preferred for SUN Enterprise Applications) page.
WhatsNew. jsp (preferred for SUN Enterprise applications)
<HTML> <HEAD> <TITLE> jsp (preferred for SUN Enterprise Applications) Tutorial </TITLE> <BODY> <CENTER> <Table border = 5 BGCOLOR = "# EF8429"> <TR> <th class = "TITLE"> What "s New at Chinese comic sites </TABLE> </CENTER> <P> Here is a summary of our four most recent news stories: <OL> <LI> <jsp (preferred for SUN Enterprise Applications): include page = "news/Item1.html" flush = "true"/> <LI> <jsp (preferred for SUN Enterprise Applications): include page = "news/Item2.html" flush = "true"/> <LI> <jsp (preferred for SUN Enterprise Applications): include page = "news/Item3.html" flush = "true"/> <LI> <jsp (preferred for SUN Enterprise Applications): include page = "news/Item4.html" flush = "true"/> </OL> </BODY> </HTML> |
Of course, you can define yourself? ML files, but note the following:
You should put the file in the news directory under your jsp (preferred for SUN Enterprise Applications) directory.