WebWork2教程(中文版)(4.1.1)
来源:互联网 发布:常德市优化办工作人员 编辑:程序博客网 时间:2024/06/11 18:22
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
4.1.1、WebWork UI标记
(1)创建表单
WebWork UI标记和HTML标记很相似,很容易从它的名字辨认出。你可以直接使用这些标记创建表单,和HTML标记的区别在于:参数使用双引号和单引号括起,这是因为要和Value Stack中的名字区分。看下面的例子:
ex01-index.jsp:
<%@ taglib uri="WebWork" prefix="ww" %>
<html>
<head>
<title>WebWork Tutorial - Lesson 4.1.1 - Example 1</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.errorMessage { color: red; }
</style>
</head>
<body>
<p>UI Form Tags Example:</p>
<ww:form action="'formProcessing.action'" method="'post'">
<ww:checkbox name="'checkbox'" label="'A checkbox'" fieldValue="'checkbox_value'" />
<ww:file name="'file'" label="'A file field'" />
<ww:hidden name="'hidden'" value="'hidden_value'" />
<ww:label label="'A label'" />
<ww:password name="'password'" label="'A password field'" />
<ww:radio name="'radio'" label="'Radio buttons'" list="{'One', 'Two', 'Three'}" />
<ww:select name="'select'" label="'A select list'" list="{'One', 'Two', 'Three'}"
emptyOption="true" />
<ww:textarea name="'textarea'" label="'A text area'" rows="'3'" cols="'40'" />
<ww:textfield name="'textfield'" label="'A text field'" />
<ww:submit value="'Send Form'" />
</ww:form>
</body>
</html>
经WebWork处理后的HTML结果如下:
<html>
<head>
<title>WebWork Tutorial - Lesson 4.1.1 - Example 1</title>
<style type="text/css">
.errorMessage { color: red; }
</style>
</head>
<body>
<p>UI Form Tags Example:</p>
<table>
<form action="formProcessing.action" method="post" >
<tr><td valign="top" colspan="2">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td valign="top">
<input type="checkbox" name="checkbox" value="checkbox_value" />
</td>
<td width="100%" valign="top">
<span class="checkboxLabel">
A checkbox
</span>
</td></tr>
</table>
</td></tr>
<tr><td align="right" valign="top">
<span class="label">
A file field:
</span>
</td>
<td>
<input type="file" name="file" />
</td></tr>
<input type="hidden" name="hidden" value="hidden_value" />
<tr><td align="right" valign="top">
<span class="label">
A label:
</span>
</td>
<td>
<label> </label>
</td></tr>
<tr><td align="right" valign="top">
<span class="label">
A password field:
</span>
</td>
<td>
<input type="password" name="password" />
</td></tr>
<tr><td align="right" valign="top">
<span class="label">
Radio buttons:
</span>
</td>
<td>
<input type="radio" name="radio" id="radioOne" value="One" />
<label for="radioOne">One</label>
<input type="radio" name="radio" id="radioTwo" value="Two" />
<label for="radioTwo">Two</label>
<input type="radio" name="radio" id="radioThree" value="Three" />
<label for="radioThree">Three</label>
</td></tr>
<tr><td align="right" valign="top">
<span class="label">
A select list:
</span>
</td>
<td>
<select name="select">
<option value=""></option>
<option value="One">One</option>
<option value="Two">Two</option>
<option value="Three">Three</option>
</select>
</td></tr>
<tr><td align="right" valign="top">
<span class="label">
A text area:
</span>
</td>
<td>
<textarea name="textarea" cols="40" rows="3" ></textarea>
</td></tr> <script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- WebWork2教程(中文版)(4.1.1)
- WebWork2教程(中文版)(4.1.1)
- WebWork2教程(中文版)(4.1.1)
- WebWork2教程(中文版)(4.1)
- WebWork2教程(中文版)(4.1)
- WebWork2教程(中文版)(4.1)
- WebWork2教程(中文版)(1)
- WebWork2教程(中文版)(1)
- WebWork2教程(中文版)(3)
- WebWork2教程(中文版)(4.2)
- WebWork2教程(中文版)(4.2)
- WebWork2教程(中文版)3
- WebWork2教程(中文版)(2)
- WebWork2教程(中文版)(5)(完)
- WebWork2教程(中文版)(2)
- WebWork2教程(中文版)(5)(完)
- WebWork2教程(中文版)补充-例子源代码下载
- WebWork2教程(中文版)(Interceptors)(http://www.chinaitpower.com/A/2002-04-14/19786.html)
- Web页面技术综述(包括fastm)
- Velocity用户指南(中文版)(1)
- Velocity用户指南(中文版)(2)
- 企业开发的发展趋势
- WebWork2教程(中文版)(2)
- WebWork2教程(中文版)(4.1.1)
- 四色着色的证明
- WebWork2教程(中文版)(5)(完)
- JAVA中通用JPEG缩影图Bean的制作与示例
- 我看《风柜来的人》
- IoC模式和factory method模式的一些区别
- TIJ3, tons of toys (2)
- CryptTool 封装了一些加密工具方法-实用
- 在WebWork中实现IoC(3)