⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form.jsp

📁 jakarta-taglibs
💻 JSP
字号:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<!--
  Copyright (c) 2000 The Apache Software Foundation.  All rights reserved.
  Author: Shawn Bayern (shawn.bayern@oooo.com).
  Author: Lance Lavandowska (lance@brainopolis.com).

  This is a simple test of the "input" taglib.  The <form> defaults to
  GETting back to itself, which is convenient since you can see the
  values that the browser sends back as well as tamper with them and
  watch your changes get reflected on the form.

-->

<body bgcolor="#eeeeee">
<%@ taglib uri="http://jakarta.apache.org/taglibs/input-0.90" prefix="input" %>
<p>

<% 
java.util.Hashtable h = new java.util.Hashtable();
h.put("foo", "bar");
h.put("whee", "ding");
h.put("empty", ""); 
%>

<form>
<p>
Username:  <input:text name="username" attributes="<%= h %>" default="shawn" /><br />
Full Name: <input:text name="fullname" default="Shawn Bayern" />


<br />
<br />

Statement of purpose:
    <input:textarea 
        name="purpose"
        attributes="<%= h %>"
        default="none at this time" />

<br />
<br />

Choose one:

<br />
<br />

<% 
java.util.HashMap a = new java.util.HashMap();
// a.put("multiple", null);

java.util.Hashtable o = new java.util.Hashtable();
o.put("one", "1");
o.put("two", "2");
o.put("three", "3"); 
%>
<input:select name="choice" default="2" 
    attributes="<%= a %>" options="<%= o %>" />

<br />
<br />

<!-- the syntax for "defaults" for radio buttons and checkboxes seems
     more sensible when the different buttons or boxes are constructed
     automatically. it's still less tedious that having logic that
     outputs "checked" on each line, though.
 -->

Favorite letter?  &nbsp;&nbsp;&nbsp
<input:radio name="radio" value="a" default="a"/>a 
<input:radio name="radio" value="b" default="a"/>b
<input:radio name="radio" value="c" default="a"/>c
<input:radio name="radio" value="d" default="a"/>d

<br />
<br />

<% 
String[] defaults = new String[2];
defaults[0] = "2";
defaults[1] = "5";
%>

Numbers you don't mind: &nbsp;&nbsp;&nbsp
<input:checkbox name="checkbox" value="1" defaults="<%= defaults %>"/>1
<input:checkbox name="checkbox" value="2" defaults="<%= defaults %>"/>2
<input:checkbox name="checkbox" value="3" defaults="<%= defaults %>"/>3
<input:checkbox name="checkbox" value="4" defaults="<%= defaults %>"/>4
<input:checkbox name="checkbox" value="5" defaults="<%= defaults %>"/>5

<input type="submit" />

</p>
</form>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -