JSP语言格式
来源:互联网 发布:李知行唐宓 番外 编辑:程序博客网 时间:2024/05/16 10:15
(一)指令讲解
Page指令
<%@ page
[language=”java”]
[import=”package.class,……”]
[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=”package.class”]
%>
include 指令
<@ include file=”fileName”>包含一个静态文件
(2)<jsp:include page=”fileNamePath” flush=”True”>
<jsp:param name=”paramName” value=”paramValue”>
</jsp:include>
(1)<jsp:forward page=”path”>
(2) <jsp:forward page=”path”>
<jsp:param name=”paramName” value=”paramValue”>
</jsp:forward>
useBean指令
<jsp:useBean id=”name” scope=”page|request|session|application” class=”package.className” />
getProperty指令
<jsp:getProperty name=”beanName” property=”propertyName”/>
setProperty指令
property=”*” | property=”propertyName” |
property=”propertyName” param=”parameterName” |
property=”propertyName” value=”propertyValue”
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对象的主要方法:
1、 out.print(String name)
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 , java.lang.Object 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)
本文来自: 中国自学编程网(www.zxbc.cn) 详细出处参考:http://www.zxbc.cn/html/20070608/21427.html
Page指令
<%@ page
[language=”java”]
[import=”package.class,……”]
[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=”package.class”]
%>
include 指令
<@ include file=”fileName”>包含一个静态文件
Include动作指令
(1)<jsp:include page=”fileNamePath” flush=”True”>(2)<jsp:include page=”fileNamePath” flush=”True”>
<jsp:param name=”paramName” value=”paramValue”>
</jsp:include>
(1)<jsp:forward page=”path”>
(2) <jsp:forward page=”path”>
<jsp:param name=”paramName” value=”paramValue”>
</jsp:forward>
useBean指令
<jsp:useBean id=”name” scope=”page|request|session|application” class=”package.className” />
getProperty指令
<jsp:getProperty name=”beanName” property=”propertyName”/>
setProperty指令
<jsp:setProperty name=”beanName” prop_expr />
prop_expr有以下几种可能的情形:property=”*” | property=”propertyName” |
property=”propertyName” param=”parameterName” |
property=”propertyName” value=”propertyValue”
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对象的主要方法:
1、 out.print(String name)
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 , java.lang.Object 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)
本文来自: 中国自学编程网(www.zxbc.cn) 详细出处参考:http://www.zxbc.cn/html/20070608/21427.html
- JSP语言格式
- 【jsp】jsp语言
- JSP语法格式
- jsp格式date类型
- jsp格式标签
- jsp格式细节总结
- 1.3JSP声明格式
- ftl转jsp格式
- jsp数字格式
- jsp 注释 格式
- JSP编码格式设置
- jsp表单验证格式
- jsp中的时间格式(struts)
- JSP中日期格式转换
- jsp导出excel格式设置
- stuts jsp 时间格式记录
- jsp页面时间显示格式
- 看懂JSP声明的格式。。。
- WebForm中F5刷新重新提交值解决办法
- 如何从sqlserver中把表数据导入到oracle?
- 这算是工作努力还是装13呢?
- GCD介绍(四): 完结
- 相当通俗易懂的并查集讲解---希望找到原作者
- JSP语言格式
- 分享一个程序员资料分享站点
- VARIANT
- c的链表实现
- Linux下c编程系统函数调用Signal信号的介绍
- Android用Application设置全局变量以及使用
- C#實現執行dos命令的方法
- 第 37 章 socket编程
- Struts---- 动态ActionForm