Samuel Learning

  • 联系
  •  
  • 管理

文章分类(203)

  • 01 ASP/HTML(6)
  • 02 Script/CSS(16)
  • 03 C/C++
  • 04 XML(4)
  • 05 微软编程(26)
  • 06 J2EE(60)
  • 09 Linux(14)
  • 10 Database(27)
  • 11 报表打印
  • 12 打包安装(1)
  • 13 模式重构(2)
  • 14 系统架构
  • 15 敏捷开发(11)
  • 16 案例分析(30)
  • 17 Workflow(1)
  • 18 配置管理(1)
  • 19 项目管理
  • 20 英语(4)

新闻分类(52)

  • CXF学习
  • Hibernate学习(1)
  • iBatis学习(16)
  • Struts1学习(1)
  • Struts2学习(34)

.NET资源

  • adxmenu
  • C# Open Source
  • DNN Directory
  • M2Land
  • Windows Form FAQ
  • 中国DNN
  • 中国DNN联盟

Ajax

  • DoJo
  • GWT
  • JQuery
  • jquery autocomplete
  • jquery flexgrid
  • JQuery Form
  • jquery masked input
  • JQuery UI
  • jquery validation
  • Jquery 图表
  • jquery报表
  • jquery插件集合
  • Qooxdoo
  • Tibco GI
  • YUI
  • YUI-EXT
  • ZeroKode

Java开源

  • ABLE
  • Agile Tao
  • Ajax4JSF
  • Alfresco
  • AppFuse
  • Compiere
  • Equinox
  • Findbugs
  • Geronimo
  • Grails
  • Harmony
  • Hibernate论坛
  • JAG
  • Java开源大全
  • Java视线论坛
  • jBPM工作流
  • JSFTutorials
  • Nereide ERP
  • Ofbiz ERP
  • Opentaps ERP
  • operamasks
  • Petstore
  • Prototype.js
  • RIFE
  • Runa
  • SpringSide
  • Struts Menu
  • Sun Glassfish
  • Trails
  • YUI4JSF
  • 满江红

Mobile

  • Sencha

WEB资源

  • DHTML中心
  • DHTML参考手册
  • DHTML文档
  • EclipsePlugin
  • Firebug
  • GRO Clinux
  • jMaki
  • JSTL文档
  • LoadIcon
  • Openlaszlo
  • Struts Menu 展示
  • Web Test Tools
  • WebCtrs
  • Webdeveloper
  • 中国RIA开发者论坛

Workflow

  • E-Workflow
  • JBPM
  • OpenWFE
  • OSWorkflow
  • WFMC
  • Workflow Research

其他连接

  • confach
  • CPP
  • ejay
  • Giovanni
  • 丹佛
  • 交大e-learning
  • 交大研究生院
  • 可恶的猫
  • 天天@blog
  • 我的相册
  • 阿飞

大牛人

  • 32篇JBPM
  • David.Turing
  • HongSoft@业务集成
  • Joel
  • Koen Aers
  • Martinfowler
  • Raible Matt
  • Raible Wiki
  • Scott W.Ambler
  • Tom Baeyens
  • Uncle Bob
  • 一个世界在等待
  • 子在川上曰
  • 小布老师
  • 小明
  • 差沙
  • 徐昊
  • 江南白衣
  • 汪博士
  • 汪小金
  • 银狐999

开源软件

  • 2Bizbox ERP
  • CompiereCRM&ERP
  • EGW
  • Vtiger CRM
  • webERP

敏捷

  • Canoo
  • Cruisecontrol
  • DBUnit
  • EL4Ant
  • Extreme Programming
  • Fit
  • Fitnesse
  • JFrog
  • Liquibase
  • Maven
  • MockObjects
  • Selenium
  • Squish
  • xpairtise
  • XPlanner
  • XProgramming
  • 敏捷联盟

数据库

  • Oracle 中国
  • Oracle-ERP
  • Oracle在线社区

未归类

  • Aquarius Orm Studio
  • mambo建站系统
  • Oracle产品下载
  • 远程同步管理工具Capivara

