polished jsps, webflow ide

This commit is contained in:
Keith Donald
2007-04-01 15:32:33 +00:00
parent 254aa48351
commit 54da554ea5
11 changed files with 166 additions and 96 deletions

View File

@@ -0,0 +1,5 @@
#Sun Apr 01 11:30:22 EDT 2007
eclipse.preferences.version=1
org.springframework.ide.eclipse.core.builders.enable.aopreferencemodelbuilder=true
org.springframework.ide.eclipse.core.builders.enable.beansvalidator=true
org.springframework.ide.eclipse.core.builders.enable.webflowvalidator=true

View File

@@ -4,6 +4,7 @@
<configExtension>xml</configExtension>
</configExtensions>
<configs>
<config>src/main/webapp/WEB-INF/dispatcher-servlet.xml</config>
</configs>
<configSets>
<configSet>
@@ -18,7 +19,6 @@
<allowBeanDefinitionOverriding>false</allowBeanDefinitionOverriding>
<incomplete>false</incomplete>
<configs>
<config>src/main/webapp/WEB-INF/dispatcher-servlet.xml</config>
</configs>
</configSet>
</configSets>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<webflow-project-description>
<configs>
<config>
<file>src/main/webapp/WEB-INF/mastermind.xml</file>
<name>mastermind</name>
</config>
<config>
<file>src/main/webapp/WEB-INF/higherlower.xml</file>
<name>higherlower</name>
</config>
</configs>
</webflow-project-description>

View File

@@ -1,4 +1,17 @@
<%@ include file="includeTop.jsp" %>
<%@ page contentType="text/html" %>
<%@ page session="false" %>
<html>
<head>
<title>HigherLower - Enter Guess</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<div id="logo">
<img src="images/spring-logo.jpg" alt="Logo">
</div>
<div id="content">
<div id="insert"><img src="images/webflow-logo.jpg"/></div>
@@ -31,4 +44,9 @@
</form>
</div>
<%@ include file="includeBottom.jsp" %>
<div id="copyright">
<p>&copy; Copyright 2004-2007, <a href="http://www.springframework.org">www.springframework.org</a>, under the terms of the Apache 2.0 software license.</p>
</div>
</body>
</html>

View File

@@ -1,29 +1,48 @@
<%@ include file="includeTop.jsp" %>
<%@ page contentType="text/html" %>
<%@ page session="false" %>
<html>
<head>
<title>HigherLower - You Guessed It!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<div id="logo">
<img src="images/spring-logo.jpg" alt="Logo">
</div>
<div id="content">
<div id="insert"><img src="images/webflow-logo.jpg"/></div>
<h2>You guessed it!</h2>
<table>
<tr>
<td>Answer:</td>
<td>${game.answer}</td>
</tr>
<tr>
<td>Total number of guesses:</td>
<td>${game.guesses}</td>
</tr>
<tr>
<td>Elapsed time in seconds:</td>
<td>${game.duration}</td>
</tr>
<tr>
<td colspan="2" class="buttonBar">
<form action="play.htm">
<input type="hidden" name="_flowId" value="higherlower">
<input type="submit" value="Play Again!">
</form>
</td>
</tr>
<tr>
<td>Answer:</td>
<td>${game.answer}</td>
</tr>
<tr>
<td>Total number of guesses:</td>
<td>${game.guesses}</td>
</tr>
<tr>
<td>Elapsed time in seconds:</td>
<td>${game.duration}</td>
</tr>
<tr>
<td colspan="2" class="buttonBar">
<form action="play.htm">
<input type="hidden" name="_flowId" value="higherlower">
<input type="submit" value="Play Again!">
</form>
</td>
</tr>
</table>
<%@ include file="includeBottom.jsp" %>
</div>
<div id="copyright">
<p>&copy; Copyright 2004-2007, <a href="http://www.springframework.org">www.springframework.org</a>, under the terms of the Apache 2.0 software license.</p>
</div>
</body>
</html>

View File

@@ -1,5 +0,0 @@
<div id="copyright">
<p>&copy; Copyright 2004-2007, <a href="http://www.springframework.org">www.springframework.org</a>, under the terms of the Apache 2.0 software license.</p>
</div>
</body>
</html>

View File

@@ -1,21 +0,0 @@
<%@ page contentType="text/html" %>
<%@ page session="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<html>
<head>
<title>Play a game</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<div id="logo">
<img src="images/spring-logo.jpg" alt="Logo">
</div>
<div id="navigation">
</div>

View File

@@ -1,4 +1,19 @@
<%@ include file="includeTop.jsp" %>
<%@ page contentType="text/html" %>
<%@ page session="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>Mastermind - Enter Guess</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<div id="logo">
<img src="images/spring-logo.jpg" alt="Logo">
</div>
<div id="content">
<div id="insert"><img src="images/webflow-logo.jpg"/></div>
@@ -8,8 +23,24 @@
<p>Note: each guess must be 4 unique digits!</p>
<p>Number of guesses so far: ${game.data.guesses}</p>
<%@include file="mastermind.guessHistoryTable.jsp" %>
<c:if test="${!empty game.guessHistory}">
<h4>Guess history:</h4>
<table border="1">
<tr>
<th>Guess</th>
<th>Right Position</th>
<th>Present But Wrong Position</th>
</tr>
<c:forEach var="guessData" items="${game.guessHistory}">
<tr>
<td>${guessData.guess}</td>
<td>${guessData.rightPosition}</td>
<td>${guessData.correctButWrongPosition}</td>
</tr>
</c:forEach>
</table>
</c:if>
<form name="guessForm" method="post">
<c:if test="${game.result == 'INVALID'}">
<div class="error">Your guess was invalid: it must be a 4 digit number (e.g 1234), and each digit must be unique.</div>
@@ -31,4 +62,9 @@
</form>
</div>
<%@ include file="includeBottom.jsp" %>
<div id="copyright">
<p>&copy; Copyright 2004-2007, <a href="http://www.springframework.org">www.springframework.org</a>, under the terms of the Apache 2.0 software license.</p>
</div>
</body>
</html>

View File

@@ -1,15 +0,0 @@
<c:if test="${!empty game.guessHistory}">
<h4>Guess history:</h4>
<table border="1">
<th>Guess</th>
<th>Right Position</th>
<th>Present But Wrong Position</th>
<c:forEach var="guessData" items="${game.guessHistory}">
<tr>
<td>${guessData.guess}</td>
<td>${guessData.rightPosition}</td>
<td>${guessData.correctButWrongPosition}</td>
</tr>
</c:forEach>
</table>
</c:if>

View File

@@ -1,28 +1,48 @@
<%@ include file="includeTop.jsp" %>
<%@ page contentType="text/html" %>
<%@ page session="false" %>
<html>
<head>
<title>Mastermind - You Guessed It!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<div id="logo">
<img src="images/spring-logo.jpg" alt="Logo">
</div>
<div id="content">
<div id="insert"><img src="images/webflow-logo.jpg"/></div>
<h2>Show answer</h2>
<table>
<tr>
<td>Total number of guesses:</td>
<td>${game.data.guesses}</td>
</tr>
<tr>
<td>Elapsed time in seconds:</td>
<td>${game.data.duration}</td>
</tr>
<tr>
<td>Answer:</td>
<td>${game.data.answer}</td>
</tr>
<tr>
<td colspan="2" class="buttonBar">
<form action="play.htm">
<input type="hidden" name="_flowId" value="mastermind">
<input type="submit" value="Play Again!">
</form>
</td>
</tr>
<tr>
<td>Total number of guesses:</td>
<td>${game.data.guesses}</td>
</tr>
<tr>
<td>Elapsed time in seconds:</td>
<td>${game.data.duration}</td>
</tr>
<tr>
<td>Answer:</td>
<td>${game.data.answer}</td>
</tr>
<tr>
<td colspan="2" class="buttonBar">
<form action="play.htm">
<input type="hidden" name="_flowId" value="mastermind">
<input type="submit" value="Play Again!">
</form>
</td>
</tr>
</table>
<%@ include file="includeBottom.jsp" %>
</div>
<div id="copyright">
<p>&copy; Copyright 2004-2007, <a href="http://www.springframework.org">www.springframework.org</a>, under the terms of the Apache 2.0 software license.</p>
</div>
</body>
</html>

View File

@@ -8,8 +8,8 @@
This Spring Web Flow (SWF) sample application illustrates:
<ul>
<li>
Use of stateful middle-tier components to carry out the execution of game business logic. It shows how to use SWF to
develop such components without coupling your application code to SWF APIs.
Use of stateful middle-tier components as flow variables to carry out the execution of business logic.
This sample shows how to use SWF to develop such components without coupling your application code to SWF APIs.
</li>
<li>
Use of custom state exception handlers to handle exceptions.
@@ -37,4 +37,4 @@
</DIV>
<HR>
</BODY>
</HTML>
</HTML>