山东程子末军 SHANDONG UNIVERSITY OF TECIINOLOQY 图示page指令 <spage language="Java"> <html> @autoFlush=“true" Attribate autoFlush <head> Data Type ENUM buffer="8kb" Default Value true <title>isp</title> @contentType="text/html:charset=IS0-8859-1" Enumerated Values </head> true errorPage false <body> extends < @import out.print (k); info > @isELIgnored="flse“ <! 回isErrorPage="false" int k=20; isThreadSafe="true" @pageEncoding="ISO-8859-1" > @session="true" <br/> #default namespace-Default Namespace Attribute <=k> ◆JSP expression-JSP expression〈=,.%第) </body> noschemaLoc-No Namespace Schema Location </html> #schemaLoc XML Schema location attribute #xsinsp -XML Schema name space 计 算 机 学 院 11 J2EE WEB
J2EE WEB 计 算 机 学 院 11 图示page指令
归东程子太军 SHANDONG UNIVERSITY OF TECIINOLOGY 3.2.1页面(page)指令 <%page language="java"import="java.util.Date" session="true" buffer="12kb"autoFlush="true"info="a test directive jsp page" errorPage="error.jisp"isErrorPage="false" contentType="text/html;charset=utf-8"%> <%page errorPage="error.jsp"%> <%page isELlgnored="false"%> page指令属性 <html> <body> h1>使用page指令的测试页面<h1> <%=new java.util.Date().toLocaleString()%> 计 使用表达式语言: 算 1$4>3}:${4>3} http://localhost:8080/ch3/pageDirectiveTest.jsp 机 </body> 学 </html> 使用page指令的测试页面 院 12 2012-2-2319:3344使用表达式语言:$(4>3}tnue
J2EE WEB 计 算 机 学 院 12 3.2.1 页面(page)指令 <%@ page language="java" import="java.util.Date" session="true" buffer="12kb" autoFlush="true" info=" a test directive jsp page" errorPage="error.jsp" isErrorPage="false" contentType="text/html; charset=utf-8" %> <%@ page errorPage="error.jsp" %> <%@ page isELIgnored="false"%> <html> <body> <h1> 使用page指令的测试页面</h1> <%=new java.util.Date().toLocaleString()%> 使用表达式语言: \${4>3}:${4>3} </body> </html> page 指令属性
白东程子太军 SHANDONG UNIVERSITY OF TECIINOLOQY 3.2.2 include指令 口include指令用于在编译时将HTML文件或JSP页 面嵌入到另一个JSP页面。 口include指令语法 <%@include file=“filename”%> 计 算 机 院 13 J2EE WEB
J2EE WEB 计 算 机 学 院 13 3.2.2 include指令 ❑include 指令用于在编译时将HTML文件或JSP页 面嵌入到另一个JSP页面。 ❑include指令语法 <%@ include file = “filename” %>
山东理王末军 SHANDONG UNIVERSITY OF TECIINOLOGY 3.2.2 include:指令 <%page contentType="text/html;charset=gb2312"%> <%include file="header.jsp"%> <%include file="body.jsp"% <%include file="footer.jsp"%> <table height=20 width=100%bgcolor=99ccff> <tr><td align=center>=========header==</td></tr></table> <html> <%page <body bgcolor=f45ef2> contentType="text/html; this is body charset=gb2312"%> <br> <br>footer.<br> <table height=20 width=100%bgcolor=9eecff> <table height=50 width=100% <tr><td align=center>=========body==</td></tr> bgcolor=777777><tr><td align=center><hr> </table> {©,JSP应用开发详 </body> 解}}<%=new </html> java.util.Date()%></td></tr></ta 14 ble>
J2EE WEB 计 算 机 学 院 14 3.2.2 include指令 <%@ page contentType="text/html; charset=gb2312" %> <%@ include file="header.jsp" %> <%@ include file="body.jsp" %> <%@ include file="footer.jsp" %> <table height=20 width=100% bgcolor=99ccff> <tr><td align=center>=========header==</td></tr></table> <html> <body bgcolor=f45ef2> this is body <br> <table height=20 width=100% bgcolor=9eecff> <tr><td align=center>=========body==</td></tr> </table> </body> </html> <%@ page contentType="text/html; charset=gb2312" %> <br>footer.<br> <table height=50 width=100% bgcolor=777777><tr><td align=center><hr> {{{©JSP应用开发详 解}}}<%=new java.util.Date()%></td></tr></ta ble>
白本程2太军 SHANDONG UNIVERSITY OF TECIINOLOQY 上页的执行结果显示 http://1ochst:8080/ch3/includeDireetiveTest.jsp 世D数敦:白9国9自 ======header== this is body ==body日 footer. 1©JSP应用开发详解}Thu Feb2319:45:14CST2012 计 算 机 院 15 J2EE WEB
J2EE WEB 计 算 机 学 院 15 上页的执行结果显示