经典框架

  • Apache Shale
  • formdef-struts
  • FreeMarker 主页
  • JBoss Seam
  • JSF 中心
  • JSF 入门应用
  • JSF中国
  • MyFaces官方
  • Spring 社区
  • Spring专业网站
  • Spring中文论坛
  • Spring参考手册
  • Spring官方网站
  • strecks-struts
  • Struts1
  • Struts2
  • Struts-layout
  • StrutsWiKi
  • Tapestry WIKI
  • Tapestry 官方
  • Tapestry4开发指南
  • Tapestry中文文档
  • Webwork2文档
  • Wicket

网络教程

  • Laliluna
  • RoseIndia
  • Sang Shin
  • Visualbuilder

著名站点

  • Buildix
  • Dev2Dev
  • IBM dev中国
  • InfoQ
  • ITPub
  • Java Eye
  • Java Research
  • JavaRead
  • JavaWorldTW
  • Matrix
  • PHP100
  • PHPX
  • SpringSideWiKi
  • TheServerSide
  • TWPHP
  • 中国工作流论坛

项目管理

  • 管理人网

最新评论

View Post

Exercise -Struts-Examples1.3.8

 

Exercise -Struts-Examples1.3.8

l Bean:cookie

取得某个cookie的值

<bean:cookie id="sess" name="JSESSIONID" value="JSESSIONID-IS-UNDEFINED" />

获取名为“JSESSIONID”的cookie,并放入page范围内。

<bean:write name="sess" property="value" />

在页面上打印出cookie的属性

其他方式:

<jsp:getProperty name="sess" property="value" /> javabean标签

<%=((Cookie)(pageContext.getAttribute(“sess”))).getValue()%> pageContext方式

<%=sess.getValue()%> 变量取值的方式

l Bean:define

在page范围内定义一个变量,值从另一个对象的某个简单属性获取

<bean:define id="test1_long" name="test1" property="longProperty" />

可以通过bean:write,jsp:getProperty, <%=test1_long%> 获得定义变量的值

只从另一个嵌套对象的属性获取

<bean:define id="test2_boolean" name="test2" property="nested.booleanProperty" />

l Bean:header

从http请求头定义page范围的变量

<bean:header id="head" name=" Accept-Language"/>

l Bean:include

把一个page内容读入page范围内的一个变量

<bean:include id="welcome" page="/welcome.jsp" />

l Bean:parameter

将一个请求里的参数读入page范围内的一个变量,如果没有参数就抛异常JspException

<bean:parameter id="param1" name="param1"/>

l Bean:page

存储java的隐式对象到page范围内,隐式对象包括:pplication, config, request, response, or session

<bean:page id="cfg" property="config"/>

<bean:write name="cfg" property="servletName"/>

l Bean:resource

将web应用资源读入到page范围内。

<bean:resource id="webxml" name="/WEB-INF/web.xml" />

l Bean:size

将数组,集合,map的大小存入到page范围内

<bean:size id="stringSize" name="bean" property="stringArray" />

l Bean:struts

将struts配置对象,form,forward,mapping对象读入到page范围内

<bean:struts id="cfg" mapping="/search"/>

l Bean:write

渲染一个对象到页面

<bean:write name="test1.float" />

<bean:write name="test2" property="booleanProperty" />

<bean:write name="test3" property="intArray[1]"/>

<bean:write name="test5" property="nested.booleanProperty" />

<bean:write name="test7.double" format="#,000.00" />

<bean:write name="test7.date" formatKey="date.pattern" />

l html:cancel

输出<input type=”submit”>,会触发struts的cancel特征

<html:form action="/html-cancel-false">

            <html:submit property="submit"/>

            <html:reset/>

            <html:cancel/>

</html:form>

与下面action的cancellable属性有关

<action path="/html-cancel-false" name="testbean"

                input="/html-cancel.jsp" cancellable="false"validate="true" forward="/welcome.do">

validate为true时,cancellable必须为true,否则有异常

l html:img

输出<img>

<html:img page="/struts-power.gif" />

<html:img action="/html-img-action" />

<html:img page="/exercise/struts-power.gif" module="/"/>

l html:image

输出<input type=”image”>

<html:image page="/struts-power.gif" />

<html:image page="/struts-power.gif" module="/validator"/>

l html:link

输出<a>标签,由基本url加query string构成

<html:link action="/html-link-submit">No modifications at all</html:link>

<html:link action="/html-link-submit?doubleProperty=321.321&amp;longProperty=321321">Double and long via hard coded changes</html:link>

