You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by mr...@apache.org on 2006/01/25 07:27:40 UTC
svn commit: r372134 - in /struts/flow/trunk/xdocs: guess-example.xml
index.xml remote-example.xml templates-example.xml wizard-example.xml
Author: mrdon
Date: Tue Jan 24 22:27:37 2006
New Revision: 372134
URL: http://svn.apache.org/viewcvs?rev=372134&view=rev
Log:
Updating docs with new controller/view convention
Modified:
struts/flow/trunk/xdocs/guess-example.xml
struts/flow/trunk/xdocs/index.xml
struts/flow/trunk/xdocs/remote-example.xml
struts/flow/trunk/xdocs/templates-example.xml
struts/flow/trunk/xdocs/wizard-example.xml
Modified: struts/flow/trunk/xdocs/guess-example.xml
URL: http://svn.apache.org/viewcvs/struts/flow/trunk/xdocs/guess-example.xml?rev=372134&r1=372133&r2=372134&view=diff
==============================================================================
--- struts/flow/trunk/xdocs/guess-example.xml (original)
+++ struts/flow/trunk/xdocs/guess-example.xml Tue Jan 24 22:27:37 2006
@@ -18,7 +18,7 @@
<p>The core of the number guessing game application is the NumberGuess controller. This controller defines two actions, <code>play</code> and <code>endGame</code>. Here is what the flow code looks like:
</p>
<pre>
-NumberGuess = function() {
+GuessController = function() {
this.play = function() {
this.random = Math.round( Math.random() * 9 ) + 1;
@@ -62,7 +62,7 @@
<section name="JSP Presentation">
<a name="jsp"/>
<p>
- You might notice we aren't explicitly forwarding to any JSP pages. Struts Flow will automatically forward the request to a JSP page with the same name as the action. Therefore, when we "wait" in the <code>play()</code> action, the <code>jsp/play.jsp</code> page is shown.
+ You might notice we aren't explicitly forwarding to any JSP pages. Struts Flow will automatically forward the request to a JSP page with the same name as the action. Therefore, when we "wait" in the <code>play()</code> action, the <code>views/guess/play.jsp</code> page is shown.
</p>
<p>To gather the user's guess, <code>play.jsp</code> generates a form:</p>
<pre>
Modified: struts/flow/trunk/xdocs/index.xml
URL: http://svn.apache.org/viewcvs/struts/flow/trunk/xdocs/index.xml?rev=372134&r1=372133&r2=372134&view=diff
==============================================================================
--- struts/flow/trunk/xdocs/index.xml (original)
+++ struts/flow/trunk/xdocs/index.xml Tue Jan 24 22:27:37 2006
@@ -14,7 +14,7 @@
<p>Here is a Javascript controller for a simple "Hello World" application that contains a single action - <code>say</code> - that sets the name for the message:</p>
<pre>
-HelloWorld = function() {
+HelloController = function() {
this.say = function() {
this.name = "Struts Flow!";
}
@@ -26,12 +26,12 @@
<pre>
<html>
<body>
- Hello world from ${name}!
+ Hello from ${name}!
</body>
</html>
</pre>
<p>
- That's it - zero configuration required! The <code>say</code> action would be called using the <code>http://localhost:8080/example/HelloWord/say.do</code> URL. There are more
+ That's it - zero configuration required! The <code>say</code> action would be called using the <code>http://localhost:8080/example/hello/say.do</code> URL. There are more
detailed examples in the <a href="#examples">Examples</a> section.
</p>
Modified: struts/flow/trunk/xdocs/remote-example.xml
URL: http://svn.apache.org/viewcvs/struts/flow/trunk/xdocs/remote-example.xml?rev=372134&r1=372133&r2=372134&view=diff
==============================================================================
--- struts/flow/trunk/xdocs/remote-example.xml (original)
+++ struts/flow/trunk/xdocs/remote-example.xml Tue Jan 24 22:27:37 2006
@@ -24,7 +24,7 @@
<p>Here is what the flow code looks like:
</p>
<pre>
-NumberGuess = function() {
+GuessController = function() {
this.play = function() {
@@ -73,7 +73,7 @@
</section>
<section name="JSP Presentation">
<a name="jsp"/>
- <p>This example adds the "cheat" button to the number guessing form, <code>guess.jsp</code>. When
+ <p>This example adds the "cheat" button to the number guessing form, <code>play.jsp</code>. When
pressed, the Javascript uses <a href="http://dojotoolkit.org">Dojo Javascript Toolkit</a> to call the cheat() function on the server.</p>
<pre>
<html>
Modified: struts/flow/trunk/xdocs/templates-example.xml
URL: http://svn.apache.org/viewcvs/struts/flow/trunk/xdocs/templates-example.xml?rev=372134&r1=372133&r2=372134&view=diff
==============================================================================
--- struts/flow/trunk/xdocs/templates-example.xml (original)
+++ struts/flow/trunk/xdocs/templates-example.xml Tue Jan 24 22:27:37 2006
@@ -57,7 +57,7 @@
function renderTemplate(page, bizdata) {
var res = flow.context.response;
- var stream = struts.servletContext.getResourceAsStream("/WEB-INF/templates/jt/"+page+".jt");
+ var stream = struts.servletContext.getResourceAsStream("/WEB-INF/templates/views/guess/"+page+".jt");
if (stream != null) {
var text = new String(stream.getText());
var html = text.process(bizdata);
Modified: struts/flow/trunk/xdocs/wizard-example.xml
URL: http://svn.apache.org/viewcvs/struts/flow/trunk/xdocs/wizard-example.xml?rev=372134&r1=372133&r2=372134&view=diff
==============================================================================
--- struts/flow/trunk/xdocs/wizard-example.xml (original)
+++ struts/flow/trunk/xdocs/wizard-example.xml Tue Jan 24 22:27:37 2006
@@ -26,11 +26,11 @@
<p>Here is what the flow code for the Registration controller looks like:
</p>
<pre>
-flow.load("/WEB-INF/wizard/flow/wizard.js");
+flow.load("/WEB-INF/wizard/controllers/wizard.js");
-Registration = function() {
+RegistrationController = function() {
- this.start = function() {
+ this.register = function() {
var model = new java.util.HashMap();
var wizard = new Wizard(model);
@@ -86,7 +86,7 @@
</p>
<center style="color:red"><%=(request.getAttribute("errors") != null ? request.getAttribute("errors") : "")%></center>
- <form action="start.do" method="POST">
+ <form action="register.do" method="POST">
<% java.util.Map form = (java.util.Map)request.getAttribute("form"); %>
<table>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org