2024年3月10日发(作者:)
JSP语法讲解
(一)指令讲解
Page指令
<%@ page
[language=”java”]
[import=”,……”]
[contentType=”text/html”;charset=”GB3212”]
[session=”True|false”]
[buffer=”none|8kb|sizekb”]
[autoFlush=”True|false”]
[isThreadSafe=”True|false”]
[info=”text”]
[errorPage=relativeURL]
[isErrorPage=”True|false”]
[extends=””]
%>
include 指令
<@ include file=”fileName”>包含一个静态文件
Include动作指令
(1)
(2)
forward动作指令
(1)
(2)
useBean指令
class=”ame” /> getProperty指令 setProperty指令 prop_expr有以下几种可能的情形: (二)内建对象讲解 JSP的内建对象有以下几种:request、response、out、Session、pageContext、 application、config、 page request对象的主要方法: 1、 getParameter(String name) return String 2、 getParameterNames() return Enumeration 3、 getParameterValues(String name) return String[] out对象的主要方法: property=”*” | property=”propertyName” | property=”propertyName” param=”parameterName” | property=”propertyName” value=”propertyValue” 1、 (String name) Session对象的主要方法: 1、 getAttribute(String name) return Object 2、 getAttributeNames() return Enumeration 3、 getCreationTime() return long 4、 getId() return String 5、 GetLastAccessedTime() return long 6、 GetMaxInactiveInterval() return int 7、 RemoveAttribute(String name) void 8、 SetAttribute(String name , value) void application对象的主要方法: 1、 getAttribute(String name) return Object 2、 getAttributeNames() return Enumeration 3、 getInitParameter(String name) 4、 getServletInfo() 5、 setAttribute(String name , Object object)


发布评论