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

全部博文(151)

文章存档

2011年(1)

2010年(23)

2009年(1)

2008年(126)

我的朋友

分类: 系统运维

2008-07-29 16:43:54

JSP页面元素分为3类:directive,action,and scripting.在JSP2.0中增加了Expression Language(EL)
 
一、Directive elements

 Element

 Description

<%@ page ... %> Defines page-dependent attributes, such as session tracking, error page, and buffering requirements
<%@ include ... %> Includes a file during the translation phase
<%@ taglib ... %> Declares a tag library, containing custom actions, that is used in the page
<%@ attribute ... %> This directive can only be used in tag files. It declares the attributes the tag file supports
<%@ variable ... %>

This directive can be used only in tag files. It declares variables exposed by the tag file to the page where the corresponding custom action is used.


二、standard action elements
    action elements typically perform some action based on information that is rerequired at the excute time the JSP page is requested by a browser.An aciton can ,for instance, access parameters sent with the requst to do a database lookup.It can also dynamiclly generate HTML,such as a table filled with information retrieved from a external system. 

 Element

 Description

Makes a JavaBeans component available in a page
Gets a property value from a JavaBeans component and adds it to the response
Sets a JavaBeans component 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

三、custom action elements and JSTL
    In addition to the standard actions, the JSP specification defines how to develop custom actions to extend the JSP language,either as java classes or text files with JSP elements.The JSP Standard Tag Library(JSTL) is such an extension.

四、Scripting elements
    scripting elements allow you to add small pieces of code(typically java code) in a JSP page,such as if statement and so on.

 Element

 Description

<% ... %> Scriptlet, used to embed scripting code
<%= ... %> Expression, used to embed scripting code expressions when the result shall be added to the response; also used as request-time action attribute values
<%! ... %> Declaration, used to declare instance variables and methods in the JSP page implementation class

五、Expression Language expressions
   A new feature in JSP2.0 is the Expression Language(EL),originally developed as part of the JSTL specification

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