chap9-4.jsp
来自「该源码为JSP的开发案例集锦」· JSP 代码 · 共 38 行
JSP
38 行
<%@ 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 + =
减小字号Ctrl + -
显示快捷键?