您的位置:首页 >> 编程开发 >> Java >> Struts/Hibernate >> 正文
Struts/Hibernate RSS
 

Struts快速学习指南15(内部培训教材)-大部分素材来自于《ProgrammingJakartaStruts》一书

http://www.rdxx.com 06年12月15日 06:56 互联网 我要投稿

关键词: 指南 , 培训教材 , Struts , Jakarta , 学习 , 培训

1.1.1           form标签

Strutsform标签是最重要的标签之一,他包装了HTML的标准form标签,提供了将HTML formActionForm 连接起来的功能。

HTML form中的每一个域对应ActionForm的一个属性,当提交HTML from后,Struts根据匹配关系,将HTML from域的值赋给ActionForm的同名属性。下表列举了form标签的属性,并且针对每一个属性加以详细说明:

Struts form标签属性列表

Name

Description

action

form提交的目标地址,action用来选择一个Struts Action对提交后的客户请求进行处理。通过和action的path属性进行匹配来选择Struts Action

如果在web.xml中设置的servlet映射是扩展名映射,则可以用以下方式进行Action匹配(扩展名可以不作为匹配内容)

<html:form action="login.do" focus="accessNumber">

上面的语句表示form提交后,交给path属性值为loginAction进行处理

如果在web.xml中设置的servlet映射是路径映射,则action的值必须完全匹配Struts Actionpath属性值,例如:

<html:form action="login" focus="accessNumber">

enctype

提交form使用的编码方式

focus

页面初始化时光标定位的输入控件名

method

提交请求的HTTP方式(‘POST’ or ‘GET’)

name

对应的ActionForm的名字 ,如果不指定,则使用Struts Action在配置文件中name属性所指定的ActionForm

onreset

form重置时执行的Javascript

onsubmit

form提交时执行的javascript

scope

form对应的ActionForm的有效区域,可以为request session

style

CSS样式表The CSS styles to be applied to this HTML element.

styleClass

CSS样式类别

styleId

HTML元素的ID

target

form提交的目标frame

type

form对应的ActionForm的类名

 

1.2  Struts Logic标签

Struts Logic标签库中包含的标签列表

Tag name

Description

empty

如果标签parameterpropertie属性所指定的变量值为null或空字符串,则处理标签包含的内容

equal

如果标签parameterpropertie属性所指定的变量的值等于标签value属性所指定的值,则处理标签所包含的内容,如:

<logic:equal value="modify" property="action"  name="projectForm">

    <bean:message key="project.project_modify"/>

</logic:equal>

上面的示例表示,如果projectFormaction属性等于modify,则处理<bean:message key="project.project_modify"/>语句。

forward

Forward control to the page specified by the ActionForward entry.

greaterEqual

Evaluate the nested body content of this tag if the requested variable is greater than or equal to the specified value.

greaterThan

Evaluate the nested body content of this tag if the requested variable is greater than the specified value.

iterate

Repeat the nested body content of this tag over a specified collection.

lessEqual

Evaluate the nested body content of this tag if the requested variable is less than or equal to the specified value.

lessThan

Evaluate the nested body content of this tag if the requested variable is less than the specified value.

match

Evaluate the nested body content of this tag if the specified value is an appropriate substring of the requested variable.

messagesNotPresent

Generate the nested body content of this tag if the specified message is not present in this request.

messagesPresent

Generate the nested body content of this tag if the specified message is present in this request.

notEmpty

Evaluate the nested body content of this tag if the requested variable is neither null nor an empty string.

notEqual

Evaluate the nested body content of this tag if the requested variable is not equal to the specified value.

notMatch

Evaluate the nested body content of this tag if the specified value is not an appropriate substring of the requested variable.

notPresent

Generate the nested body content of this tag if the specified value is not present in this request.

present

Generate the nested body content of this tag if the specified value is present in this request.

redirect

Render an HTTP redirect.

共2页  第1页 第2页


 
 
标签: 指南 , 培训教材 , Struts , Jakarta , 学习 , 培训 打印本文
 
 
  热点搜索
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站