You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by jo...@apache.org on 2012/10/19 20:49:48 UTC
svn commit: r1400220 [6/9] - in /struts/struts2/trunk/apps/showcase: ./
src/main/java/org/apache/struts2/showcase/
src/main/java/org/apache/struts2/showcase/action/
src/main/java/org/apache/struts2/showcase/actionchaining/
src/main/java/org/apache/stru...
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/empmanager/listEmployees.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/empmanager/listEmployees.jsp?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/empmanager/listEmployees.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/empmanager/listEmployees.jsp Fri Oct 19 18:49:39 2012
@@ -1,26 +1,43 @@
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@taglib prefix="s" uri="/struts-tags" %>
<html>
-<head><title>Available Employees</title></head>
-
+<head>
+ <title>Struts2 Showcase - CRUD Example</title>
+</head>
<body>
-<h1>Available Employees</h1>
-<table>
- <tr>
- <th>Id</th>
- <th>First Name</th>
- <th>Last Name</th>
- </tr>
- <s:iterator value="availableItems">
- <tr>
- <td><a href="<s:url action="edit-%{empId}" />"><s:property value="empId"/></a></td>
- <td><s:property value="firstName"/></td>
- <td><s:property value="lastName"/></td>
- </tr>
- </s:iterator>
-</table>
-<p><a href="<s:url action="edit-" includeParams="none"/>">Create new Employee</a></p>
-<p><a href="<s:url action="showcase" namespace="/" includeParams="none"/>">Back to Showcase Startpage</a></p>
+<div class="page-header">
+ <h1>Available Employees</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span3">
+ <ul class="nav nav-tabs nav-stacked">
+ <li class="active"><s:url var="url" namespace="/employee" action="list"/><s:a href="%{url}">List available Employees</s:a></li>
+ <li><s:url var="url" namespace="/employee" action="edit"/><s:a href="%{url}">Create/Edit Employee</s:a></li>
+ <li><s:url var="url" namespace="/skill" action="list"/><s:a href="%{url}">List available Skills</s:a></li>
+ <li><s:url var="url" namespace="/skill" action="edit"/><s:a href="%{url}">Create/Edit Skill</s:a></li>
+ </ul>
+ </div>
+ <div class="span9">
+
+ <table class="table table-striped table-bordered table-hover table-condensed">
+ <tr>
+ <th>Id</th>
+ <th>First Name</th>
+ <th>Last Name</th>
+ </tr>
+ <s:iterator value="availableItems">
+ <tr>
+ <td><a href="<s:url action="edit-%{empId}" />"><s:property value="empId"/></a></td>
+ <td><s:property value="firstName"/></td>
+ <td><s:property value="lastName"/></td>
+ </tr>
+ </s:iterator>
+
+ </table>
+ <a href="<s:url action="edit-" includeParams="none"/>" class="btn btn-primary">Create new Employee</a>
+ </div>
+ </div>
+</div>
</body>
</html>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/empmanager/listSkills.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/empmanager/listSkills.jsp?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/empmanager/listSkills.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/empmanager/listSkills.jsp Fri Oct 19 18:49:39 2012
@@ -1,24 +1,41 @@
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@taglib prefix="s" uri="/struts-tags" %>
<html>
-<head><title>Available Skills</title></head>
-
+<head>
+ <title>Struts2 Showcase - CRUD Example</title>
+</head>
<body>
-<h1>Available Skills</h1>
-<table>
- <tr>
- <th>Name</th><th>Description</th>
- </tr>
- <s:iterator value="availableItems">
- <tr>
- <td><a href="<s:url action="edit"><s:param name="skillName" value="name"/></s:url>"><s:property value="name"/></a></td>
- <td><s:property value="description"/></td>
- </tr>
- </s:iterator>
-</table>
-<!-- Although namescape not correctly specified, the following link should find the right action -->
-<p><a href="<s:url action="edit" includeParams="none"/>">Create new Skill</a></p>
-<p><a href="<s:url action="showcase" namespace="/" includeParams="none"/>">Back to Showcase Startpage</a></p>
+<div class="page-header">
+ <h1>Available Skills</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span3">
+ <ul class="nav nav-tabs nav-stacked">
+ <li><s:url var="url" namespace="/employee" action="list"/><s:a href="%{url}">List available Employees</s:a></li>
+ <li><s:url var="url" namespace="/employee" action="edit"/><s:a href="%{url}">Create/Edit Employee</s:a></li>
+ <li class="active"><s:url var="url" namespace="/skill" action="list"/><s:a href="%{url}">List available Skills</s:a></li>
+ <li><s:url var="url" namespace="/skill" action="edit"/><s:a href="%{url}">Create/Edit Skill</s:a></li>
+ </ul>
+ </div>
+ <div class="span9">
+
+ <table class="table table-striped table-bordered table-hover table-condensed">
+ <tr>
+ <th>Name</th><th>Description</th>
+ </tr>
+ <s:iterator value="availableItems">
+ <tr>
+ <td><a href="<s:url action="edit"><s:param name="skillName" value="name"/></s:url>"><s:property value="name"/></a></td>
+ <td><s:property value="description"/></td>
+ </tr>
+ </s:iterator>
+ </table>
+
+ <a href="<s:url action="edit" includeParams="none"/>" class="btn btn-primary">Create new Skill</a>
+ </div>
+ </div>
+</div>
</body>
</html>
+
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/filedownload/index.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/filedownload/index.jsp?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/filedownload/index.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/filedownload/index.jsp Fri Oct 19 18:49:39 2012
@@ -1,23 +1,36 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
- <title>Showcase - Fileupload</title>
+ <title>Struts2 Showcase - File Download</title>
</head>
<body>
- <h1>File Download Example</h1>
+ <div class="page-header">
+ <h1>File Download Example</h1>
+ </div>
- <ul>
- <li>
- <s:url var="url" action="download"/><s:a href="%{url}">Download image file.</s:a>
- The browser should display the Struts logo.
- </li>
- <li>
- <s:url var="url" action="download2"/><s:a href="%{url}">Download ZIP file.</s:a>
- The browser should prompt for a location to save the ZIP file.
- </li>
- </ul>
+
+ <div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span6" style="text-align: center;">
+ <div class="alert alert-info">
+ The browser should display the Struts logo.
+ </div>
+
+ <s:url var="url" action="download"/>
+ <s:a href="%{url}" cssClass="btn btn-large btn-info"><i class="icon-picture"></i> Download image file.</s:a>
+ </div>
+ <div class="span6" style="text-align: center;">
+ <div class="alert alert-info">
+ The browser should prompt for a location to save the ZIP file.
+ </div>
+
+ <s:url var="url" action="download2"/>
+ <s:a href="%{url}" cssClass="btn btn-large btn-info"><i class="icon-download-alt"></i> Download ZIP file.</s:a>
+ </div>
+ </div>
+ </div>
</body>
</html>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/fileupload/multipleUploadUsingArray.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/fileupload/multipleUploadUsingArray.jsp?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/fileupload/multipleUploadUsingArray.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/fileupload/multipleUploadUsingArray.jsp Fri Oct 19 18:49:39 2012
@@ -1,20 +1,32 @@
-<%@ page
- language="java"
- contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
+<%@ page
+ language="java"
+ contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
-<title>Showcase - fileupload - multiple fileupload using List</title>
+ <title>Struts2 Showcase - Fileupload sample - Multiple fileupload using Array</title>
</head>
+
<body>
+<div class="page-header">
+ <h1>Fileupload sample - Multiple fileupload using Array</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <s:form action="doMultipleUploadUsingArray" method="POST" enctype="multipart/form-data">
+ <s:file label="File (1)" name="upload" />
+ <s:file label="File (2)" name="upload" />
+ <s:file label="FIle (3)" name="upload" />
+ <s:submit cssClass="btn btn-primary"/>
+ </s:form>
-<s:form action="doMultipleUploadUsingArray" method="POST" enctype="multipart/form-data">
- <s:file label="File (1)" name="upload" />
- <s:file label="File (2)" name="upload" />
- <s:file label="FIle (3)" name="upload" />
- <s:submit />
-</s:form>
+ </div>
+ </div>
+</div>
</body>
</html>
\ No newline at end of file
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/fileupload/multipleUploadUsingList.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/fileupload/multipleUploadUsingList.jsp?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/fileupload/multipleUploadUsingList.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/fileupload/multipleUploadUsingList.jsp Fri Oct 19 18:49:39 2012
@@ -5,16 +5,28 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
-<title>Showcase - fileupload - multiple fileupload using List</title>
+ <title>Struts2 Showcase - Fileupload sample - Multiple fileupload using List</title>
</head>
+
<body>
+<div class="page-header">
+ <h1>Fileupload sample - Multiple fileupload using List</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <s:form action="doMultipleUploadUsingList" method="POST" enctype="multipart/form-data">
+ <s:file label="File (1)" name="upload" />
+ <s:file label="File (2)" name="upload" />
+ <s:file label="FIle (3)" name="upload" />
+ <s:submit cssClass="btn btn-primary"/>
+ </s:form>
-<s:form action="doMultipleUploadUsingList" method="POST" enctype="multipart/form-data">
- <s:file label="File (1)" name="upload" />
- <s:file label="File (2)" name="upload" />
- <s:file label="FIle (3)" name="upload" />
- <s:submit />
-</s:form>
+ </div>
+ </div>
+</div>
</body>
</html>
\ No newline at end of file
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/fileupload/upload-success.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/fileupload/upload-success.jsp?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/fileupload/upload-success.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/fileupload/upload-success.jsp Fri Oct 19 18:49:39 2012
@@ -5,20 +5,26 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
- <title>Showcase</title>
+ <title>Struts2 Showcase - Fileupload sample</title>
</head>
<body>
-<h1>Fileupload sample</h1>
+<div class="page-header">
+ <h1>Fileupload sample</h1>
+</div>
-<p>
- <ul>
- <li>ContentType: <s:property value="uploadContentType" /></li>
- <li>FileName: <s:property value="uploadFileName" /></li>
- <li>File: <s:property value="upload" /></li>
- <li>Caption:<s:property value="caption" /></li>
- </ul>
-</p>
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+ <ul>
+ <li>ContentType: <s:property value="uploadContentType" /></li>
+ <li>FileName: <s:property value="uploadFileName" /></li>
+ <li>File: <s:property value="upload" /></li>
+ <li>Caption:<s:property value="caption" /></li>
+ </ul>
+ </div>
+ </div>
+</div>
</body>
</html>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/fileupload/upload.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/fileupload/upload.jsp?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/fileupload/upload.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/fileupload/upload.jsp Fri Oct 19 18:49:39 2012
@@ -1,23 +1,27 @@
-<%@ page
- language="java"
- contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
- <title>Showcase</title>
+ <title>Struts2 Showcase - Fileupload sample</title>
</head>
<body>
- <h1>Fileupload sample</h1>
+ <div class="page-header">
+ <h1>Fileupload sample</h1>
+ </div>
- <s:actionerror />
- <s:fielderror />
- <s:form action="doUpload" method="POST" enctype="multipart/form-data">
- <s:file name="upload" label="File"/>
- <s:textfield name="caption" label="Caption"/>
- <s:submit />
- </s:form>
+ <div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+ <s:actionerror cssClass="alert alert-error"/>
+ <s:fielderror cssClass="alert alert-error"/>
+ <s:form action="doUpload" method="POST" enctype="multipart/form-data">
+ <s:file name="upload" label="File"/>
+ <s:textfield name="caption" label="Caption"/>
+ <s:submit cssClass="btn btn-primary"/>
+ </s:form>
+ </div>
+ </div>
+ </div>
</body>
</html>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/freemarker/customFreemarkerManagerUsage.ftl
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/freemarker/customFreemarkerManagerUsage.ftl?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/freemarker/customFreemarkerManagerUsage.ftl (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/freemarker/customFreemarkerManagerUsage.ftl Fri Oct 19 18:49:39 2012
@@ -1,12 +1,18 @@
-
<html>
<head>
- <title>Showcase - Freemarker - CustomFreemarkerManager Usage</title>
+ <title>Struts2 Showcase - Freemarker - CustomFreemarkerManager Usage</title>
</head>
<body>
+
+<div class="page-header">
<h1>Custom Freemarker Manager Usage</h1>
-
- <p/>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <p>
This page shows a simple example of using a custom freemarker manager.
The custom freemarker manager put into freemarker model an util classed
under the name 'customFreemarkerManagerUtil'. so one could use
@@ -20,7 +26,9 @@
Today's Date = <span id="todaysDate">${customFreemarkerManagerUtil.todayDate}</span><br/>
Time now = <span id="timeNow">${customFreemarkerManagerUtil.getTimeNow()}</span><br/>
-
+ </div>
+ </div>
+</div>
</body>
</html>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/freemarker/index.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/freemarker/index.jsp?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/freemarker/index.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/freemarker/index.jsp Fri Oct 19 18:49:39 2012
@@ -1,24 +1,3 @@
-
-<%@taglib prefix="s" uri="/struts-tags" %>
-
-<html>
-<head>
- <title>Showcase - Freemarker</title>
-</head>
-<body>
-
- <ul>
- <li>
- <s:url var="url" action="customFreemarkerManagerDemo" namespace="/freemarker" />
- <s:a href="%{#url}">Demo of usage of a Custom Freemarker Manager</s:a>
- </li>
- <li>
- <s:url var="url" action="standardTags" namespace="/freemarker" />
- <s:a href="%{#url}">Demo of Standard Struts Freemarker Tags</s:a>
- </li>
- </ul>
-
-</body>
-</html>
+<% response.sendRedirect("/freemarker/customFreemarkerManagerDemo.action"); %>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/freemarker/standardTags.ftl
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/freemarker/standardTags.ftl?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/freemarker/standardTags.ftl (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/freemarker/standardTags.ftl Fri Oct 19 18:49:39 2012
@@ -1,4 +1,24 @@
-<@s.form action="test">
- <@s.textfield label="Name" name="name"/>
- <@s.select label="Birth Month" headerValue="Select Month" list="months" />
-</...@s.form>
\ No newline at end of file
+<html>
+<head>
+ <title>Struts2 Showcase - Freemarker - Standard Struts Freemarker Tags</title>
+</head>
+<body>
+
+<div class="page-header">
+ <h1>Standard Struts Freemarker Tags</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <@s.form action="test">
+ <@s.textfield label="Name" name="name"/>
+ <@s.select label="Birth Month" headerValue="Select Month" list="months" />
+ </...@s.form>
+
+ </div>
+ </div>
+</div>
+</body>
+</html>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/hangman/hangmanAjax.ftl
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/hangman/hangmanAjax.ftl?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/hangman/hangmanAjax.ftl (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/hangman/hangmanAjax.ftl Fri Oct 19 18:49:39 2012
@@ -1,237 +1,246 @@
-
<html>
<head>
- <title>Showcase - Hangman</title>
- <@sx.head />
+ <title>Struts2 Showcase - Hangman (AJAX)</title>
+<@sx.head />
</head>
<body>
-
-<script>
- function destroyWidgets() {
- var div = dojo.byId("updateCharacterAvailableDiv");
- var anchors = div.getElementsByTagName("a");
- dojo.lang.forEach(anchors, function(anchor){
- var widget = dojo.widget.byId(anchor);
- widget.destroy();
- });
- }
-
- var _listeners = {
- guessMade: function(request, widget) {
- var sourceId = widget.widgetId;
- this.guessMadeFunc(sourceId);
- this.updateCharacterAvailable(sourceId);
- this.updateVocab(sourceId);
- this.updateScaffold(sourceId);
- this.updateGuessLeft(sourceId);
- },
- guessMadeFunc: function(sourceId) {
- var requestAttr = { character: sourceId };
+<div class="page-header">
+ <h1>Hangman</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <script>
+ function destroyWidgets() {
+ var div = dojo.byId("updateCharacterAvailableDiv");
+ var anchors = div.getElementsByTagName("a");
+ dojo.lang.forEach(anchors, function (anchor) {
+ var widget = dojo.widget.byId(anchor);
+ widget.destroy();
+ });
+ }
+
+ var _listeners = {
+ guessMade:function (request, widget) {
+ var sourceId = widget.widgetId;
+ this.guessMadeFunc(sourceId);
+ this.updateCharacterAvailable(sourceId);
+ this.updateVocab(sourceId);
+ this.updateScaffold(sourceId);
+ this.updateGuessLeft(sourceId);
+ },
+ guessMadeFunc:function (sourceId) {
+ var requestAttr = { character:sourceId };
dojo.io.bind({
- url: "<@s.url action="guessCharacter" namespace="/hangman" />",
- load: function(type, data, event) {
+ url:"<@s.url action="guessCharacter" namespace="/hangman" />",
+ load:function (type, data, event) {
},
- mimetype: "text/html",
- content: requestAttr
+ mimetype:"text/html",
+ content:requestAttr
});
- },
- updateCharacterAvailable: function(sourceId) {
- dojo.io.bind({
- url: "<@s.url action="updateCharacterAvailable" namespace="/hangman/ajax" />",
- load: function(type, data, event) {
- var div = dojo.byId("updateCharacterAvailableDiv");
- destroyWidgets();
- div.innerHTML = data;
-
- try{
- var xmlParser = new dojo.xml.Parse();
- var frag = xmlParser.parseElement(div, null, true);
- dojo.widget.getParser().createComponents(frag);
- // eval any scripts being returned
- var scripts = div.getElementsByTagName('script');
- for (var i=0; i<scripts.length; i++) {
- eval(scripts[i].innerHTML);
- }
- }
- catch(e){
- alert('dojo error '+e);
- dojo.debug("auto-build-widgets error: "+e);
- }
- },
- mimetype: "text/html"
- });
- },
- updateVocab: function(sourceId) {
- dojo.io.bind({
- url: "<@s.url action="updateVocabCharacters" namespace="/hangman/ajax" />",
- load: function(type, data, event) {
- var div = dojo.byId("updateVocabDiv");
- div.innerHTML = data;
-
- try {
- var xmlParser = new dojo.xml.Parse();
- var frag = xmlParser.parseElement(div, null, true);
-
- var scripts = div.getElementsByTagName("script");
- for(var i=0; i<scripts.length; i++) {
- eval(scripts[i].innerHTML);
- }
- }
- catch(e) {
- alert("dojo error"+e);
- dojo.debug("auto-build-widgets error: "+e);
- }
- },
- mimetype: "text/html"
- });
- },
- updateScaffold: function(sourceId) {
- dojo.io.bind({
- url: "<@s.url action="updateScaffold" namespace="/hangman/ajax" />",
- load: function(type, data, event) {
- var div = dojo.byId("updateScaffoldDiv");
- div.innerHTML = data;
-
- try {
- var xmlParser = new dojo.xml.Parse();
- var frag = xmlParser.parseElement(div, null, true);
-
- var scripts = div.getElementsByTagName("script");
- for(var i=0; i<scripts.length; i++) {
- eval(scripts[i].innerHTML);
- }
- }
- catch(e) {
- alert("dojo error"+e);
- dojo.debug("auto-build-widgets error: "+e);
- }
- },
- mimetype: "text/html"
- });
- },
- updateGuessLeft: function(sourceId) {
- dojo.io.bind({
- url: "<@s.url action="updateGuessLeft" namespace="/hangman/ajax" />",
- load: function(type, data, event) {
- var div = dojo.byId("updateGuessLeftDiv");
- div.innerHTML = data;
-
- try {
- var xmlParser = new dojo.xml.Parse();
- var frag = xmlParser.parseElement(div, null, true);
-
- var scripts = div.getElementsByTagName("script");
- for(var i=0; i<scripts.length; i++) {
- eval(scripts[i].innerHTML);
- }
- }
- catch(e) {
- alert("dojo error"+e);
- dojo.debug("auto-build-widgets error: "+e);
- }
- },
- mimetype: "text/html"
- });
- }
- };
- dojo.event.topic.subscribe("topicGuessMade", _listeners, "guessMade");
-</script>
-
-<table bgcolor="green">
- <tr>
- <td>
- <@s.url id="url" value="/hangman/images/hangman.png" />
- <img alt="Hangman" src="<@s.property value="%{#url}" />"
- width="197" height="50" border="0"/>
- </td>
- <td width="70" align="right">
- <#-- Guesses Left -->
- <div id="updateGuessLeftDiv">
- <@s.set name="guessLeftImageName" value="%{'Chalkboard_'+hangman.guessLeft()+'.png'}" />
- <@s.url id="url" value="%{'/hangman/images/'+#guessLeftImageName}" />
- <img alt="No. Guesses Left"
- src="<@s.property value="%{#url}"/>" width="20" height="20" border="0" />
- </div>
- </td>
- <td>
- <@s.url id="url" value="/hangman/images/guesses-left.png" />
- <img alt="Guesses Left"
- src="<@s.property value="%{#url}" />" width="164" height="11" border="0"/>
- </td>
- </tr>
- <tr>
- <td></td>
- <td align="left">
- <#-- Display Scaffold -->
- <div id="updateScaffoldDiv">
- <@s.set name="scaffoldImageName" value="%{'scaffold_'+hangman.guessLeft()+'.png'}" />
- <@s.url id="url" value="%{'/hangman/images/'+#scaffoldImageName}" />
- <img src="<@s.property value="%{#url}" />" border="0"/>
- </div>
- </td>
- <td></td>
- </tr>
- <tr>
- <td width="160">
- <p align="right">
- <@s.url id="url" value="/hangman/images/guess.png" />
- <img alt="Current Guess" src="<@s.property value="%{#url}" />"
- align="MIDDLE" width="127" height="20" border="0"/></p>
- </td>
- <td>
- <#-- Display Vacab -->
- <div id="updateVocabDiv">
- <@s.iterator id="currentCharacter" value="%{hangman.vocab.inCharacters()}" stat="stat">
- <#if hangman.characterGuessedBefore(currentCharacter)>
- <@s.set name="chalkboardImageName" value="%{'Chalkboard_'+#currentCharacter.toString()+'.png'}" />
- <@s.url id="url" value="%{'/hangman/images/'+#chalkboardImageName}" />
- <img height="36" alt="<@s.property value="%{#currentCharacter}" />"
- src="<@s.property value="%{#url}" />" width="36" border="0"/>
- <#else>
- <@s.url id="url" value="/hangman/images/Chalkboard_underscroll.png" />
- <img height="36" alt="_"
- src="<@s.property value="%{#url}" />" width="36" border="0"/>
- </#if>
- </...@s.iterator>
- </div>
- </td>
- </tr>
- <tr>
- <td valign="top">
- <p align="right">
- <@s.url id="url" value="/hangman/images/choose.png" />
- <img alt="Choose" src="<@s.property value="%{#url}" />"
- height="20" width="151" border="0"/>
- </p>
- </td>
- <td width="330">
-
- <#-- Show Characters Available -->
- <div id="updateCharacterAvailableDiv">
- <@s.iterator id="currentCharacter" value="%{hangman.charactersAvailable}" status="stat">
- <@s.set name="chalkboardImageName" value="%{'Chalkboard_'+#currentCharacter+'.png'}" />
- <@s.url id="chalkboardImageUrl" value="%{'/hangman/images/'+#chalkboardImageName}" />
- <@s.url id="spacerUrl" value="/hangman/images/letter-spacer.png" />
-
- <@s.url id="blankUrl" value="ajax/blank.action" includeContext="false" />
- <@sx.a id="%{#currentCharacter}"
- beforeNotifyTopics="topicGuessMade"
- showErrorTransportText="true">
- <img height="36" alt="" src="<@s.property value="%{#chalkboardImageUrl}" />" width="36" border="0" />
- </...@sx.a>
- </...@s.iterator>
+ },
+ updateCharacterAvailable:function (sourceId) {
+ dojo.io.bind({
+ url:"<@s.url action="updateCharacterAvailable" namespace="/hangman/ajax" />",
+ load:function (type, data, event) {
+ var div = dojo.byId("updateCharacterAvailableDiv");
+ destroyWidgets();
+ div.innerHTML = data;
+
+ try {
+ var xmlParser = new dojo.xml.Parse();
+ var frag = xmlParser.parseElement(div, null, true);
+ dojo.widget.getParser().createComponents(frag);
+ // eval any scripts being returned
+ var scripts = div.getElementsByTagName('script');
+ for (var i = 0; i < scripts.length; i++) {
+ eval(scripts[i].innerHTML);
+ }
+ }
+ catch (e) {
+ alert('dojo error ' + e);
+ dojo.debug("auto-build-widgets error: " + e);
+ }
+ },
+ mimetype:"text/html"
+ });
+ },
+ updateVocab:function (sourceId) {
+ dojo.io.bind({
+ url:"<@s.url action="updateVocabCharacters" namespace="/hangman/ajax" />",
+ load:function (type, data, event) {
+ var div = dojo.byId("updateVocabDiv");
+ div.innerHTML = data;
+
+ try {
+ var xmlParser = new dojo.xml.Parse();
+ var frag = xmlParser.parseElement(div, null, true);
+
+ var scripts = div.getElementsByTagName("script");
+ for (var i = 0; i < scripts.length; i++) {
+ eval(scripts[i].innerHTML);
+ }
+ }
+ catch (e) {
+ alert("dojo error" + e);
+ dojo.debug("auto-build-widgets error: " + e);
+ }
+ },
+ mimetype:"text/html"
+ });
+ },
+ updateScaffold:function (sourceId) {
+ dojo.io.bind({
+ url:"<@s.url action="updateScaffold" namespace="/hangman/ajax" />",
+ load:function (type, data, event) {
+ var div = dojo.byId("updateScaffoldDiv");
+ div.innerHTML = data;
+
+ try {
+ var xmlParser = new dojo.xml.Parse();
+ var frag = xmlParser.parseElement(div, null, true);
+
+ var scripts = div.getElementsByTagName("script");
+ for (var i = 0; i < scripts.length; i++) {
+ eval(scripts[i].innerHTML);
+ }
+ }
+ catch (e) {
+ alert("dojo error" + e);
+ dojo.debug("auto-build-widgets error: " + e);
+ }
+ },
+ mimetype:"text/html"
+ });
+ },
+ updateGuessLeft:function (sourceId) {
+ dojo.io.bind({
+ url:"<@s.url action="updateGuessLeft" namespace="/hangman/ajax" />",
+ load:function (type, data, event) {
+ var div = dojo.byId("updateGuessLeftDiv");
+ div.innerHTML = data;
+
+ try {
+ var xmlParser = new dojo.xml.Parse();
+ var frag = xmlParser.parseElement(div, null, true);
+
+ var scripts = div.getElementsByTagName("script");
+ for (var i = 0; i < scripts.length; i++) {
+ eval(scripts[i].innerHTML);
+ }
+ }
+ catch (e) {
+ alert("dojo error" + e);
+ dojo.debug("auto-build-widgets error: " + e);
+ }
+ },
+ mimetype:"text/html"
+ });
+ }
+ };
+ dojo.event.topic.subscribe("topicGuessMade", _listeners, "guessMade");
+ </script>
+
+ <table bgcolor="green">
+ <tr>
+ <td>
+ <@s.url id="url" value="/hangman/images/hangman.png" />
+ <img alt="Hangman" src="<@s.property value="%{#url}" />"
+ width="197" height="50" border="0"/>
+ </td>
+ <td width="70" align="right">
+ <#-- Guesses Left -->
+ <div id="updateGuessLeftDiv">
+ <@s.set name="guessLeftImageName" value="%{'Chalkboard_'+hangman.guessLeft()+'.png'}" />
+ <@s.url id="url" value="%{'/hangman/images/'+#guessLeftImageName}" />
+ <img alt="No. Guesses Left"
+ src="<@s.property value="%{#url}"/>" width="20" height="20" border="0"/>
+ </div>
+ </td>
+ <td>
+ <@s.url id="url" value="/hangman/images/guesses-left.png" />
+ <img alt="Guesses Left"
+ src="<@s.property value="%{#url}" />" width="164" height="11" border="0"/>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td align="left">
+ <#-- Display Scaffold -->
+ <div id="updateScaffoldDiv">
+ <@s.set name="scaffoldImageName" value="%{'scaffold_'+hangman.guessLeft()+'.png'}" />
+ <@s.url id="url" value="%{'/hangman/images/'+#scaffoldImageName}" />
+ <img src="<@s.property value="%{#url}" />" border="0"/>
+ </div>
+ </td>
+ <td></td>
+ </tr>
+ <tr>
+ <td width="160">
+ <p align="right">
+ <@s.url id="url" value="/hangman/images/guess.png" />
+ <img alt="Current Guess" src="<@s.property value="%{#url}" />"
+ align="MIDDLE" width="127" height="20" border="0"/></p>
+ </td>
+ <td>
+ <#-- Display Vacab -->
+ <div id="updateVocabDiv">
+ <@s.iterator id="currentCharacter" value="%{hangman.vocab.inCharacters()}" stat="stat">
+ <#if hangman.characterGuessedBefore(currentCharacter)>
+ <@s.set name="chalkboardImageName" value="%{'Chalkboard_'+#currentCharacter.toString()+'.png'}" />
+ <@s.url id="url" value="%{'/hangman/images/'+#chalkboardImageName}" />
+ <img height="36" alt="<@s.property value="%{#currentCharacter}" />"
+ src="<@s.property value="%{#url}" />" width="36" border="0"/>
+ <#else>
+ <@s.url id="url" value="/hangman/images/Chalkboard_underscroll.png" />
+ <img height="36" alt="_"
+ src="<@s.property value="%{#url}" />" width="36" border="0"/>
+ </#if>
+ </...@s.iterator>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">
+ <p align="right">
+ <@s.url id="url" value="/hangman/images/choose.png" />
+ <img alt="Choose" src="<@s.property value="%{#url}" />"
+ height="20" width="151" border="0"/>
+ </p>
+ </td>
+ <td width="330">
+
+ <#-- Show Characters Available -->
+ <div id="updateCharacterAvailableDiv">
+ <@s.iterator id="currentCharacter" value="%{hangman.charactersAvailable}" status="stat">
+ <@s.set name="chalkboardImageName" value="%{'Chalkboard_'+#currentCharacter+'.png'}" />
+ <@s.url id="chalkboardImageUrl" value="%{'/hangman/images/'+#chalkboardImageName}" />
+ <@s.url id="spacerUrl" value="/hangman/images/letter-spacer.png" />
+
+ <@s.url id="blankUrl" value="ajax/blank.action" includeContext="false" />
+ <@sx.a id="%{#currentCharacter}"
+ beforeNotifyTopics="topicGuessMade"
+ showErrorTransportText="true">
+ <img height="36" alt="" src="<@s.property value="%{#chalkboardImageUrl}" />" width="36" border="0"/>
+ </...@sx.a>
+ </...@s.iterator>
+ </div>
+
+
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+ </td>
+ </tr>
+ </table>
+ </div>
</div>
-
-
- </td>
- </tr>
- <tr>
- <td>
-
- </td>
- </tr>
-</table>
+</div>
</body>
</html>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/hangman/hangmanNonAjax.ftl
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/hangman/hangmanNonAjax.ftl?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/hangman/hangmanNonAjax.ftl (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/hangman/hangmanNonAjax.ftl Fri Oct 19 18:49:39 2012
@@ -1,134 +1,143 @@
<html>
<head>
- <title>Showcase - Hangman</title>
- <@s.head theme="xhtml" />
+ <title>Struts2 Showcase - Hangman</title>
</head>
<body>
-<table bgcolor="green">
- <tr>
- <td>
- <@s.url id="url" value="/hangman/images/hangman.png" />
- <img alt="Hangman" src="<@s.property value="%{#url}" />"
- width="197" height="50" border="0"/>
- </td>
- <td width="70" align="right">
- <#-- Guesses Left -->
- <div id="updateGuessLeftDiv">
- <#if (hangman.guessLeft() >= 0)>
- <@s.set name="guessLeftImageName" value="%{'Chalkboard_'+hangman.guessLeft()+'.png'}" />
- <@s.url id="url" value="%{'/hangman/images/'+#guessLeftImageName}" />
- <img alt="No. Guesses Left"
- src="<@s.property value="%{#url}"/>" width="20" height="20" border="0" />
- </#if>
- </div>
- </td>
- <td>
- <@s.url id="url" value="/hangman/images/guesses-left.png" />
- <img alt="Guesses Left"
- src="<@s.property value="%{#url}" />" width="164" height="11" border="0"/>
- </td>
- </tr>
- <tr>
- <td></td>
- <td align="left">
- <#-- Display Scaffold -->
- <div id="updateScaffoldDiv">
- <@s.set name="scaffoldImageName" value="%{'scaffold_'+hangman.guessLeft()+'.png'}" />
- <@s.url id="url" value="%{'/hangman/images/'+#scaffoldImageName}" />
- <img src="<@s.property value="%{#url}" />" border="0"/>
- </div>
- </td>
- <td></td>
- </tr>
- <tr>
- <td width="160">
- <p align="right">
- <@s.url id="url" value="/hangman/images/guess.png" />
- <img alt="Current Guess" src="<@s.property value="%{#url}" />"
- align="MIDDLE" width="127" height="20" border="0"/></p>
- </td>
- <td>
- <#-- Display Vacab -->
- <div id="updateVocabDiv">
- <#if hangman.gameEnded()>
- <@s.iterator id="currentCharacter" value="%{hangman.vocab.inCharacters()}" stat="stat">
- <@s.url id="url" value="%{'/hangman/images/Chalkboard_'+#currentCharacter.toString()+'.png'}" />
- <img height="36" alt="<@s.property value="%{#currentCharacter}" />"
- src="<@s.property value="%{#url}" />" width="36" border="0" />
- </...@s.iterator>
- <#else>
- <@s.iterator id="currentCharacter" value="%{hangman.vocab.inCharacters()}" stat="stat">
- <#if hangman.characterGuessedBefore(currentCharacter)>
- <@s.set name="chalkboardImageName" value="%{'Chalkboard_'+#currentCharacter.toString()+'.png'}" />
- <@s.url id="url" value="%{'/hangman/images/'+#chalkboardImageName}" />
- <img height="36" alt="<@s.property value="%{#currentCharacter}" />"
- src="<@s.property value="%{#url}" />" width="36" border="0"/>
- <#else>
- <@s.url id="url" value="/hangman/images/Chalkboard_underscroll.png" />
- <img height="36" alt="_"
- src="<@s.property value="%{#url}" />" width="36" border="0"/>
- </#if>
- </...@s.iterator>
- </#if>
- </div>
- </td>
- </tr>
- <tr>
- <td valign="top">
- <p align="right">
- <@s.url id="url" value="/hangman/images/choose.png" />
- <img alt="Choose" src="<@s.property value="%{#url}" />"
- height="20" width="151" border="0"/>
- </p>
- </td>
- <td width="330">
-
- <#-- Show Characters Available -->
- <div id="updateCharacterAvailableDiv">
- <#if hangman.gameEnded()>
- <@s.set name="winImageName" value="%{'you-win.png'}" />
- <@s.set name="looseImageName" value="%{'you-lose.png'}" />
- <@s.set name="startImageName" value="%{'start.png'}" />
- <@s.url id="winImageUrl" value="%{'/hangman/images/'+#winImageName}" />
- <@s.url id="looseImageUrl" value="%{'/hangman/images/'+#looseImageName}" />
- <@s.url id="startImageUrl" value="%{'/hangman/images/'+#startImageName}" />
- <@s.url id="startHref" action="hangmanNonAjax" namespace="/hangman" />
-
- <#if hangman.isWin()>
- <img src="<@s.property value="%{#winImageUrl}" />" width="341" height="44" />
- <#else>
- <img src="<@s.property value="%{#looseImageUrl}" />" width="381" height="44" />
- </#if>
- <@s.a href="%{#startHref}">
- <img src="<@s.property value="%{#startImageUrl}" />" width="250" height="43" />
- </...@s.a>
- <#else>
- <@s.iterator id="currentCharacter" value="%{hangman.charactersAvailable}" status="stat">
- <@s.set name="chalkboardImageName" value="%{'Chalkboard_'+#currentCharacter+'.png'}" />
- <@s.url id="chalkboardImageUrl" value="%{'/hangman/images/'+#chalkboardImageName}" />
- <@s.url id="spacerUrl" value="/hangman/images/letter-spacer.png" />
- <@s.url id="url" action="guessCharacterNonAjax" namespace="/hangman">
- <@s.param name="character" value="%{#currentCharacter}" />
- </...@s.url>
-
- <@s.a href="%{#url}"
- id="%{#currentCharacter}"
- >
- <img height="36" alt="" src="<@s.property value="%{#chalkboardImageUrl}" />" width="36" border="0" />
- </...@s.a>
- </...@s.iterator>
- </#if>
+<div class="page-header">
+ <h1>Hangman</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+ <table>
+ <tr>
+ <td>
+ <@s.url id="url" value="/hangman/images/hangman.png" />
+ <img alt="Hangman" src="<@s.property value="%{#url}" />"
+ width="197" height="50" border="0"/>
+ </td>
+ <td width="70" align="right">
+ <#-- Guesses Left -->
+ <div id="updateGuessLeftDiv">
+ <#if (hangman.guessLeft() >= 0)>
+ <@s.set name="guessLeftImageName" value="%{'Chalkboard_'+hangman.guessLeft()+'.png'}" />
+ <@s.url id="url" value="%{'/hangman/images/'+#guessLeftImageName}" />
+ <img alt="No. Guesses Left"
+ src="<@s.property value="%{#url}"/>" width="20" height="20" border="0" />
+ </#if>
+ </div>
+ </td>
+ <td>
+ <@s.url id="url" value="/hangman/images/guesses-left.png" />
+ <img alt="Guesses Left"
+ src="<@s.property value="%{#url}" />" width="164" height="11" border="0"/>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td align="left">
+ <#-- Display Scaffold -->
+ <div id="updateScaffoldDiv">
+ <@s.set name="scaffoldImageName" value="%{'scaffold_'+hangman.guessLeft()+'.png'}" />
+ <@s.url id="url" value="%{'/hangman/images/'+#scaffoldImageName}" />
+ <img src="<@s.property value="%{#url}" />" border="0"/>
+ </div>
+ </td>
+ <td></td>
+ </tr>
+ <tr>
+ <td width="160">
+ <p align="right">
+ <@s.url id="url" value="/hangman/images/guess.png" />
+ <img alt="Current Guess" src="<@s.property value="%{#url}" />"
+ align="MIDDLE" width="127" height="20" border="0"/></p>
+ </td>
+ <td>
+ <#-- Display Vacab -->
+ <div id="updateVocabDiv">
+ <#if hangman.gameEnded()>
+ <@s.iterator id="currentCharacter" value="%{hangman.vocab.inCharacters()}" stat="stat">
+ <@s.url id="url" value="%{'/hangman/images/Chalkboard_'+#currentCharacter.toString()+'.png'}" />
+ <img height="36" alt="<@s.property value="%{#currentCharacter}" />"
+ src="<@s.property value="%{#url}" />" width="36" border="0" />
+ </...@s.iterator>
+ <#else>
+ <@s.iterator id="currentCharacter" value="%{hangman.vocab.inCharacters()}" stat="stat">
+ <#if hangman.characterGuessedBefore(currentCharacter)>
+ <@s.set name="chalkboardImageName" value="%{'Chalkboard_'+#currentCharacter.toString()+'.png'}" />
+ <@s.url id="url" value="%{'/hangman/images/'+#chalkboardImageName}" />
+ <img height="36" alt="<@s.property value="%{#currentCharacter}" />"
+ src="<@s.property value="%{#url}" />" width="36" border="0"/>
+ <#else>
+ <@s.url id="url" value="/hangman/images/Chalkboard_underscroll.png" />
+ <img height="36" alt="_"
+ src="<@s.property value="%{#url}" />" width="36" border="0"/>
+ </#if>
+ </...@s.iterator>
+ </#if>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">
+ <p align="right">
+ <@s.url id="url" value="/hangman/images/choose.png" />
+ <img alt="Choose" src="<@s.property value="%{#url}" />"
+ height="20" width="151" border="0"/>
+ </p>
+ </td>
+ <td width="330">
+
+ <#-- Show Characters Available -->
+ <div id="updateCharacterAvailableDiv">
+ <#if hangman.gameEnded()>
+ <@s.set name="winImageName" value="%{'you-win.png'}" />
+ <@s.set name="looseImageName" value="%{'you-lose.png'}" />
+ <@s.set name="startImageName" value="%{'start.png'}" />
+ <@s.url id="winImageUrl" value="%{'/hangman/images/'+#winImageName}" />
+ <@s.url id="looseImageUrl" value="%{'/hangman/images/'+#looseImageName}" />
+ <@s.url id="startImageUrl" value="%{'/hangman/images/'+#startImageName}" />
+ <@s.url id="startHref" action="hangmanNonAjax" namespace="/hangman" />
+
+ <#if hangman.isWin()>
+ <img src="<@s.property value="%{#winImageUrl}" />" width="341" height="44" />
+ <#else>
+ <img src="<@s.property value="%{#looseImageUrl}" />" width="381" height="44" />
+ </#if>
+ <@s.a href="%{#startHref}">
+ <img src="<@s.property value="%{#startImageUrl}" />" width="250" height="43" />
+ </...@s.a>
+ <#else>
+ <@s.iterator id="currentCharacter" value="%{hangman.charactersAvailable}" status="stat">
+ <@s.set name="chalkboardImageName" value="%{'Chalkboard_'+#currentCharacter+'.png'}" />
+ <@s.url id="chalkboardImageUrl" value="%{'/hangman/images/'+#chalkboardImageName}" />
+ <@s.url id="spacerUrl" value="/hangman/images/letter-spacer.png" />
+ <@s.url id="url" action="guessCharacterNonAjax" namespace="/hangman">
+ <@s.param name="character" value="%{#currentCharacter}" />
+ </...@s.url>
+
+ <@s.a href="%{#url}"
+ id="%{#currentCharacter}"
+ >
+ <img height="36" alt="" src="<@s.property value="%{#chalkboardImageUrl}" />" width="36" border="0" />
+ </...@s.a>
+ </...@s.iterator>
+ </#if>
+ </div>
+
+
+ </td>
+ </tr>
+ <tr>
+ <td>
+
+ </td>
+ </tr>
+ </table>
+ </div>
</div>
-
-
- </td>
- </tr>
- <tr>
- <td>
-
- </td>
- </tr>
-</table>
+</div>
</body>
</html>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/help.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/help.jsp?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/help.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/help.jsp Fri Oct 19 18:49:39 2012
@@ -1,31 +1,32 @@
<%@taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
- <title>Struts ~ Getting Support</title>
+ <title>Struts2 Showcase . Getting Support</title>
</head>
<body>
- <div id="main">
- <h4>Getting support</h4>
+ <div class="page-header">
+ <h1>Getting support</h1>
+ </div>
- <table style="width: auto;">
- <tr>
- <th style="width: auto;">Link</th>
- <th style="width: auto;">Description</th>
- </tr>
- <tr>
- <td><a href="http://struts.apache.org/mail.html">User List</a></td>
- <td>Use this mailing list if you encounter problems while developing and using with Struts</td>
- </tr>
- <tr>
- <td><a href="http://struts.apache.org/2.x/">Struts 2</a></td>
- <td>The Struts 2 website</td>
- </tr>
- </table>
- </div>
- <div id="local">
- <img src='<s:url value="/images/struts.gif"/>' alt="Struts Logo" width="290" height="80"/>
- </div>
+ <div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span4" style="text-align: center;">
+ <img src='<s:url value="/images/struts.gif"/>' alt="Struts Logo" width="290" height="80"/>
+ </div>
+ <div class="span4" style="text-align: center;">
+ <div class="alert alert-info">
+ Use this mailing list if you encounter problems while developing and using with Struts.
+ </div>
+ <a href="http://struts.apache.org/mail.html" class="btn btn-large btn-info"><i class="icon-share"></i> User List</a>
+ </div>
+ <div class="span4" style="text-align: center;">
+ <div class="alert alert-info">
+ The Struts 2 website.
+ </div>
+ <a href="http://struts.apache.org/2.x/" class="btn btn-large btn-info"><i class="icon-share"></i> Struts 2</a>
+ </div>
+ </div>
</body>
</html>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/integration/modelDriven.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/integration/modelDriven.jsp?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/integration/modelDriven.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/integration/modelDriven.jsp Fri Oct 19 18:49:39 2012
@@ -1,31 +1,44 @@
-<%@taglib prefix="s" uri="/struts-tags" %>
-
+<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
-<title>Showcase - Struts 1 Integration Example</title>
-<s:head/>
+ <title>Struts2 Showcase - Struts1 Integration</title>
+ <s:head/>
</head>
+
<body>
-<s:form action="saveGangster" namespace="/integration">
-
- <s:textfield
- label="Gangster Name"
- name="name" />
- <s:textfield
- label="Gangster Age"
- name="age" />
- <s:checkbox
- label="Gangster Busted Before"
- name="bustedBefore" />
- <s:textarea
- cols="30"
- rows="5"
- label="Gangster Description"
- name="description" />
- <s:submit />
-
-</s:form>
+<div class="page-header">
+ <h1>Struts1 Integration</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+
+ <s:form action="saveGangster" namespace="/integration">
+
+ <s:textfield
+ label="Gangster Name"
+ name="name"/>
+ <s:textfield
+ label="Gangster Age"
+ name="age"/>
+ <s:checkbox
+ label="Gangster Busted Before"
+ name="bustedBefore"/>
+ <s:textarea
+ cols="30"
+ rows="5"
+ label="Gangster Description"
+ name="description"/>
+ <s:submit cssClass="btn btn-primary"/>
+
+ </s:form>
+
+ </div>
+ </div>
+</div>
</body>
</html>
\ No newline at end of file
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/integration/modelDrivenResult.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/integration/modelDrivenResult.jsp?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/integration/modelDrivenResult.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/integration/modelDrivenResult.jsp Fri Oct 19 18:49:39 2012
@@ -1,24 +1,43 @@
-<%@taglib prefix="s" uri="/struts-tags" %>
-
+<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
-<title>Showcase - Struts 1 Integration Example</title>
-<s:head/>
+ <title>Struts2 Showcase - Struts1 Integration - Result</title>
+ <style type="text/css">
+ .label {
+ background-color: #ffffff;
+ color: #000000;
+ text-shadow: none;
+ font-weight: bold;
+ }
+ </style>
</head>
+
<body>
- <s:actionmessage />
- <s:label
- label="Gangster Name"
- name="name" /><br/>
- <s:label
- label="Gangster Age"
- name="age" /><br/>
- <s:label
- label="Busted Before"
- name="bustedBefore" /><br/>
- <s:label
- label="Gangster Description"
- name="description" /><br/>
+<div class="page-header">
+ <h1>Struts1 Integration - Result</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <s:actionmessage cssClass="alert alert-info"/>
+ <s:label
+ label="Gangster Name"
+ name="name" /><br/>
+ <s:label
+ label="Gangster Age"
+ name="age" /><br/>
+ <s:label
+ label="Busted Before"
+ name="bustedBefore" /><br/>
+ <s:label
+ label="Gangster Description"
+ name="description" /><br/>
+
+ </div>
+ </div>
+</div>
</body>
</html>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/interactive/index.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/interactive/index.jsp?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/interactive/index.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/interactive/index.jsp Fri Oct 19 18:49:39 2012
@@ -120,12 +120,6 @@
}
.wc-command {
margin: 1px 0 0 0;
- border-style: none;
- font-family: courier;
- color: white;
- background-color: black;
- width: 100%;
- padding: 0px;
}
.shell {
width: 100%;
@@ -196,7 +190,7 @@
:->
</div>
<input type="hidden" name="debug" value="command" />
- OGNL Expression <input name="expression" onkeyup="keyEvent(event, '${jspEval}')" class="wc-command" id="wc-command" type="text" />
+ OGNL Expression <input name="expression" onkeyup="keyEvent(event, '${jspEval}')" class="input-xxlarge wc-command" id="wc-command" type="text" />
</form>
</div>
</sx:div>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/jsf/employee/edit.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/jsf/employee/edit.jsp?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/jsf/employee/edit.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/jsf/employee/edit.jsp Fri Oct 19 18:49:39 2012
@@ -22,85 +22,92 @@
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<f:view>
+ <html>
+ <head>
+ <title>Struts2 Showcase - JSF Integration - Modify Employee</title>
+ <s:head/>
+ </head>
-<html>
-<!-- todo: make header variable -->
- <head>
- <title>JSF Integration Examples</title>
- </head>
-
- <body>
-
- <h1>Modify Employee</h1>
-
- <h:form>
- <h:inputHidden value="#{action.currentEmployee.empId}" />
- <h:panelGrid columns="3">
- <h:outputText value="Employee Id:" />
- <h:inputText id="id" size="5" value="#{action.currentEmployee.empId}" required="true" />
- <h:message for="id" />
-
- <h:outputText value="First Name:" />
- <h:inputText id="firstName" size="30" value="#{action.currentEmployee.firstName}" required="true">
- <f:validateLength minimum="2" maximum="30" />
- </h:inputText>
- <h:message for="firstName" />
-
- <h:outputText value="Last Name:" />
- <h:inputText id="lastName" size="30" value="#{action.currentEmployee.lastName}" required="true">
- <f:validateLength minimum="2" maximum="30" />
- </h:inputText>
- <h:message for="lastName" />
-
- <h:outputText value="Salary:" />
- <h:inputText id="salary" size="10" value="#{action.currentEmployee.salary}" />
- <h:message for="salary" />
-
- <h:outputText value="Married:" />
- <h:selectBooleanCheckbox id="married" value="#{action.currentEmployee.married}" />
- <h:message for="married" />
-
- <h:outputText value="Position:" />
- <h:selectOneMenu id="position" value="#{action.currentEmployee.position}">
- <f:selectItems value="#{action.availablePositionsAsMap}" />
- </h:selectOneMenu>
- <h:message for="position" />
-
- <h:outputText value="Main Skill:" />
- <h:selectOneMenu id="mainSkill" value="#{action.currentEmployee.mainSkill.name}">
- <f:selectItems value="#{action.availableSkills}" />
- </h:selectOneMenu>
- <h:message for="mainSkill" />
-
- <h:outputText value="Other Skills:" />
- <h:selectManyListbox id="otherSkills" value="#{action.selectedSkills}" >
- <f:selectItems value="#{action.availableSkills}" />
- </h:selectManyListbox>
- <h:message for="otherSkills" />
-
- <h:outputText value="Password:" />
- <h:inputSecret id="password" value="#{action.currentEmployee.password}" />
- <h:message for="password" />
-
- <h:outputText value="Level:" />
- <h:selectOneRadio id="level" value="#{action.currentEmployee.level}" >
- <f:selectItems value="#{action.availableLevelsAsMap}" />
- </h:selectOneRadio>
- <h:message for="level" />
-
- <h:outputText value="Comment:" />
- <h:inputTextarea id="comment" value="#{action.currentEmployee.comment}" cols="50" rows="3" />
- <h:message for="comment" />
- </h:panelGrid>
-
- <h:commandButton value="Save" action="#{action.save}" />
- <br /><br />
- <h:outputLink value="list.action">
- <h:outputText value="Back" />
- </h:outputLink>
- </h:form>
- </body>
+ <body>
-</html>
+ <div class="page-header">
+ <h1>Modify Employee</h1>
+ </div>
+ <div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <h:form>
+ <h:inputHidden value="#{action.currentEmployee.empId}"/>
+ <h:panelGrid columns="3">
+ <h:outputText value="Employee Id:"/>
+ <h:inputText id="id" size="5" value="#{action.currentEmployee.empId}" required="true"/>
+ <h:message for="id"/>
+
+ <h:outputText value="First Name:"/>
+ <h:inputText id="firstName" size="30" value="#{action.currentEmployee.firstName}"
+ required="true">
+ <f:validateLength minimum="2" maximum="30"/>
+ </h:inputText>
+ <h:message for="firstName"/>
+
+ <h:outputText value="Last Name:"/>
+ <h:inputText id="lastName" size="30" value="#{action.currentEmployee.lastName}" required="true">
+ <f:validateLength minimum="2" maximum="30"/>
+ </h:inputText>
+ <h:message for="lastName"/>
+
+ <h:outputText value="Salary:"/>
+ <h:inputText id="salary" size="10" value="#{action.currentEmployee.salary}"/>
+ <h:message for="salary"/>
+
+ <h:outputText value="Married:"/>
+ <h:selectBooleanCheckbox id="married" value="#{action.currentEmployee.married}"/>
+ <h:message for="married"/>
+
+ <h:outputText value="Position:"/>
+ <h:selectOneMenu id="position" value="#{action.currentEmployee.position}">
+ <f:selectItems value="#{action.availablePositionsAsMap}"/>
+ </h:selectOneMenu>
+ <h:message for="position"/>
+
+ <h:outputText value="Main Skill:"/>
+ <h:selectOneMenu id="mainSkill" value="#{action.currentEmployee.mainSkill.name}">
+ <f:selectItems value="#{action.availableSkills}"/>
+ </h:selectOneMenu>
+ <h:message for="mainSkill"/>
+
+ <h:outputText value="Other Skills:"/>
+ <h:selectManyListbox id="otherSkills" value="#{action.selectedSkills}">
+ <f:selectItems value="#{action.availableSkills}"/>
+ </h:selectManyListbox>
+ <h:message for="otherSkills"/>
+
+ <h:outputText value="Password:"/>
+ <h:inputSecret id="password" value="#{action.currentEmployee.password}"/>
+ <h:message for="password"/>
+
+ <h:outputText value="Level:"/>
+ <h:selectOneRadio id="level" value="#{action.currentEmployee.level}">
+ <f:selectItems value="#{action.availableLevelsAsMap}"/>
+ </h:selectOneRadio>
+ <h:message for="level"/>
+
+ <h:outputText value="Comment:"/>
+ <h:inputTextarea id="comment" value="#{action.currentEmployee.comment}" cols="50" rows="3"/>
+ <h:message for="comment"/>
+ </h:panelGrid>
+
+ <h:commandButton value="Save" action="#{action.save}" styleClass="btn btn-primary"/>
+ <br/><br/>
+ <h:outputLink value="list.action" styleClass="btn btn-info">
+ <h:outputText value="Back"/>
+ </h:outputLink>
+ </h:form>
+ </div>
+ </div>
+ </div>
+ </body>
+ </html>
</f:view>
\ No newline at end of file
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/jsf/employee/list.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/jsf/employee/list.jsp?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/jsf/employee/list.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/jsf/employee/list.jsp Fri Oct 19 18:49:39 2012
@@ -22,48 +22,54 @@
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<f:view>
+ <html>
+ <head>
+ <title>Struts2 Showcase - JSF Integration - Available Employees</title>
+ <s:head/>
+ </head>
-<html>
-<head><title>Available Employees</title></head>
+ <body>
-<body>
-<h1>Available Employees</h1>
-
- <h:dataTable value="#{action.availableItems}" var="e">
- <h:column>
- <f:facet name="header">
- <h:outputText value="Id" />
- </f:facet>
- <h:outputLink value="edit.action">
- <f:param name="empId" value="#{e.empId}" />
- <h:outputText value="#{e.empId}" />
- </h:outputLink>
- </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="First Name" />
- </f:facet>
- <h:outputText value="#{e.firstName}" />
- </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="Last Name" />
- </f:facet>
- <h:outputText value="#{e.lastName}" />
- </h:column>
- </h:dataTable>
-
- <p>
- <h:outputLink value="edit.action">
- <h:outputText value="Create new Employee" />
- </h:outputLink>
- </p>
-
- <h:outputLink value="../../showcase.action">
- <h:outputText value="Back to Showcase Startpage" />
- </h:outputLink>
- </body>
+ <div class="page-header">
+ <h1>Available Employees</h1>
+ </div>
-</html>
+ <div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+ <h:dataTable value="#{action.availableItems}" var="e" styleClass="table table-striped table-bordered table-hover table-condensed">
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Id"/>
+ </f:facet>
+ <h:outputLink value="edit.action">
+ <f:param name="empId" value="#{e.empId}"/>
+ <h:outputText value="#{e.empId}"/>
+ </h:outputLink>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="First Name"/>
+ </f:facet>
+ <h:outputText value="#{e.firstName}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Last Name"/>
+ </f:facet>
+ <h:outputText value="#{e.lastName}"/>
+ </h:column>
+ </h:dataTable>
+
+ <p>
+ <h:outputLink value="edit.action" styleClass="btn btn-primary">
+ <h:outputText value="Create new Employee"/>
+ </h:outputLink>
+ </p>
+ </div>
+ </div>
+ </div>
+ </body>
+ </html>
</f:view>
\ No newline at end of file
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/jsf/index.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/jsf/index.jsp?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/jsf/index.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/jsf/index.jsp Fri Oct 19 18:49:39 2012
@@ -1,24 +1,35 @@
-<%@taglib prefix="s" uri="/struts-tags" %>
-
+<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
-<title>Showcase - JSF Integration</title>
+ <title>Struts2 Showcase - JSF Integration</title>
+ <s:head/>
</head>
+
<body>
-<h1> JavaServer Faces Integration </h1>
-<p>
-The following pages show how Struts and JSF components can work together,
-each doing what they do best.
-</p>
+<div class="page-header">
+ <h1>JavaServer Faces Integration</h1>
+</div>
-<p>
- <ul>
- <li><s:url var="url" namespace="/jsf/employee" action="list"/><s:a href="%{url}">List available Employees</s:a></li>
- <li><s:url var="url" namespace="/jsf/employee" action="edit"/><s:a href="%{url}">Create/Edit Employee</s:a></li>
- </ul>
-</p>
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+ <p>
+ The following pages show how Struts and JSF components can work together,
+ each doing what they do best.
+ </p>
+ <p>
+ <ul>
+ <li><s:url var="url" namespace="/jsf/employee" action="list"/><s:a
+ href="%{url}">List available Employees</s:a></li>
+ <li><s:url var="url" namespace="/jsf/employee" action="edit"/><s:a
+ href="%{url}">Create/Edit Employee</s:a></li>
+ </ul>
+ </p>
+ </div>
+ </div>
+</div>
</body>
-</html>
+</html>
\ No newline at end of file
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/modelDriven/modelDriven.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/modelDriven/modelDriven.jsp?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/modelDriven/modelDriven.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/modelDriven/modelDriven.jsp Fri Oct 19 18:49:39 2012
@@ -1,31 +1,42 @@
-<%@taglib prefix="s" uri="/struts-tags" %>
-
+<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
-<title>Showcase - Model Driven Example</title>
-<s:head/>
+ <title>Struts2 Showcase - Model Driven Example</title>
+ <s:head/>
</head>
+
<body>
-<s:form action="modelDrivenResult" method="POST" namespace="/modelDriven">
-
- <s:textfield
- label="Gangster Name"
- name="name" />
- <s:textfield
- label="Gangster Age"
- name="age" />
- <s:checkbox
- label="Gangster Busted Before"
- name="bustedBefore" />
- <s:textarea
- cols="30"
- rows="5"
- label="Gangster Description"
- name="description" />
- <s:submit />
-
-</s:form>
+<div class="page-header">
+ <h1>Model Driven Example</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <s:form action="modelDrivenResult" method="POST" namespace="/modelDriven">
+
+ <s:textfield
+ label="Gangster Name"
+ name="name"/>
+ <s:textfield
+ label="Gangster Age"
+ name="age"/>
+ <s:checkbox
+ label="Gangster Busted Before"
+ name="bustedBefore"/>
+ <s:textarea
+ cols="30"
+ rows="5"
+ label="Gangster Description"
+ name="description"/>
+ <s:submit cssClass="btn btn-primary"/>
+
+ </s:form>
+ </div>
+ </div>
+</div>
</body>
-</html>
+</html>
\ No newline at end of file
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/modelDriven/modelDrivenResult.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/modelDriven/modelDrivenResult.jsp?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/modelDriven/modelDrivenResult.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/modelDriven/modelDrivenResult.jsp Fri Oct 19 18:49:39 2012
@@ -1,24 +1,42 @@
<%@taglib prefix="s" uri="/struts-tags" %>
-
<html>
<head>
-<title>Showcase - Model Driven Example</title>
-<s:head/>
+ <title>Struts2 Showcase - Model Driven Example - Result</title>
+ <style type="text/css">
+ .label {
+ background-color: #ffffff;
+ color: #000000;
+ text-shadow: none;
+ font-weight: bold;
+ }
+ </style>
</head>
+
<body>
- <s:label
- label="Gangster Name"
- name="name" /><br/>
- <s:label
- label="Gangster Age"
- name="age" /><br/>
- <s:label
- label="Busted Before"
- name="bustedBefore" /><br/>
- <s:label
- label="Gangster Description"
- name="description" /><br/>
+<div class="page-header">
+ <h1>Model Driven Example - Result</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <s:label
+ label="Gangster Name"
+ name="name"/><br/>
+ <s:label
+ label="Gangster Age"
+ name="age"/><br/>
+ <s:label
+ label="Busted Before"
+ name="bustedBefore"/><br/>
+ <s:label
+ label="Gangster Description"
+ name="description"/><br/>
+ </div>
+ </div>
+</div>
</body>
-</html>
+</html>
\ No newline at end of file
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/person/edit-person.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/person/edit-person.jsp?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/person/edit-person.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/person/edit-person.jsp Fri Oct 19 18:49:39 2012
@@ -1,43 +1,53 @@
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
+<%@taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
- <title>Edit Persons (batch-edit)</title>
+ <title>Struts2 Showcase - Person Manager Example</title>
</head>
-
<body>
-<s:form action="edit-person" theme="simple" validate="false">
-
- <table>
- <tr>
- <th>ID</th>
- <th>First Name</th>
- <th>Last Name</th>
- </tr>
- <s:iterator var="p" value="persons">
- <tr>
- <td>
- <s:property value="%{id}" />
- </td>
- <td>
- <s:textfield label="First Name" name="persons(%{id}).name" value="%{name}" theme="simple" />
- </td>
- <td>
- <s:textfield label="Last Name" name="persons(%{id}).lastName" value="%{lastName}" theme="simple"/>
- </td>
- </tr>
- </s:iterator>
- </table>
-
- <s:submit method="save" value="Save all persons"/>
-</s:form>
-
-<ul>
- <s:url id="newpersonurl" action="new-person" method="input" />
- <li><s:a href="%{newpersonurl}">Create</s:a> a new person</li>
- <s:url id="listpeopleurl" action="list-people" />
- <li><s:a href="%{listpeopleurl}">List</s:a> all people</li>
-</ul>
-
+<div class="page-header">
+ <h1>Person Manager Example</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span3">
+ <ul class="nav nav-tabs nav-stacked">
+ <s:url id="listpeopleurl" action="list-people" namespace="/person" />
+ <li><s:a href="%{listpeopleurl}">List all people</s:a> </li>
+ <s:url id="editpersonurl" action="edit-person" namespace="/person" />
+ <li class="active"><s:a href="%{editpersonurl}">Edit people</s:a></li>
+ <s:url id="newpersonurl" action="new-person" namespace="/person" method="input"/>
+ <li><s:a href="%{newpersonurl}">Create a new person</s:a></li>
+ </ul>
+ </div>
+ <div class="span9">
+ <s:form action="edit-person" theme="simple" validate="false">
+
+ <table class="table table-striped table-bordered table-hover table-condensed">
+ <tr>
+ <th>ID</th>
+ <th>First Name</th>
+ <th>Last Name</th>
+ </tr>
+ <s:iterator var="p" value="persons">
+ <tr>
+ <td>
+ <s:property value="%{id}" />
+ </td>
+ <td>
+ <s:textfield label="First Name" name="persons(%{id}).name" value="%{name}" theme="simple" />
+ </td>
+ <td>
+ <s:textfield label="Last Name" name="persons(%{id}).lastName" value="%{lastName}" theme="simple"/>
+ </td>
+ </tr>
+ </s:iterator>
+ </table>
+
+ <s:submit method="save" value="Save all persons" cssClass="btn btn-primary"/>
+ </s:form>
+ </div>
+ </div>
+</div>
</body>
</html>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/person/index.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/person/index.jsp?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/person/index.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/person/index.jsp Fri Oct 19 18:49:39 2012
@@ -1,16 +1 @@
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<html>
-<head>
- <title>Acme Corp</title>
-</head>
-
-<body>
-<ul>
- <s:url id="newpersonurl" action="new-person" method="input" />
- <li><s:a href="%{newpersonurl}">Create</s:a> a new person</li>
- <s:url id="listpeopleurl" action="list-people" />
- <li><s:a href="%{listpeopleurl}">List</s:a> all people</li>
-</ul>
-</body>
-</html>
+<% response.sendRedirect("list-people.action"); %>
\ No newline at end of file
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/person/list-people.ftl
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/person/list-people.ftl?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/person/list-people.ftl (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/person/list-people.ftl Fri Oct 19 18:49:39 2012
@@ -1,30 +1,44 @@
<html>
<head>
- <title>All People</title>
+ <title>Struts2 Showcase - Person Manager Example - All People</title>
</head>
-
<body>
+<div class="page-header">
+ <h1>All People</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span3">
+ <ul class="nav nav-tabs nav-stacked">
+ <@s.url id="listpeopleurl" action="list-people" />
+ <li class="active"><@s.a href="%{listpeopleurl}">List all people</...@s.a></li>
+ <@s.url id="editpersonurl" action="edit-person" />
+ <li><@s.a href="%{editpersonurl}">Edit people</...@s.a></li>
+ <@s.url id="newpersonurl" action="new-person" method="input" />
+ <li><@s.a href="%{newpersonurl}">Create a new person</...@s.a></li>
+ </ul>
+ </div>
+ <div class="span9">
-There are ${peopleCount} people...
-<table>
- <tr>
- <th>ID</th>
- <th>Name</th>
- </tr>
-<#list people as person>
- <tr>
- <td>${person.id?html}</td>
- <td>${person.name?html}</td>
- <td>${person.lastName?html}</td>
- </tr>
-</#list>
-</table>
+ <p>There are ${peopleCount} people...</p>
-<ul>
- <@s.url id="editpersonurl" action="edit-person" />
- <li><@s.a href="%{editpersonurl}">Edit people</...@s.a></li>
- <@s.url id="newpersonurl" action="new-person" method="input" />
- <li><@s.a href="%{newpersonurl}">Create</...@s.a> a new person</li>
-</ul>
+ <table class="table table-striped table-bordered table-hover table-condensed">
+ <tr>
+ <th>ID</th>
+ <th>Name</th>
+ <th>Last Name</th>
+ </tr>
+ <#list people as person>
+ <tr>
+ <td>${person.id?html}</td>
+ <td>${person.name?html}</td>
+ <td>${person.lastName?html}</td>
+ </tr>
+ </#list>
+ </table>
+ </div>
+ </div>
+</div>
</body>
</html>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/person/new-person.ftl
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/person/new-person.ftl?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/person/new-person.ftl (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/person/new-person.ftl Fri Oct 19 18:49:39 2012
@@ -1,21 +1,49 @@
<html>
<head>
- <title>New Person</title>
+ <title>Struts2 Showcase - Person Manager Example - New Person</title>
</head>
-
<body>
-<@s.form action="new-person">
- <@s.textfield label="First Name" name="person.name"/>
- <@s.textfield label="Last Name" name="person.lastName"/>
- <@s.submit value="Create person"/>
-</...@s.form>
+<div class="page-header">
+ <h1>New Person</h1>
+</div>
-<ul>
- <@s.url id="editpersonurl" action="edit-person" />
- <li><@s.a href="%{editpersonurl}">Edit people</...@s.a></li>
- <@s.url id="listpeopleurl" action="list-people" />
- <li><@s.a href="%{listpeopleurl}">List</...@s.a> all people</li>
-</ul>
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span3">
+ <ul class="nav nav-tabs nav-stacked">
+ <@s.url id="listpeopleurl" action="list-people" />
+ <li><@s.a href="%{listpeopleurl}">List all people</...@s.a></li>
+ <@s.url id="editpersonurl" action="edit-person" />
+ <li><@s.a href="%{editpersonurl}">Edit people</...@s.a></li>
+ <@s.url id="newpersonurl" action="new-person" />
+ <li class="active"><@s.a href="%{newpersonurl}">Create a new person</...@s.a></li>
+ </ul>
+ </div>
+ <div class="span9">
+ <@s.actionerror cssClass="alert alert-error"/>
+ <@s.actionmessage cssClass="alert alert-info"/>
+ <@s.fielderror cssClass="alert alert-error"/>
+ <@s.form action="new-person" theme="simple" cssClass="form-horizontal">
+ <legend>Create a new Person</legend>
+ <div class="control-group">
+ <label class="control-label" for="name">First Name<span class="required">*</span></label>
+ <div class="controls">
+ <@s.textfield id="name" name="person.name" placeholder="First Name"/>
+ </div>
+ </div>
+ <div class="control-group">
+ <label class="control-label" for="lastName">Last Name<span class="required">*</span></label>
+ <div class="controls">
+ <@s.textfield id="lastName" name="person.lastName" placeholder="Last Name"/>
+ </div>
+ </div>
+ <div class="form-actions">
+ <@s.submit value="Create person" cssClass="btn btn-primary"/>
+ </div>
+ </...@s.form>
+ </div>
+ </div>
+</div>
</body>
</html>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/showcase.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/showcase.jsp?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/showcase.jsp (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/showcase.jsp Fri Oct 19 18:49:39 2012
@@ -7,58 +7,24 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
- <title>Showcase</title>
+ <title>Struts2 Showcase</title>
<s:head theme="simple"/>
</head>
<body>
- <blockquote>
- <p>
- The Struts Showcase demonstrates a variety of use cases and tag usages.
- Essentially, the application exercises various framework features in isolation.
- <em>The Showcase is <strong>not</strong> meant as a "best practices" example.</em>
- </p>
- <ul>
- <li>
- For more "by example" solutions,
- see the <a href="http://struts.apache.org/2.x/docs/cookbook.html">Struts Cookbook</a> pages.
- </li>
- </ul>
- </blockquote>
- <p>
- <%-- THIS LIST IS MAINTAINED IN WEB-INF/decorators/main.jsp TO CREATE THE MENU BAR -- EDIT THERE AND COPY HERE --%>
- <ul>
- <li><a href="<s:url value="/showcase.jsp"/>">Home</a></li>
- <li><a href="<s:url value="/interactive/index.jsp" />">Interactive demo of OGNL and JSP tags</a></li>
- <li><a href="<s:url value="/ajax/index.jsp" />">Ajax plugin for Struts</a></li>
- <li><a href="<s:url value="/chat/index.jsp"/>">Ajax Chat</a>
- <li><a href="<s:url action="actionChain1!input" namespace="/actionchaining" includeParams="none" />">Action Chaining</a></li>
- <li><a href="<s:url action="index" namespace="/config-browser" includeParams="none" />">Config Browser</a></li>
- <li><a href="<s:url value="/conversion/index.jsp"/>">Conversion</a></li>
- <li><a href="<s:url value="/empmanager/index.jsp"/>">CRUD</a></li>
- <li><a href="<s:url value="/wait/index.jsp"/>">Execute & Wait</a></li>
- <li><a href="<s:url value="/filedownload/index.jsp"/>">File Download</a></li>
- <li><a href="<s:url value="/fileupload/index.jsp" />">File Upload</a></li>
- <li><a href="<s:url value="/freemarker/index.jsp"/>">Freemarker</a>
- <li><a href="<s:url action="hangmanMenu" namespace="/hangman"/>">Hangman</a></li>
- <li><a href="<s:url value="/jsf/index.jsp"/>">JavaServer Faces</a></li>
- <li><a href="<s:url value="/person/index.jsp"/>">Person Manager</a></li>
- <li><a href="<s:url value="/tags/index.jsp"/>">Tags</a></li>
- <li><a href="<s:url value="/tiles/index.action" />">Tiles</a></li>
- <li><a href="<s:url value="/token/index.jsp"/>">Token</a></li>
- <li><a href="<s:url value="/validation/index.jsp"/>">Validation</a></li>
- <li class="last"><a href="<s:url value="/help.jsp"/>">Help</a></li>
- </ul>
+ <div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
- <h2>Sandbox</h2>
- <p>
- These examples are under development and may not be fully operational.
- </p>
- <ul>
- <li><a href="<s:url action="guess" namespace="/continuations" />">Continuations</a></li>
- </ul>
+ <div class="hero-unit">
+ <h1>Welcome!</h1>
+ <p>The Struts Showcase demonstrates a variety of use cases and tag usages. Essentially, the application exercises various framework features in isolation. The Showcase is not meant as a "best practices" example.</p>
+ <p>For more "by example" solutions, see the <a class="btn btn-primary btn-large">Struts Cookbook »</a> pages.</p>
+ </div>
-</p>
+ </div>
+ </div>
+ </div>
</body>
</html>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/styles/main.css
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/styles/main.css?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/styles/main.css (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/styles/main.css Fri Oct 19 18:49:39 2012
@@ -1,5 +1,19 @@
-@import url(layout-navtop-localleft.css);
-@import url(layout.css);
-@import url(forms.css);
-@import url(typo.css);
-@import url(tools.css);
+body {
+ padding-top: 60px;
+ padding-bottom: 40px;
+}
+.sidebar-nav {
+ padding: 9px 0;
+}
+.tdLabel .label, .wwlbl .label {
+ background-color: #ffffff;
+ color: #000000;
+ text-shadow: none;
+}
+.alert li {
+ list-style: none;
+}
+.errorMessage, label.errorLabel {
+ color: red;
+}
+label.errorLabel
\ No newline at end of file
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/tags/non-ui/actionPrefix/actionPrefix.ftl
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/tags/non-ui/actionPrefix/actionPrefix.ftl?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/tags/non-ui/actionPrefix/actionPrefix.ftl (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/tags/non-ui/actionPrefix/actionPrefix.ftl Fri Oct 19 18:49:39 2012
@@ -1,18 +1,24 @@
-
-
<html>
<head>
- <title>Showcase - Tags - Non UI - Action Prefix (freemarker)</title>
+ <title>Struts2 Showcase - Non UI Tags - Action Prefix (Freemarker)</title>
</head>
<body>
-
- You have come to this page because you used an 'action' prefix.<p/>
-
- The text you've entered is ${text?default('')?html}<p/>
-
- <@s.url id="url" action="actionPrefixExampleUsingFreemarker" namespace="/tags/non-ui/actionPrefix" />
- <@s.a href="%{#url}">Back</...@s.a>
-
+<div class="page-header">
+ <h1>Non Ui Tag - Action Prefix (Freemarker)</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <p>You have come to this page because you used an <strong>action</strong> prefix.<p/>
+
+ <p>The text you've entered is ${text?default('')?html}<p/>
+
+ <@s.a href="javascript:history.back();" cssClass="btn btn-info"><i class="icon icon-arrow-left"></i> Back</...@s.a>
+ </div>
+ </div>
+</div>
</body>
</html>
Modified: struts/struts2/trunk/apps/showcase/src/main/webapp/tags/non-ui/actionPrefix/actionPrefixExample.ftl
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/tags/non-ui/actionPrefix/actionPrefixExample.ftl?rev=1400220&r1=1400219&r2=1400220&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/tags/non-ui/actionPrefix/actionPrefixExample.ftl (original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/tags/non-ui/actionPrefix/actionPrefixExample.ftl Fri Oct 19 18:49:39 2012
@@ -1,48 +1,58 @@
-
<html>
- <head>
- <title>Showcase - Tags - Non UI - Action Prefix (Freemarker)</title>
- </head>
- <body>
- <b>Action Prefix</b><br/>
- By clicking on 'action prefix' button, the request will go to the action alias 'actionPrefix'
- instead of the normal 'submit' action alias. <p/><p/>
-
- <b>Method Prefix</b><br/>
- By clicking on the 'method prefix' button, the request will cause Struts to invoke 'submit'
- action alias's 'alternateMethod' method instead of the default 'execute' method.<p/>
-
- <b>Redirect Prefix</b><br/>
- By clicking on the 'redirect prefix' button, the request will get redirected to www.google.com
- instead<p/>
-
- <b>Redirect Action Prefix</b><br/>
- By clicking on the 'redirect-action prefix' button, the request will get redirected to
- an action alias of 'redirectActionPrefix' instead of 'submit' action alias. Since this is a
- redirect (a new request is issue from the client), the text entered will be lost.<p/>
-
-
- <@s.url id="url" action="viewSource" namespace="/tags/non-ui/actionPrefix" />
- The JSP code can be read <@s.a href="%{#url}">here</...@s.a>.
-
-
- <@s.form action="submit" namespace="/tags/non-ui/actionPrefix" method="POST">
-
- <@s.textfield label="Enter Some Text" name="text" />
-
- <@s.submit name="action:actionPrefix" value="%{'action prefix'}" />
-
- <@s.submit name="method:alternateMethod" value="%{'method prefix'}" />
-
- <@s.submit name="redirect:http://www.google.com" value="%{'redirect prefix'}" />
-
- <@s.submit name="redirect-action:redirectActionPrefix" value="%{'redirect-action prefix'}" />
-
- <@s.submit value="Normal Submit" />
+<head>
+ <title>Struts2 Showcase - Non UI Tags - Action Prefix (Freemarker)</title>
+</head>
+<body>
+<div class="page-header">
+ <h1>Non Ui Tag - Action Prefix (Freemarker)</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <b>Action Prefix</b><br/>
+ By clicking on 'action prefix' button, the request will go to the action alias 'actionPrefix'
+ instead of the normal 'submit' action alias. <p/><p/>
+
+ <b>Method Prefix</b><br/>
+ By clicking on the 'method prefix' button, the request will cause Struts to invoke 'submit'
+ action alias's 'alternateMethod' method instead of the default 'execute' method.<p/>
+
+ <b>Redirect Prefix</b><br/>
+ By clicking on the 'redirect prefix' button, the request will get redirected to www.google.com
+ instead<p/>
+
+ <b>Redirect Action Prefix</b><br/>
+ By clicking on the 'redirect-action prefix' button, the request will get redirected to
+ an action alias of 'redirectActionPrefix' instead of 'submit' action alias. Since this is a
+ redirect (a new request is issue from the client), the text entered will be lost.<p/>
+
+
+ <@s.url id="url" action="viewSource" namespace="/tags/non-ui/actionPrefix" />
+ The JSP code can be read <@s.a href="%{#url}">here</...@s.a>.
+
+
+ <@s.form action="submit" namespace="/tags/non-ui/actionPrefix" method="POST">
+
+ <@s.textfield label="Enter Some Text" name="text" />
+
+ <@s.submit name="action:actionPrefix" value="%{'action prefix'}" cssClass="btn" />
+
+ <@s.submit name="method:alternateMethod" value="%{'method prefix'}" cssClass="btn" />
+
+ <@s.submit name="redirect:http://www.google.com" value="%{'redirect prefix'}" cssClass="btn" />
+
+ <@s.submit name="redirect-action:redirectActionPrefix" value="%{'redirect-action prefix'}" cssClass="btn" />
+
+ <@s.submit value="Normal Submit" cssClass="btn" />
- <@s.submit name="action:redirectActionPrefixAction" value="%{'redirect-action without prefix'}" />
+ <@s.submit name="action:redirectActionPrefixAction" value="%{'redirect-action without prefix'}" cssClass="btn" />
- </...@s.form>
- </body>
+ </...@s.form>
+ </div>
+ </div>
+</div>
+</body>
</html>