Three compile command of JSP: @page,@include,@taglib
<%@page
[language="Java"]
[extends="package.class"] --the parent class should be extended
[import= "package. class | package. *},…"] --import some package for your java code
[session="true | false"] --whether need HTTP sesison
[buffer="none | 8kb | size kb" 1
[autoFlush="true I false"]
[isThread8afe="true | false"]
[info="text"] --Servlet.getServerInfo()
[errorPage="relativeURL"] --when the error or exception thrown,skip to the errorpage pointed.
[contentType="mimeTyPe[ ;charset=characterSet]" | "text/html;charSet=ISO808859-1"]
[isErrorPage=" true | false"]
%>
<%@include file="include.jsp" %>,this is the static command,if the file included always need change
,it should use <jsp:include> which is the dynamic operation.it always check the jsp file included and
The included jsp and the main jsp joined together when output.
All the setttings of page,the object used of Dynamic include should create itself.but they have the same scope
of request.
The static include jsp can use the settings of main jsp,they are a whole servlet.
Seven action command:
jsp:forward: make the page redirect,request of handling will go to the page forward.
<jsp:forward page=" {relativeURL | <%=expression%>}">
{<jsp:param.../>}
</jsp:forward>
jsp:param: deliver the params.
jsp:include: Dynamic include a jsp.
jsp:plugin: download the JavaBean or Applet to client server.
jsp:useBean: use JavaBean .
jsp:setProperty: set the propety of JavaBean instance.
jsp:getProperty: get the propety of JavaBean instance.
nine object embedded:
application: the instance of javax.servlet.ServletContext,valid in the whole web application
config:the instance of javax.servlet.ServletConfig
exception:the instance of java.lang.Throwable
out:the instance of javax.servlet.jsp.JspWriter
page: 'this' of Servlet
pageContext: the instace of Javax.servlet.jsp.PageContext
request:the instace of javax.servlet.http.HttpServletRequest
response:the instace of javax.servlet.http.HttpServletResponse
session: the instace of javax.servlet.http.HttpSession
本文介绍了JSP页面中的三个核心指令:@page、@include 和 @taglib 的使用方法。详细解释了如何通过这些指令配置页面属性、静态包含文件及引入标签库。此外还涵盖了七个JSP动作元素,包括页面跳转、参数传递、动态包含等功能。
1万+

被折叠的 条评论
为什么被折叠?



