Chinaunix首页 | 论坛 | 博客
  • 博客访问: 523848
  • 博文数量: 151
  • 博客积分: 7010
  • 博客等级: 少将
  • 技术积分: 1405
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-22 14:32
文章分类

全部博文(151)

文章存档

2011年(1)

2010年(23)

2009年(1)

2008年(126)

我的朋友

分类: 系统运维

2008-08-05 09:43:03

A JSP action is executed when a JSP page is requsted.In other words,JSP action elements represent dynamic actions that take place at runtime,as opposed to JSP directives that are used only during the translation phase.Action elements,or tags as they are often called,are grouped into libraries(known as tag libraries).

Actions can be grouped into three categories:standard,custom,and JSP Standard Tag Library.

1、Standard actions
   Standard actions are actions defined by JSP specification itself.The JSP standard actions use the prefix 'jsp'.

Action element

Description

Makes a JavaBeans component available in a page
Gets a property value from a JavaBeans component and adds it to the response
Set a JavaBeans property value
Includes the response from a servlet or JSP page during the request processing phase
Forwards the processing of a request to a servlet or JSP page
Adds a parameter value to a request handed off to another servlet or JSP page using or
Generates HTML that contains the appropriate browser-dependent elements (OBJECT or EMBED) needed to execute an applet with the Java Plugin software
Sets the value of an action attribute based on the body of this element
Sets the action element body based on the body of this element. Required when the action element body contains action elements
Dynamically generates an XML element, optionally with attributes and a body defined by nested and actions
Used to encapsulate template text that should be used verbatim; typically only needed in JSP pages written as XML documents

2、JSP Standard Tag Library
   Core 
     Conditional processing and looping, importing data from external sources, etc.
   XML processing
     Processing of XML data, such as transforming and accessing individual elements
   Internationalization (I18N) and formatting
     Format and parse localized information, insert localized information in a page
   Relational database access (SQL)
     Read and write relational database data

3、custom actions
   The JSP specification also defines how to develop new actions that can be used in any JSP page.Such actions are called custom actions.

4、The JSP Expression Language
   An EL expression always starts with the '${' and ends with '}'.for example
   1 + 2 + 3 = ${1 + 2 + 3}
   A set of EL implicit variables,listed below ,provides access to all information about a request as well as other generic information.

Variable name

Description

pageScope A collection (a java.util.Map) of all page scope variables
requestScope A collection (a java.util.Map) of all request scope variables
sessionScope A collection (a java.util.Map) of all session scope variables
applicationScope A collection (a java.util.Map) of all application scope variables
param A collection (a java.util.Map) of all request parameter values as a single String value per parameter
paramValues A collection (a java.util.Map) of all request parameter values as a String array per parameter
header A collection (a java.util.Map) of all request header values as a single String value per header
headerValues A collection (a java.util.Map) of all request header values as a String array per header
cookie A collection (a java.util.Map) of all request cookie values as a single javax.servlet.http.Cookie value per cookie
initParam A collection (a java.util.Map) of all application initialization parameter values as a single String value per value
pageContext An instance of the javax.servlet.jsp.PageContext class, providing access to various request data
here's a action with an EL expression that uses the implicit param variable to read the value of a request parameter named userName:



 
阅读(892) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~