source: nutchez-0.1/tomcat/webapps/examples/jsp/num/numguess.jsp.html @ 108

Last change on this file since 108 was 66, checked in by waue, 15 years ago

NutchEz - an easy way to nutch

File size: 2.0 KB
Line 
1<html><body><pre>
2&lt;!--
3 Licensed to the Apache Software Foundation (ASF) under one or more
4  contributor license agreements.  See the NOTICE file distributed with
5  this work for additional information regarding copyright ownership.
6  The ASF licenses this file to You under the Apache License, Version 2.0
7  (the "License"); you may not use this file except in compliance with
8  the License.  You may obtain a copy of the License at
9
10      http://www.apache.org/licenses/LICENSE-2.0
11
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  See the License for the specific language governing permissions and
16  limitations under the License.
17
18  Number Guess Game
19  Written by Jason Hunter, CTO, K&amp;A Software
20  http://www.servlets.com
21-->
22
23&lt;%@ page import = "num.NumberGuessBean" %>
24
25&lt;jsp:useBean id="numguess" class="num.NumberGuessBean" scope="session"/>
26&lt;jsp:setProperty name="numguess" property="*"/>
27
28&lt;html>
29&lt;head>&lt;title>Number Guess&lt;/title>&lt;/head>
30&lt;body bgcolor="white">
31&lt;font size=4>
32
33&lt;% if (numguess.getSuccess()) { %>
34
35  Congratulations!  You got it.
36  And after just &lt;%= numguess.getNumGuesses() %> tries.&lt;p>
37
38  &lt;% numguess.reset(); %>
39
40  Care to &lt;a href="numguess.jsp">try again&lt;/a>?
41
42&lt;% } else if (numguess.getNumGuesses() == 0) { %>
43
44  Welcome to the Number Guess game.&lt;p>
45
46  I'm thinking of a number between 1 and 100.&lt;p>
47
48  &lt;form method=get>
49  What's your guess? &lt;input type=text name=guess>
50  &lt;input type=submit value="Submit">
51  &lt;/form>
52
53&lt;% } else { %>
54
55  Good guess, but nope.  Try &lt;b>&lt;%= numguess.getHint() %>&lt;/b>.
56
57  You have made &lt;%= numguess.getNumGuesses() %> guesses.&lt;p>
58
59  I'm thinking of a number between 1 and 100.&lt;p>
60
61  &lt;form method=get>
62  What's your guess? &lt;input type=text name=guess>
63  &lt;input type=submit value="Submit">
64  &lt;/form>
65
66&lt;% } %>
67
68&lt;/font>
69&lt;/body>
70&lt;/html>
71</pre></body></html>
Note: See TracBrowser for help on using the repository browser.