📄 chap9-4.jsp
字号:
<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="ch9.BlueBean" %>
<HTML>
<HEAD>
<TITLE>猜猜看</TITLE>
</HEAD>
<BODY>
<jsp:useBean id="blueBean" class="ch9.BlueBean" scope="session"/>
<jsp:setProperty name="blueBean" property="*"/>
<table>
<tr>
<TD>目的颜色</TD>
<TD>所猜颜色</TD>
</tr>
<tr>
<td style="background-color:0000<%=Integer.toHexString(blueBean.getBlueColor())%>">目的颜色</td>
<td style="background-color:0000<%=Integer.toHexString(blueBean.getGuess())%>">所猜颜色</td>
</tr>
</table>
<%
if (blueBean.getSuccess()){
out.println("恭喜,猜对了!<p>");
blueBean.initAnswer();
out.println("<a herf=chap9-4.jsp>再猜不同的数字吗?</a>");
}
else{
%>
欢迎来玩猜颜色
<p>我想应该在<b><%=blueBean.getHintMsg()%></b><br>
<form method="get">
请输入猜测值:<input name="guess" type="text">
<input type="submit" value="确定">
</form>
<% }%>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -