Java

本类阅读TOP10

·使用MyEclipse开发Struts框架的Hello World!(录像1)
·hibernate配置笔记
·AOP编程入门--Java篇
·linux下Tomcat 5.0.20 与 Apache 2 安装/集成/配置
·在win2003下整合了整合Tomcat5.5+ apache_2.0.53+ mod_jk_2.0.47.dll
·构建Linux下IDE环境--Eclipse篇
·Jsp 连接 mySQL、Oracle 数据库备忘(Windows平台)
·ASP、JSP、PHP 三种技术比较
·Tomcat5.5.9的安装配置
·AWT GUI 设计笔记(二)

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
JSP语法格式

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

JSP语法讲解

()指令讲解

 

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>

 

 

forward动作指令

(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的内建对象有以下几种:requestresponseoutSessionpageContextapplicationconfig page

 

request对象的主要方法:

1、  getParameter(String  name) return String

2、  getParameterNames() return Enumeration

3、  getParameterValues(String  name) return String[]

 

out对象的主要方法

1、  out.print(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 , 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)




相关文章

相关软件