form5.jsp

<%@ page contentType="text/html; charset=euc-jp" %>
<%@ page import="allaire.taglib.*" %>
<%@ taglib uri="jruntags" prefix="jrun" %>

<%
String color = ParameterUtil.getParameterWithEncoding(request, response, "s1");
if (color == null || color.length() == 0)
{
	color = "Yellow";
}
String myname = ParameterUtil.getParameterWithEncoding(request, response, "s2");
if (myname == null || color.length() == 0)
{
	myname = "Clement   ";
}
 
java.util.Hashtable h = new java.util.Hashtable();
h.put("Yellow","Yellow");
h.put("Blue","Blue");
h.put("Green","Green");
%>

<jrun:sql datasrc="taglib" id="rs">
SELECT name from ACCOUNTS
</jrun:sql>


<%@ include file="html/header.html" %>

<table width="100%" cellspacing="0" cellpadding="0">
<tr><td colspan="3"><b>FORM & SELECT タグ: オプションでのハッシュ表と結果セットの使用</b>( <a href="html/form5_jsp.html">ソースの表示</a> )
</td></tr></table>
 


<jrun:form method="get" name="form1" action="form5.jsp">
<table width="100%">
<tr>
<td valign="top">
カラー: <jrun:select name="s1" size="1" hashtable="<%= h %>" selected="<%= color %>">
</jrun:select><br>
</td>
<td valign="top">
名前: <jrun:select name="s2" size="1" query="page.rs" value="name" display="name" selected="<%= myname %>">
</jrun:select><br>
</td>
<td><input type="submit" value="送信"/></td>
</tr>
<tr><td>&nbsp;<br></td></tr>
<tr>
<td colspan="3" align="center" bgcolor=<%= color %>><%= myname %></td>
</tr>
</table>

<%
	String fromselect = request.getParameter("fromSelect");
	if ( fromselect == null || !fromselect.equals("true") )
	{
%>
<table>
<tr>
<td align="left" colspan="3">&nbsp;<br>
&nbsp;&nbsp;<font size="2"><a href="form4.jsp">戻る</a></font>
</td>
</tr>
</table>
<%
	}
	else
	{
%>
		<input type="hidden" name="fromSelect" value="<%= fromselect %>"></input>
<%
	}	
%>
</jrun:form>



<%@ include file="html/footer.html" %>