<html:link action="/html-link-submit" paramId="stringProperty" paramName="newValue">String via paramId and paramName</html:link>

<html:link action="/html-link-submit" paramId="booleanProperty" paramName="testbean" paramProperty="nested.booleanProperty">Boolean via paramId, paramName, and paramValue</html:link>

<html:link action="/html-link-submit" name="newValues">Float, int, and stringArray via name (Map)</html:link>

<html:link action="/html-link">

       No modifications at all, but link to the default module.

     </html:link>

<html:link action="/html-link?doubleProperty=321.321&amp;longProperty=321321"

                module="/exercise">

       Double and long via hard coded changes (module)

     </html:link>

<td colspan="4" align="center">

     <html:link action="/html-link"

             paramId="stringProperty" paramName="newValue">

       String via paramId and paramName

     </html:link>

<html:link action="/html-link"

             paramId="booleanProperty"

             paramName="testbean" paramProperty="nested.booleanProperty"

                module="/exercise">

       Boolean via paramId, paramName, and paramValue (module)

     </html:link>

<html:link action="/html-link"

                name="newValues">

       Float, int, and stringArray via name (Map)

     </html:link>

<html:link forward="relative">module welcome page</html:link>

<html:link action="/welcome" module="/">application welcome page (module="/")</html:link>

l html:multibox

输出<input type=”checkbox”>

<logic:iterate id="item" property="items">

 <html:multibox property="selectedItems">

    <bean:write name="item"/>

  </html:multibox>

 <bean:write name="item"/>

</logic:iterate>

l html:rewrite

输出url的字符串,但不做超链接

<html:rewrite href="http://www.yahoo.com/"

           paramId="query"

         paramName="queryObj"/>

l html:message

打印上下文里Globals.MESSAGE_KEY 对应的一个集合

<html:messages id="msg" property="category">

<li><bean:write name="msg"/></li>

</html:messages>

<html:messages id="msg">

<li><bean:write name="msg"/></li>

</html:messages>

l html:error

打印上下文里Globals.ERROR_KEY 对应的一个集合

<html:errors/>

<html:errors property="username"/>

l logic:equal notEqual

判断= !=

<logic:equal name="bean" property="booleanProperty" value="<%= bool1 %>">equal</logic:equal>

<logic:notEqual name="bean" property="booleanProperty" value="<%= bool1 %>">notEqual</logic:notEqual>

l logic:greaterEqual greaterThan lessEqual lessThan

判断>= > <= <

<logic:greaterEqual name="bean" property="stringProperty" value="<%= str1 %>">greaterEqual</logic:greaterEqual>

          <logic:greaterThan name="bean" property="stringProperty" value="<%= str1 %>">greaterThan</logic:greaterThan>

          <logic:lessEqual name="bean" property="stringProperty" value="<%= str1 %>">lessEqual</logic:lessEqual>

          <logic:lessThan name="bean" property="stringProperty" value="<%= str1 %>">lessThan</logic:lessThan>

l logic:empty notEmpty

判断是否为null或字符串长度为0

<logic:empty name="missingBean">empty</logic:empty>

<logic:notEmpty name="missingBean">notEmpty</logic:notEmpty>

l logic:forward redirect

两种不同的跳转页面方式

<logic:forward name="logic-forward" />

<logic:redirect action="/logic-forward"/>

<logic:redirect forward="logic-forward"/>

<logic:redirect page="/logic-forward.do"/>

注:如果是link的话,由action的forward元素的redirect属性决定

l logic:iterate

迭代一个数组或者集合

<logic:iterate id="element" name="bean" property="stringArray" indexId="index">

        <li>

        <em>

          <bean:write name="element" />

        </em> [

        <bean:write name="index" />]</li>

 </logic:iterate>

l logic:match notMatch

判断是否包含value值

<logic:match cookie="JSESSIONID" value="0">match</logic:match>

<logic:notMatch cookie="JSESSIONID" value="0">notMatch</logic:notMatch>

l logic:present notPresent

判断是否存在,运行包装的内容

<logic:present name="bean">present</logic:present>

<logic:notPresent name="bean">notPresent</logic:notPresent>

posted on 2008-07-11 08:04 MingIsMe 阅读(73) 评论(0)  编辑  收藏 所属分类: 16 案例分析

 
Powered by:
BlogJava
Copyright © MingIsMe