jsp动作利用xml语法格式的标记来控制servlet引擎的行为。利用jsp动作可以动态地插入文件、重用javabean组件、把用户重定向到另外的页面、为java插件生成html代码。
jsp动作包括:
jsp:include:在页面被请求的时候引入一个文件。
jsp:usebean:寻找或者实例化一个javabean。
jsp:setproperty:设置javabean的属性。
jsp:getproperty:输出某个javabean的属性。
jsp:forward:把请求转到一个新的页面。
jsp:plugin:根据浏览器类型为java插件生成object或embed标记。
13.1 jsp:include动作
该动作把指定文件插入正在生成的页面。其语法如下:
| <jsp:include page="relative url" flush="true" /> |
| <!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"/> <li><jsp:include page="news/item3.html" flush="true"/> <li><jsp:include page="news/item4.html" flush="true"/> </ol> </body> </html> |
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器