Author: steveh
Date: Thu Oct 28 13:24:33 2004
New Revision: 55891
Modified:
incubator/beehive/site/build/site/Controls.html
incubator/beehive/site/build/site/building.html
incubator/beehive/site/build/site/contributors.html
incubator/beehive/site/build/site/controls/tutorial_controls.html
incubator/beehive/site/build/site/downloads.html
incubator/beehive/site/build/site/faq.html
incubator/beehive/site/build/site/index.html
incubator/beehive/site/build/site/license.html
incubator/beehive/site/build/site/mailinglists.html
incubator/beehive/site/build/site/pageflow/guide.html
incubator/beehive/site/build/site/pageflow/tutorial_pageflow.html
incubator/beehive/site/build/site/reference.html
incubator/beehive/site/build/site/webservices.html
incubator/beehive/site/build/site/wsm/sample_AddressBook.html
incubator/beehive/site/build/site/wsm/tutorial_wsm.html
incubator/beehive/site/src/documentation/content/xdocs/pageflow/guide.xml
incubator/beehive/site/src/documentation/content/xdocs/site.xml
incubator/beehive/site/src/documentation/content/xdocs/wsm/sample_AddressBook.xml
incubator/beehive/site/src/documentation/content/xdocs/wsm/tutorial_wsm.xml
Log:
Latest updates to Incubator site.
Modified: incubator/beehive/site/build/site/Controls.html
==============================================================================
--- incubator/beehive/site/build/site/Controls.html (original)
+++ incubator/beehive/site/build/site/Controls.html Thu Oct 28 13:24:33 2004
@@ -130,6 +130,9 @@
<a href="pageflow/tutorial_pageflow.html">Page Flow Tutorial</a>
</li>
+<li>
+<a href="pageflow/guide.html">Page Flow Programming</a>
+</li>
</ul>
</li>
@@ -153,6 +156,9 @@
<font color="#CFDCED">Web Services</font>
<ul>
+<li>
+<a href="wsm/tutorial_wsm.html">Web Services Tutorial</a>
+</li>
<li>
<a href="webservices.html">Web Services (JSR 181)</a>
Modified: incubator/beehive/site/build/site/building.html
==============================================================================
--- incubator/beehive/site/build/site/building.html (original)
+++ incubator/beehive/site/build/site/building.html Thu Oct 28 13:24:33 2004
@@ -130,6 +130,9 @@
<a href="pageflow/tutorial_pageflow.html">Page Flow Tutorial</a>
</li>
+<li>
+<a href="pageflow/guide.html">Page Flow Programming</a>
+</li>
</ul>
</li>
@@ -153,6 +156,9 @@
<font color="#CFDCED">Web Services</font>
<ul>
+<li>
+<a href="wsm/tutorial_wsm.html">Web Services Tutorial</a>
+</li>
<li>
<a href="webservices.html">Web Services (JSR 181)</a>
Modified: incubator/beehive/site/build/site/contributors.html
==============================================================================
--- incubator/beehive/site/build/site/contributors.html (original)
+++ incubator/beehive/site/build/site/contributors.html Thu Oct 28 13:24:33 2004
@@ -130,6 +130,9 @@
<a href="pageflow/tutorial_pageflow.html">Page Flow Tutorial</a>
</li>
+<li>
+<a href="pageflow/guide.html">Page Flow Programming</a>
+</li>
</ul>
</li>
@@ -153,6 +156,9 @@
<font color="#CFDCED">Web Services</font>
<ul>
+<li>
+<a href="wsm/tutorial_wsm.html">Web Services Tutorial</a>
+</li>
<li>
<a href="webservices.html">Web Services (JSR 181)</a>
Modified: incubator/beehive/site/build/site/controls/tutorial_controls.html
==============================================================================
--- incubator/beehive/site/build/site/controls/tutorial_controls.html
(original)
+++ incubator/beehive/site/build/site/controls/tutorial_controls.html Thu Oct
28 13:24:33 2004
@@ -130,6 +130,9 @@
<a href="../pageflow/tutorial_pageflow.html">Page Flow Tutorial</a>
</li>
+<li>
+<a href="../pageflow/guide.html">Page Flow Programming</a>
+</li>
</ul>
</li>
@@ -153,6 +156,9 @@
<font color="#CFDCED">Web Services</font>
<ul>
+<li>
+<a href="../wsm/tutorial_wsm.html">Web Services Tutorial</a>
+</li>
<li>
<a href="../webservices.html">Web Services (JSR 181)</a>
Modified: incubator/beehive/site/build/site/downloads.html
==============================================================================
--- incubator/beehive/site/build/site/downloads.html (original)
+++ incubator/beehive/site/build/site/downloads.html Thu Oct 28 13:24:33 2004
@@ -130,6 +130,9 @@
<a href="pageflow/tutorial_pageflow.html">Page Flow Tutorial</a>
</li>
+<li>
+<a href="pageflow/guide.html">Page Flow Programming</a>
+</li>
</ul>
</li>
@@ -153,6 +156,9 @@
<font color="#CFDCED">Web Services</font>
<ul>
+<li>
+<a href="wsm/tutorial_wsm.html">Web Services Tutorial</a>
+</li>
<li>
<a href="webservices.html">Web Services (JSR 181)</a>
Modified: incubator/beehive/site/build/site/faq.html
==============================================================================
--- incubator/beehive/site/build/site/faq.html (original)
+++ incubator/beehive/site/build/site/faq.html Thu Oct 28 13:24:33 2004
@@ -130,6 +130,9 @@
<a href="pageflow/tutorial_pageflow.html">Page Flow Tutorial</a>
</li>
+<li>
+<a href="pageflow/guide.html">Page Flow Programming</a>
+</li>
</ul>
</li>
@@ -153,6 +156,9 @@
<font color="#CFDCED">Web Services</font>
<ul>
+<li>
+<a href="wsm/tutorial_wsm.html">Web Services Tutorial</a>
+</li>
<li>
<a href="webservices.html">Web Services (JSR 181)</a>
Modified: incubator/beehive/site/build/site/index.html
==============================================================================
--- incubator/beehive/site/build/site/index.html (original)
+++ incubator/beehive/site/build/site/index.html Thu Oct 28 13:24:33 2004
@@ -130,6 +130,9 @@
<a href="pageflow/tutorial_pageflow.html">Page Flow Tutorial</a>
</li>
+<li>
+<a href="pageflow/guide.html">Page Flow Programming</a>
+</li>
</ul>
</li>
@@ -153,6 +156,9 @@
<font color="#CFDCED">Web Services</font>
<ul>
+<li>
+<a href="wsm/tutorial_wsm.html">Web Services Tutorial</a>
+</li>
<li>
<a href="webservices.html">Web Services (JSR 181)</a>
Modified: incubator/beehive/site/build/site/license.html
==============================================================================
--- incubator/beehive/site/build/site/license.html (original)
+++ incubator/beehive/site/build/site/license.html Thu Oct 28 13:24:33 2004
@@ -130,6 +130,9 @@
<a href="pageflow/tutorial_pageflow.html">Page Flow Tutorial</a>
</li>
+<li>
+<a href="pageflow/guide.html">Page Flow Programming</a>
+</li>
</ul>
</li>
@@ -153,6 +156,9 @@
<font color="#CFDCED">Web Services</font>
<ul>
+<li>
+<a href="wsm/tutorial_wsm.html">Web Services Tutorial</a>
+</li>
<li>
<a href="webservices.html">Web Services (JSR 181)</a>
Modified: incubator/beehive/site/build/site/mailinglists.html
==============================================================================
--- incubator/beehive/site/build/site/mailinglists.html (original)
+++ incubator/beehive/site/build/site/mailinglists.html Thu Oct 28 13:24:33 2004
@@ -130,6 +130,9 @@
<a href="pageflow/tutorial_pageflow.html">Page Flow Tutorial</a>
</li>
+<li>
+<a href="pageflow/guide.html">Page Flow Programming</a>
+</li>
</ul>
</li>
@@ -153,6 +156,9 @@
<font color="#CFDCED">Web Services</font>
<ul>
+<li>
+<a href="wsm/tutorial_wsm.html">Web Services Tutorial</a>
+</li>
<li>
<a href="webservices.html">Web Services (JSR 181)</a>
Modified: incubator/beehive/site/build/site/pageflow/guide.html
==============================================================================
--- incubator/beehive/site/build/site/pageflow/guide.html (original)
+++ incubator/beehive/site/build/site/pageflow/guide.html Thu Oct 28
13:24:33 2004
@@ -171,9 +171,6 @@
<font color="#CFDCED">Samples</font>
<ul>
-<li>
-<a href="../jpetstore.html">Beehive Samples: JPetStore</a>
-</li>
<li>
<a href="../wsm/sample_AddressBook.html">WSM Sample: AddressBook</a>
@@ -258,7 +255,7 @@
</table>
<ul class="minitoc">
<li>
-<a href="#intro">What's So Great About Page Flows?</a>
+<a href="#intro">Advantages of Programming with Page Flows</a>
</li>
<li>
<a href="#How+Do+Page+Flows+Work%3F">How Do Page Flows Work?</a>
@@ -267,13 +264,7 @@
<a href="#nav">Navigation</a>
</li>
<li>
-<a href="#submit">Submitting Data: Form Beans, and Data Binding</a>
-</li>
-<li>
-<a href="#processing_data">Processing Data</a>
-</li>
-<li>
-<a href="#displaying_data">Displaying Data</a>
+<a href="#submit">Submitting Data: Form Beans and Data Binding</a>
</li>
<li>
<a href="#controls">Accessing Back-End Resources with Controls</a>
@@ -287,7 +278,7 @@
</ul>
<a name="N1000C"></a><a name="intro"></a>
-<h3>What's So Great About Page Flows?</h3>
+<h3>Advantages of Programming with Page Flows</h3>
<div style="margin-left: 0 ; border: 2px">
<p>Page Flows make building Java web applications easy and intuitive. When
programming with Page Flows, the developer writes Java files and JSP
pages--that's it. There is very little occasion to work with configuration
files, or other components. Page Flow programming is not only simple, it is
also excells at separating the presentation logic from the data processing
logic. This results in uncluttered JSP code which is easy to understand and
edit. Moreover, many of the most difficult programming tasks, such as security
and validation, are handled with a simple declarative programming model using
Java annotations.</p>
</div>
@@ -309,29 +300,238 @@
<a name="N1002C"></a><a name="nav"></a>
<h3>Navigation</h3>
-<div style="margin-left: 0 ; border: 2px"></div>
-
-<a name="N10033"></a><a name="submit"></a>
-<h3>Submitting Data: Form Beans, and Data Binding</h3>
-<div style="margin-left: 0 ; border: 2px"></div>
-
-<a name="N1003A"></a><a name="processing_data"></a>
-<h3>Processing Data</h3>
-<div style="margin-left: 0 ; border: 2px"></div>
+<div style="margin-left: 0 ; border: 2px">
+<p>
+
+<strong>Introduction</strong>
+
+</p>
+<p>Suppose you have two JSP pages, pageA.jsp and pageB.jsp. Also, suppose you
want to place a link on pageA, that will navigate the user to pageB.</p>
+<p>One solution would be to place an HTML anchor tag (<a>) on pageA that
links to pageB. But what if you had dozens of pages that needed to link to
pageB? You could repeat the anchor tag solution a dozen times, by placing an
anchor tag on each page that required a link to pageB. But this solution
becomes cumbersome if you ever need to edit those links. At some point in the
future, you may want to change those links, so that they navigate to another
page, say to pageC. But this would require sifting through all of your web
site's JSP pages for anchor tags to edit.</p>
+<p>Page Flows solve this problem by placing navigational control within a
single file: the Controller file (=JPF file). Methods within the Controller
file decide the target page, whether it is pageB, pageC, or somewhere else.
The job of the JSP page is to invoke the method, not to directly link to
another JSP page. The work of navigation in a Page Flow breaks down to a two
step process: (1) The JSP page invokes a method in the Controller file, then
(2) the method navigates the user to the target page.</p>
+<p>
+
+<strong>How the Code Works</strong>
+
+</p>
+<p>Methods in the Controller file are invoked through specially designed JSP
tags, called "netui" tags. These tags appear with the prefix
<strong><netui:></strong>. (Tags with the <netui:> reference the
netui-tags-html.tld tag library.) Neuti tags like <neuti:anchor>,
<netui:button>, and <netui:imageButton> are all capable of invoking
methods in the Controller file. The method to invoke is specified by the tag's
<span class="codefrag">action</span> attribute. For example, the following
<netui:anchor> tag invokes the <span class="codefrag">toPageB</span>
method by referencing the method in it's <span class="codefrag">action</span>
attribute.</p>
+<p>
+
+<strong>pageA.jsp</strong>
+
+</p>
+<pre class="code">
+ <!-- Import the netui-tags-html.tld tag library -->
+ <%@ taglib uri="netui-tags-html.tld" prefix="netui"%>
+ ...
+ <!-- Render a link that invokes the toPageB method -->
+ <netui:anchor <strong>action="toPageB"</strong>>Link to
page_B.jsp</netui:anchor>
+</pre>
+<p>(When pageA.jsp is viewed in a broswer, the <netui:anchor> tag is
rendered as ordinary HTML, with associated JavaScript which handles the
invocation.... [todo] )</p>
+<p>Suppose the link above is clicked. When clicked, the following method,
<span class="codefrag">toPageB</span>, is invoked.</p>
+<p>The method below, when invoked, navigates the user to pageB.jsp. The code
within the method body is very simple: upon invocation, the method immediately
returns a Forward object, with the String parameter "success". The code
<em>above</em> the method does the real work of determining the navigational
target. The code above the method consists of two metadata annotations.
"Metadata" means that the annotation configures or sets a property on some part
of the Java code. In the example below, the @Jpf.Action annotation makes the
method available to invocation (by netui tags), while the @Jpf.Forward
annotation configures the navigation information. In the this case the method
it configured to navigate to pageB.jsp whenever it is invoked. </p>
+<p>
+
+<strong>Controller.jpf</strong>
+
+</p>
+<pre class="code">
+import org.apache.beehive.netui.pageflow.Forward;
+...
+ @Jpf.Action(
+ forwards = {
+ @Jpf.Forward(name = "<strong>success</strong>", path =
"<strong>pageB.jsp</strong>")
+ }
+ )
+ protected Forward navigate()
+ {
+ return new Forward("success");
+ }</pre>
+<p>Metadata annotations are typically compiled into XML configuration files,
or some other post-compilation artifact. Sometimes the artifacts are very
complex, as in the case of the @WebService annotation. But in other case the
post-compilation artifact is simple: for example, the @jpf:forward annotation
compiles into an entry in the [todo] configuration file.</p>
+<p>The first annotation, <span class="codefrag">@jpf:action</span>, declares
that method is an Action method. Action methods are ...[todo]</p>
+<p>The second annotation, <span class="codefrag">@jpf:forward</span>,
configures the [todo]. As a result, at runtime, when the toPageB method is
invoked (say by the clicking of a <netui:anchor> tag), the [todo]
configuration file is consulted, and the user is navigated to pageB.jsp.</p>
+<p>
+
+<strong>Changing the Navigation Target</strong>
+
+</p>
+<p>To change the navigation target of this action method, simply change the
value of the path attribute. For example, if you want this action method to
navigate to pageC.jsp, you would make the following change to the controller
file (no change to the JSP page is necessary).</p>
+<pre class="code">
+ @Jpf.Action(
+ forwards = {
+ @Jpf.Forward(name = "success", path = "<strong>pageC.jsp</strong>")
+ }
+ )
+ protected Forward navigate()
+ {
+ return new Forward("success");
+ }</pre>
+<p>
+
+<strong>Conditional Navigation</strong>
+
+</p>
+<p>By placing navigational control in the Controller file, you can control
conditional navigation.</p>
+<p>The following example is from the Petstore sample. The <span
class="codefrag">begin</span> method checks to see if the user is logged in or
not, and navigates the user appropriately.</p>
+<p>
+
+<strong>
+ <span
class="codefrag">beehive/trunk/samples/petstoreWeb/Controller.jpf</span>
+ </strong>
+
+</p>
+<pre class="code">
+ @Jpf.Action(
+ forwards = {
+ @Jpf.Forward(name = "shop", path = "/shop/Controller.jpf"),
+ @Jpf.Forward(name = "index", path = "/index.jsp")
+ }
+ )
+ protected Forward begin()
+ {
+ if (_sharedFlow.isUserLoggedIn())
+ return new Forward("shop");
+ else return new Forward("index");
+ }
+</pre>
+<p>
+Putting it all together, a Forward object is returned by an action method. The
Forward object passes the string "success", indicating that it should behave
according to the directions encoded in the annotation @jpf:forward
name="success". That annotation's path attribute has the value "page_B.jsp",
which causes the page flow controller to load page_B.jsp into the browser.
+
+</p>
+</div>
-<a name="N10041"></a><a name="displaying_data"></a>
-<h3>Displaying Data</h3>
-<div style="margin-left: 0 ; border: 2px"></div>
+<a name="N100C9"></a><a name="submit"></a>
+<h3>Submitting Data: Form Beans and Data Binding</h3>
+<div style="margin-left: 0 ; border: 2px">
+<p>
+<!--
+Suppose you want to your web application to collect data from users and then
process that data in some way. The following example demonstrates how to set up
a data submission process using page flows. The sample code referred to in this
example can be found at:
+
+BEA_HOME>\weblogic81\samples\workshop\SamplesApp\WebApp\handlingData\simpleSubmit\
+
+Submitting data is a two step process: (1) the data submitted from a JSP page
is loaded into a Form Bean instance and (2) the Form Bean instance is passed to
an action method for processing.
+
+
+
+Form Beans are simple Java classes with fields and setter and getter methods
for accessing those fields. Form Beans classes are contained within the
controller file. In most cases, Form Beans are designed to accept data
submitted from JSP forms. For example, if a JSP page has input elements for
name, eye_color, and height, then the Form Bean will have corresponding fields
for name, eye_color, and height. The following example Form Bean can be found
in the controller file SimpleSubmitController.jpf. It contains one field, name,
and setter and getter methods for that field.
+
+ SimpleSubmitController.jpf
+
+ public class SimpleSubmitController extends PageFlowController
+ {
+
+ ...
+
+ public static class SubmitNameForm extends FormData
+ {
+ private String name;
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return this.name;
+ }
+ }
+ }
+
+The input elements on the JSP page are said to be "data bound" to the fields
in the Form Bean. Data binding allows the the data submitted from the JSP page
to be loaded into the Form Bean instance. For example, the input element on
index.jsp contains a data binding expression that refers to the name field of
the Form Bean: {actionForm.name}. The expression "actionForm" refers to the
Form Bean SubmitNameForm, the property ".name" refers to the name field of the
Form Bean. For detailed information about data binding see Using Data Binding
in Page Flows.
+
+ index.jsp
+ <netui:form action="SubmitName">
+ Name: <netui:textBox dataSource="{actionForm.name}"/>
+ ....
+ </netui:form>
+Finally the Form Bean instance (carrying the submitted data) is passed to the
action method for processing.
+
+ /**
+ * @jpf:action
+ * @jpf:forward name="success" path="showName.jsp"
+ */
+ protected Forward SubmitName(SubmitNameForm form)
+ {
+ //
+ // The data is processed here
+ //
+
+ return new Forward("success");
+ }
+
+The submitted data can be accessed by calling the getter methods on the Form
Bean.
+
+ /**
+ * @jpf:action
+ * @jpf:forward name="success" path="showName.jsp"
+ */
+ protected Forward SubmitName(SubmitNameForm form)
+ {
+ if( form.getName() != null )
+ // do something here
+ else
+ // do something else here
+
+ return new Forward("success");
+ }
+
+By default the Form Bean instance that is passed to the action method exists
only as long as the HTTP request. This is called a "request-scoped Form Bean".
When the HTTP request is destroyed, the Form Bean instance, along with the user
submitted data, is destroyed. As an alternative, you can use a Page Flow-scoped
Form Bean, which has a longer life cycle. For details see Form Bean Scopings.
+
+</p>
+ </section>
+ <section id="processing_data">
+ <title>Processing Data</title>
+ </section>
+ <section id="displaying_data">
+ <title>Displaying Data</title>
+ <p>
+Displaying Data: A Simple Example
+
+Suppose that once you have collected data, you want to display it back to the
user. The following example shows how to use data binding to display data to
the user. The sample code referred to can be found at:
+
+<BEA_HOME>\weblogic81\samples\workshop\SamplesApp\WebApp\handlingData\simpleSubmit\
+
+Displaying data using data binding requires that (1) the data is located
somewhere where it can accessed by the JSP page and (2) the JSP page uses a
data binding expression to retrieve the data from that location.
+
+Notice the syntax of data binding expression on the JSP page. (1) It is framed
by curley braces, (2) it begins with a data binding context, in this case the
request context, and (3) the context is followed by an attribute, in this case
"name".
+
+In the following example, an action method places data on the name attribute
of the request object.
+
+ SimpleSubmitController.jpf
+
+ /**
+ * @jpf:action
+ * @jpf:forward name="success" path="showName.jsp"
+ */
+ protected Forward SubmitName(SubmitNameForm form)
+ {
+ getRequest().setAttribute("name", form.getName());
+ return new Forward("success");
+ }
+
+After the data has been located on the name attribute of the request object,
it is displayed on a JSP page using a data binding expression.
+
+ showName.jsp
+
+ Here is the data you submitted: <netui:label value="{request.name}" />
+
+Note that the request object has a relatively short life-cycle. When the user
makes a new request, by navigating to a new JSP page or invoking another action
method, the current request object is destroyed along with the data it
contains. If your application requires the data to be more persistent, then you
could use a different data binding context, for example the session object or a
Page Flow-scoped Form Bean, which both have longer life-cycles. For detailed
information about the different data binding contexts available, see Using Data
Binding in Page Flows.
+
+-->
+
+</p>
+</div>
-<a name="N10048"></a><a name="controls"></a>
+<a name="N100D5"></a><a name="controls"></a>
<h3>Accessing Back-End Resources with Controls</h3>
<div style="margin-left: 0 ; border: 2px"></div>
-<a name="N1004F"></a><a name="validation"></a>
+<a name="N100DC"></a><a name="validation"></a>
<h3>Validation</h3>
<div style="margin-left: 0 ; border: 2px"></div>
-<a name="N10056"></a><a name="security"></a>
+<a name="N100E3"></a><a name="security"></a>
<h3>Security</h3>
<div style="margin-left: 0 ; border: 2px"></div>
Modified: incubator/beehive/site/build/site/pageflow/tutorial_pageflow.html
==============================================================================
--- incubator/beehive/site/build/site/pageflow/tutorial_pageflow.html
(original)
+++ incubator/beehive/site/build/site/pageflow/tutorial_pageflow.html Thu Oct
28 13:24:33 2004
@@ -130,6 +130,9 @@
<span class="sel"><font color="#ffcc00">Page Flow Tutorial</font></span>
</li>
+<li>
+<a href="../pageflow/guide.html">Page Flow Programming</a>
+</li>
</ul>
</li>
@@ -153,6 +156,9 @@
<font color="#CFDCED">Web Services</font>
<ul>
+<li>
+<a href="../wsm/tutorial_wsm.html">Web Services Tutorial</a>
+</li>
<li>
<a href="../webservices.html">Web Services (JSR 181)</a>
Modified: incubator/beehive/site/build/site/reference.html
==============================================================================
--- incubator/beehive/site/build/site/reference.html (original)
+++ incubator/beehive/site/build/site/reference.html Thu Oct 28 13:24:33 2004
@@ -130,6 +130,9 @@
<a href="pageflow/tutorial_pageflow.html">Page Flow Tutorial</a>
</li>
+<li>
+<a href="pageflow/guide.html">Page Flow Programming</a>
+</li>
</ul>
</li>
@@ -153,6 +156,9 @@
<font color="#CFDCED">Web Services</font>
<ul>
+<li>
+<a href="wsm/tutorial_wsm.html">Web Services Tutorial</a>
+</li>
<li>
<a href="webservices.html">Web Services (JSR 181)</a>
Modified: incubator/beehive/site/build/site/webservices.html
==============================================================================
--- incubator/beehive/site/build/site/webservices.html (original)
+++ incubator/beehive/site/build/site/webservices.html Thu Oct 28 13:24:33 2004
@@ -130,6 +130,9 @@
<a href="pageflow/tutorial_pageflow.html">Page Flow Tutorial</a>
</li>
+<li>
+<a href="pageflow/guide.html">Page Flow Programming</a>
+</li>
</ul>
</li>
@@ -153,6 +156,9 @@
<font color="#CFDCED">Web Services</font>
<ul>
+<li>
+<a href="wsm/tutorial_wsm.html">Web Services Tutorial</a>
+</li>
<li>
<span class="sel"><font color="#ffcc00">Web Services (JSR 181)</font></span>
Modified: incubator/beehive/site/build/site/wsm/sample_AddressBook.html
==============================================================================
--- incubator/beehive/site/build/site/wsm/sample_AddressBook.html
(original)
+++ incubator/beehive/site/build/site/wsm/sample_AddressBook.html Thu Oct
28 13:24:33 2004
@@ -130,6 +130,9 @@
<a href="../pageflow/tutorial_pageflow.html">Page Flow Tutorial</a>
</li>
+<li>
+<a href="../pageflow/guide.html">Page Flow Programming</a>
+</li>
</ul>
</li>
@@ -153,6 +156,9 @@
<font color="#CFDCED">Web Services</font>
<ul>
+<li>
+<a href="../wsm/tutorial_wsm.html">Web Services Tutorial</a>
+</li>
<li>
<a href="../webservices.html">Web Services (JSR 181)</a>
@@ -319,10 +325,12 @@
<li>Set CATALINA_HOME to be the installed directory of the server. (For
example, <span class="codefrag">set
CATALINA_HOME=C:\beehive-src\trunk\installed\jakarta-tomcat-5.0.25</span>)</li>
-<li>Build the AddressBook Sample</li>
+<li>Build the Backend Java Types of the AddressBook Sample</li>
<ul>
+<li>Note: this step is necessary to build the Java types in
/AddressBook/server/src/org/beehive/demo. The web service file itself
(AddressBook.jws), does not need to be pre-compiled, because of the Axis
drop-in deployment model.</li>
+
<li>cd to <span
class="codefrag">BEEHIVE_HOME/wsm/samples/dropInDeployment/AddressBook/server</span>
</li>
@@ -362,7 +370,7 @@
</ol>
</div>
-<a name="N100A6"></a><a name="Setting+up+the+Client"></a>
+<a name="N100A9"></a><a name="Setting+up+the+Client"></a>
<h4>Setting up the Client</h4>
<div style="margin-left: 0 ; border: 2px">
<p>Once the server is up and running, run the client to verify the server
Modified: incubator/beehive/site/build/site/wsm/tutorial_wsm.html
==============================================================================
--- incubator/beehive/site/build/site/wsm/tutorial_wsm.html (original)
+++ incubator/beehive/site/build/site/wsm/tutorial_wsm.html Thu Oct 28
13:24:33 2004
@@ -171,9 +171,6 @@
<font color="#CFDCED">Samples</font>
<ul>
-<li>
-<a href="../jpetstore.html">Beehive Samples: JPetStore</a>
-</li>
<li>
<a href="../wsm/sample_AddressBook.html">WSM Sample: AddressBook</a>
@@ -275,7 +272,7 @@
<a href="#Download+and+Install+JDK5">Download and Install JDK5</a>
</li>
<li>
-<a href="#Install+ANT">Install ANT</a>
+<a href="#Install+ANT+1.6.2">Install ANT 1.6.2</a>
</li>
<li>
<a href="#Download+and+Install+Tomcat+5">Download and Install Tomcat 5</a>
@@ -286,6 +283,9 @@
<li>
<a href="#Set+up+the+Development+Environment">Set up the Development
Environment</a>
</li>
+<li>
+<a href="#Set+Up+Drop+In+Deployment">Set Up Drop In Deployment</a>
+</li>
</ul>
</li>
<li>
@@ -295,13 +295,18 @@
<a href="#Introduction">Introduction</a>
</li>
<li>
-<a href="#Set+Up+Drop+In+Deployment">Set Up Drop In Deployment</a>
+<a href="#To+Create+a+JWS+File">To Create a JWS File</a>
</li>
<li>
-<a href="#To+Create+a+JWS+File">To Create a JWS File</a>
+<a href="#Test+the+Web+Service%3A+URL+Invocation+of+the+web+service">Test the
Web Service: URL Invocation of the web service</a>
+</li>
+</ul>
</li>
<li>
-<a href="#Compile+the+Web+Service">Compile the Web Service</a>
+<a href="#step_3">Step 3: Add a Parameter to the hello Method</a>
+<ul class="minitoc">
+<li>
+<a href="#Edit+the+JWS+File">Edit the JWS File</a>
</li>
<li>
<a href="#Test+the+Web+Service">Test the Web Service</a>
@@ -330,7 +335,7 @@
<a name="N10028"></a><a
name="Note+on+the+Current+State+of+the+Web+Service+Tutorial"></a>
<h4>Note on the Current State of the Web Service Tutorial</h4>
<div style="margin-left: 0 ; border: 2px">
-<p>This tutorial is currently a work in progress, and will by changed and
amended in the coming weeks. The tutorial assumes that you are using a Windows
machine, however, with a little common sense it is very easy to run through the
tutorial on a Linux machine. For example, where the tutorial tells you to run
FOO.cmd, instead run FOO.sh.</p>
+<p>This tutorial is currently a work in progress, and will by changed and
amended in the coming weeks. The tutorial assumes that you are using a Windows
machine. But, with a little common sense, it is very easy to run through the
tutorial on a Linux machine. For example, where the tutorial tells you to run
FOO.cmd, instead run FOO.sh.</p>
<p>Please send any comments to Steve Hanson, at <span class="codefrag">steveh
at bea.com</span>.</p>
</div>
</div>
@@ -342,11 +347,11 @@
<h4>Download and Install JDK5</h4>
<div style="margin-left: 0 ; border: 2px">
<p>If you do not have JDK5 installed on your machine, visit <a target="_blank"
href="http://java.sun.com/j2se/1.5.0/download.jsp">http://java.sun.com/j2se/1.5.0/download.jsp</a>
and download and install the latest version. (Note: it is important that you
install version beta51 or later.)</p>
-<p>Throughout this tutorial, it is assumed that you have JDK 5 installed at
<span class="codefrag">C:\jdk1.5.0</span>.</p>
+<p>Throughout this tutorial, it is assumed that you have JDK 5 installed at
<span class="codefrag">C:/jdk1.5.0</span>.</p>
<p></p>
</div>
-<a name="N10055"></a><a name="Install+ANT"></a>
-<h4>Install ANT</h4>
+<a name="N10055"></a><a name="Install+ANT+1.6.2"></a>
+<h4>Install ANT 1.6.2</h4>
<div style="margin-left: 0 ; border: 2px">
<p>If you do not have Ant 1.6.2 installed on your machine, visit <a
target="_blank"
href="http://svn.apache.org/repos/asf/incubator/beehive/trunk/external/ant/apache-ant-1.6.2-bin.zip">http://svn.apache.org/repos/asf/incubator/beehive/trunk/external/ant/apache-ant-1.6.2-bin.zip</a>
</p>
@@ -364,228 +369,140 @@
<a name="N10087"></a><a
name="Download+and+Install+a+Beehive+Binary+Distribution"></a>
<h4>Download and Install a Beehive Binary Distribution</h4>
<div style="margin-left: 0 ; border: 2px">
-<p>Visit [tbd: distribution download link] and download the latest binary
distribution of Beehive.</p>
-<p>
- Create a directory called <span
class="codefrag">beehive-0.4</span> on your C: drive. Confirm that the the
following directory structure exists: <span
class="codefrag">C:/beehive-0.4</span>. This directory will store the Beehive
distribution JARs and all of your Beehive projects.
- </p>
+<p>Visit [todo: distribution download link] and download the latest binary
distribution of Beehive.</p>
+<p> Create a directory called <span class="codefrag">beehive-0.4</span> on
your C: drive. This directory will store the Beehive distribution JARs and all
of your Beehive projects.</p>
+<p>Unzip the distribution JAR into <span class="codefrag">C:/beehive-0.4</span>
+</p>
</div>
-<a name="N1009A"></a><a name="Set+up+the+Development+Environment"></a>
+<a name="N1009C"></a><a name="Set+up+the+Development+Environment"></a>
<h4>Set up the Development Environment</h4>
<div style="margin-left: 0 ; border: 2px">
-<p>At the command prompt, enter: <span class="codefrag">set
JAVA_HOME=C:\jdk1.5.0</span>
+<p>Open a command shell.</p>
+<p>At the command prompt, enter: <span class="codefrag">set
JAVA_HOME=C:/jdk1.5.0</span>
</p>
<p> Note: if you have JDK5 installed in a different
directory, set JAVA_HOME to that location.</p>
<p>At the command prompt, enter: <span class="codefrag">set
CATALINA_HOME=C:/jakarta-tomcat-5.0.25</span>
</p>
-<p>At the command prompt, enter: <span class="codefrag">set
ANT_HOME=C:\apache-ant-1.6.2</span>
+<p>At the command prompt, enter: <span class="codefrag">set
ANT_HOME=C:/apache-ant-1.6.2</span>
</p>
-<p>At the command prompt, enter: <span class="codefrag">set
PATH=%PATH%;C:\apache-ant-1.6.2\bin</span>
+<p>At the command prompt, enter: <span class="codefrag">set
PATH=%PATH%;C:/apache-ant-1.6.2/bin;C:/jdk1.5.0/bin</span>
</p>
<p>Leave the command shell open to use throughout the tutorial</p>
-<p>You are now ready to create a Beehive web service.
- </p>
+</div>
+<a name="N100C4"></a><a name="Set+Up+Drop+In+Deployment"></a>
+<h4>Set Up Drop In Deployment</h4>
+<div style="margin-left: 0 ; border: 2px">
+<p>Copy the folder <span class="codefrag">[todo]/AnnotatedAxis</span> into the
directory <span class="codefrag">C:/jakarta-tomcat-5.0.25/webapps</span>.</p>
+<p>Confirm that the following directory structure exists: <span
class="codefrag">C:/jakarta-tomcat-5.0.25/webapps/AnnotatedAxis</span>
+</p>
+<p>At the command prompt, enter: <span
class="codefrag">C:/jakarta-tomcat-5.0.25/bin/startup.bat</span>
+</p>
+<p>Visit <a target="_blank"
href="http://localhost:8080/AnnotatedAxis/index.html">http://localhost:8080/AnnotatedAxis/index.html</a>
to confirm AnnotatedAxis is installed on Tomcat. If you do not see an
information page on AnnotatedAxis, then something is wrong. Ensure that the
AnnotatedAxis directory has been copied to C:/jakarta-tomcat-5.0.25/webapps,
restart Tomcat, and try again.</p>
+<p>At the command prompt, enter: <span
class="codefrag">C:/jakarta-tomcat-5.0.25/bin/shutdown.bat</span>
+</p>
</div>
</div>
-<a name="N100C3"></a><a name="step_2"></a>
+<a name="N100EB"></a><a name="step_2"></a>
<h3>Step 2: Create a New Web Service</h3>
<div style="margin-left: 0 ; border: 2px">
-<a name="N100C9"></a><a name="Introduction"></a>
+<a name="N100F1"></a><a name="Introduction"></a>
<h4>Introduction</h4>
<div style="margin-left: 0 ; border: 2px">
-<p>[tbd]</p>
+<p>[todo]</p>
<p>
</p>
<p>
</p>
</div>
-<a name="N100D9"></a><a name="Set+Up+Drop+In+Deployment"></a>
-<h4>Set Up Drop In Deployment</h4>
-<div style="margin-left: 0 ; border: 2px">
-<p>Copy the folder <span class="codefrag">[tbd]/AnnotatedAxis</span> into the
directory <span class="codefrag">C:/jakarta-tomcat-5.0.25/webapps</span>.</p>
-<p>Confirm that the following directory structure exists: <span
class="codefrag">C:/jakarta-tomcat-5.0.25/webapps/AnnotatedAxis</span>
-</p>
-<p>At the command prompt, enter: <span
class="codefrag">C:/jakarta-tomcat-5.0.25/bin/startup.bat</span>
-</p>
-<p>Visit <a target="_blank"
href="http://localhost:8080/AnnotatedAxis/index.html">http://localhost:8080/AnnotatedAxis/index.html</a>
to confirm AnnotatedAxis is installed on Tomcat. If you do not see an
information page on AnnotatedAxis, then something is wrong. Ensure that
AnnotatedAxis directory is in C:/jakarta-tomcat-5.0.25/webapps, restart Tomcat,
and try again.</p>
-<p>At the command prompt, enter: <span
class="codefrag">C:/jakarta-tomcat-5.0.25/bin/shutdown.bat</span>
-</p>
-</div>
-<a name="N100FF"></a><a name="To+Create+a+JWS+File"></a>
+<a name="N10101"></a><a name="To+Create+a+JWS+File"></a>
<h4>To Create a JWS File</h4>
<div style="margin-left: 0 ; border: 2px">
-<p>In the directory <span
class="codefrag">C:/jakarta-tomcat-5.0.25/webapps/AnnotatedAxis</span>, create
a folder named <span class="codefrag">myWebservice</span>.</p>
-<p>In the directory <span
class="codefrag">C:/jakarta-tomcat-5.0.25/webapps/AnnotatedAxis/myWebservice</span>,
create a file named <span class="codefrag">HelloWorld.jws</span>.</p>
+<p>In the directory <span
class="codefrag">C:/jakarta-tomcat-5.0.25/webapps/AnnotatedAxis</span>, create
a folder named <span class="codefrag">ws_tutorial</span>.</p>
+<p>In the directory <span
class="codefrag">C:/jakarta-tomcat-5.0.25/webapps/AnnotatedAxis/ws_tutorial</span>,
create a file named <span class="codefrag">HelloWorld.jws</span>.</p>
<p>Edit HelloWorld.jws so it looks like the following:</p>
-<pre class="code">
-package myWebservice;
-
-import java.rmi.RemoteException;
-
-import javax.jws.Oneway;
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
+<pre class="code">
import javax.jws.WebService;
+import javax.jws.WebMethod;
[EMAIL PROTECTED](
targetNamespace="http://www.beehive.com/myWebService/HelloWorld")
-public class HelloWorld
[EMAIL PROTECTED]
+public class HelloWorld
{
- /**
- * @throws java.rmi.RemoteException
- */
+
@WebMethod
- public String hello() throws RemoteException
+ public String hello()
{
- return String "Hello, World!";
+ return "Hello, World!";
}
}
</pre>
</div>
-<a name="N10120"></a><a name="Compile+the+Web+Service"></a>
-<h4>Compile the Web Service</h4>
+<a name="N10122"></a><a
name="Test+the+Web+Service%3A+URL+Invocation+of+the+web+service"></a>
+<h4>Test the Web Service: URL Invocation of the web service</h4>
<div style="margin-left: 0 ; border: 2px">
-<p>At the command prompt, enter: <span class="codefrag">ant -f
C:\beehive-0.4\ant\buildWebappCore.xml build.webapp
-Dwebapp.dir=C:\jakarta-tomcat-5.0.25\webapps\AnnotatedAxis</span>
-
+<p>In this step you will test the web service by generating a WSDL for the web
service....[todo: explain what a WSDL is]</p>
+<p>At the command prompt, enter: <span
class="codefrag">C:/jakarta-tomcat-5.0.25/bin/startup.bat</span>
</p>
-<p>[tbd: currently gives a Can't find xmlbean class error. Use ant -f
C:\dev-apache\beehive\trunk\test\ant\buildWebapp.xml build.webapp
-Dwebapp.dir=C:\jakarta-tomcat-5.0.25\webapps\AnnotatedAxis as a temp.
workaround.]</p>
-</div>
-<a name="N10130"></a><a name="Test+the+Web+Service"></a>
-<h4>Test the Web Service</h4>
-<div style="margin-left: 0 ; border: 2px">
-<p>At the command prompt, enter: <span class="codefrag">cd
C:\beehive-0.4\trunk\test\ant</span>
-
+<p>Open a browser, and enter the following URL in the browser's address bar:
<a target="_blank"
href="http://localhost:8080/AnnotatedAxis/ws_tutorial/HelloWorld.jws?wsdl">http://localhost:8080/AnnotatedAxis/ws_tutorial/HelloWorld.jws?wsdl</a>
</p>
-<p>At the command prompt, enter: <span class="codefrag">ant -f buildWebapp.xml
build.webapp
-Dwebapp.dir=C:\beehive-0.4\trunk\installed\jakarta-tomcat-5.0.25\webapps\pageflow_tutorial</span>
-
+<p>The URL above will show the web service WSDL file.</p>
+<p>Enter the following URL in the browser address bar: <a target="_blank"
href="http://localhost:8080/AnnotatedAxis/HelloWorld.jws?method=sayHello">http://localhost:8080/AnnotatedAxis/HelloWorld.jws?method=sayHello</a>
</p>
</div>
</div>
- <!--
- <section id="step_3">
- <title>Step 3: Navigation</title>
- <section>
- <title>Create a Destination JSP Page</title>
- <p>In the directory
<code>C:/beehive-0.4/trunk/installed/jakarta-tomcat-5.0.25/webapps/pageflow_tutorial</code>,
create a file named <code>page2.jsp</code>.</p>
- <p>Edit page2.jsp so it looks like the
following.</p>
- <source><![CDATA[
-<%@ page language="java" contentType="text/html;charset=UTF-8"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0"
prefix="netui-data"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0"
prefix="netui-template"%>
-<netui:html>
- <head>
- <title>page2.jsp</title>
- <netui:base/>
- </head>
- <netui:body>
- <p>
- Welcome to page2.jsp!
- </p>
- </netui:body>
-</netui:html>
- ]]></source>
- </section>
- <section>
- <title>Create a Link to the Destination
Page</title>
- <p>Open the file
C:/beehive-0.4/trunk/installed/jakarta-tomcat-5.0.25/webapps/pageflow_tutorial/index.jsp.</p>
- <p>Edit index.jsp so it appears as follows.</p>
- <source><![CDATA[
-<%@ page language="java" contentType="text/html;charset=UTF-8"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0"
prefix="netui-data"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0"
prefix="netui-template"%>
-<netui:html>
- <head>
- <title>index.jsp</title>
- <netui:base/>
- </head>
- <netui:body>
- <p>
- index.jsp
- </p>
- <p>
- <netui:anchor action="toPage2">Link to page2.jsp</netui:anchor>
- </p>
- </netui:body>
-</netui:html>
- ]]></source>
- </section>
- <section>
- <title>Add an Action Method to Handle the
Link</title>
- <p>Open the file
C:/beehive-0.4/trunk/installed/jakarta-tomcat-5.0.25/webapps/pageflow_tutorial/Controller.jpf.</p>
- <p>Edit Controller.jpf so it appears as
follows.</p>
- <source><![CDATA[
-import org.apache.beehive.netui.pageflow.Forward;
-import org.apache.beehive.netui.pageflow.PageFlowController;
-import org.apache.beehive.netui.pageflow.annotations.Jpf;
-
-public class Controller
- extends PageFlowController
+
+
+<a name="N10141"></a><a name="step_3"></a>
+<h3>Step 3: Add a Parameter to the hello Method</h3>
+<div style="margin-left: 0 ; border: 2px">
+<a name="N1014A"></a><a name="Edit+the+JWS+File"></a>
+<h4>Edit the JWS File</h4>
+<div style="margin-left: 0 ; border: 2px">
+<p></p>
+<p></p>
+<pre class="code">
+import javax.jws.WebService;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+
[EMAIL PROTECTED]
+public class HelloWorld
{
- @Jpf.Action(
- forwards={
- @Jpf.Forward(name="success", path="index.jsp")
- }
- )
- protected Forward begin()
+
+ @WebMethod
+ public String hello()
{
- return new Forward("success");
+ return "Hello, World!";
}
- @Jpf.Action(
- forwards={
- @Jpf.Forward(name="success", path="page2.jsp")
- }
- )
- public Forward toPage2()
+ @WebMethod
+ public String sayHello( @WebParam(name="greetee") String greetee )
{
- return new Forward("success");
+
+ if( greetee.equals("") )
+ { greetee = "World"; }
+
+ return "Hello, " + greetee + "!";
+
}
}
- ]]></source>
- </section>
- <section>
- <title>Compile the Page Flow</title>
- <p>Open a command shell.</p>
- <p>At the command prompt, enter: <code>set
JAVA_HOME=C:\jdk1.5.0</code>
- </p>
- <p>At the command prompt, enter: <code>cd
C:\beehive-0.4\trunk</code>
- </p>
- <p>At the command prompt, enter:
<code>beehiveEnv.cmd</code>
- </p>
- <p>At the command prompt, enter: <code>cd
C:\beehive-0.4\trunk\test\ant</code>
- </p>
- <p>At the command prompt, enter: <code>ant -f
buildWebapp.xml build.webapp
-Dwebapp.dir=C:\beehive-0.4\trunk\installed\jakarta-tomcat-5.0.25\webapps\pageflow_tutorial</code>
- </p>
- </section>
- <section>
- <title>To Start the Tomcat Server</title>
- <p>At the command prompt, enter: <code>cd
C:\beehive-0.4\trunk\installed\jakarta-tomcat-5.0.25\bin</code>
- </p>
- <p>At the command prompt, enter:
<code>startup.bat</code>
- </p>
- <p>Leave this command shell open, so that you
can stop and restart Tomcat when necessary.</p>
- </section>
- <section>
- <title>To Test the Page Flow Web
Application</title>
- <p>Open a web browser and enter the following
in the address bar: <code>http://localhost:8080/pageflow_tutorial</code>
- </p>
- <p>You will be directed to the index.jsp
page.</p>
- <p>Click the link.</p>
- <p>You will be directed to page2.jsp.</p>
- </section>
- <section>
- <title>Shutdown Tomcat Server</title>
- <p>At the command prompt, enter:
<code>shutdown.bat</code>
- </p>
- </section>
- </section>
- <section id="step_4">
+ </pre>
+</div>
+<a name="N1015A"></a><a name="Test+the+Web+Service"></a>
+<h4>Test the Web Service</h4>
+<div style="margin-left: 0 ; border: 2px">
+<p>
+
+<a target="_blank"
href="http://localhost:8080/AnnotatedAxis/HelloWorld.jws?method=sayHello">http://localhost:8080/AnnotatedAxis/HelloWorld.jws?method=sayHello</a>
+
+</p>
+</div>
+</div>
+ <!--<section id="step_4">
<title>Step 4: Submitting Data</title>
<section>
<title>To Create a Submission Form</title>
@@ -805,7 +722,7 @@
<title>Summary: Page Flow Tutorial</title>
<p>This tutorial introduced you to the basics of
building web applications with Beehive Page Flows.</p>
<p>Concepts and Tasks Introduced in This Tutorial</p>
- <p>[tbd: more detailed summary]</p>
+ <p>[todo: more detailed summary]</p>
</section>
-->
Modified:
incubator/beehive/site/src/documentation/content/xdocs/pageflow/guide.xml
==============================================================================
--- incubator/beehive/site/src/documentation/content/xdocs/pageflow/guide.xml
(original)
+++ incubator/beehive/site/src/documentation/content/xdocs/pageflow/guide.xml
Thu Oct 28 13:24:33 2004
@@ -6,8 +6,8 @@
</header>
<body>
<section id="intro">
- <title>What's So Great About Page Flows?</title>
- <p>Page Flows make building Java web applications easy and
intuitive. When programming with Page Flows, the developer writes Java files
and JSP pages--that's it. There is very little occasion to work with
configuration files, or other components. Page Flow programming is not only
simple, it is also excells at separating the presentation logic from the data
processing logic. This results in uncluttered JSP code which is easy to
understand and edit. Moreover, many of the most difficult programming tasks,
such as security and validation, are handled with a simple declarative
programming model using Java annotations.</p>
+ <title>Advantages of Programming with Page Flows</title>
+ <p>Page Flows make building Java web applications easy and
intuitive. When programming with Page Flows, the developer writes Java files
and JSP pages--that's it. There is very little occasion to work with
configuration files, or other components. Page Flow programming is not only
simple, it is also excells at separating the presentation logic from the data
processing logic. This results in uncluttered JSP code which is easy to
understand and edit. Moreover, many of the most difficult programming tasks,
such as security and validation, are handled with a simple declarative
programming model using Java annotations.</p>
</section>
<section>
<title>How Do Page Flows Work?</title>
@@ -15,24 +15,218 @@
The role of the JSP pages is to present a visual interface for
users of the web application. The role of the Controller file is to coordinate
all of the things that can happen when a user visits a web site. These duties
include: handling user requests, fashioning responses to user requests,
preserving session state, and coordinating back-end resources (such as
databases and web services).</p>
<p>The JSP files use special tags (the "<netui>" tags) and
databinding expressions which bind the user interface to objects and actions in
the Controller file.
</p>
- <p>tbd: need diagram here</p>
+ <p>tbd: need diagram here</p>
<p>The action methods in the controller file implement code that
can result in site navigation, passing data, or invoking back-end business
logic via controls.
Significantly, the business logic in the controller class is
separate from the presentation code defined in the JSP files.
The overall purpose of a page flow is to provide you with an
easy-to-use framework for building dynamic, sophisticated web applications.
- While page flows give you access to advanced features of J2EE, you
do not have to be a J2EE expert to quickly develop and deploy Java-based
applications built on page flows.</p>
+ While page flows give you access to advanced features of J2EE, you
do not have to be a J2EE expert to quickly develop and deploy Java-based
applications built on page flows.</p>
<p>The programming model: annotations, data binding expressions,
<netui> tags, etc.</p>
</section>
<section id="nav">
<title>Navigation</title>
+ <p>
+ <strong>Introduction</strong>
+ </p>
+ <p>Suppose you have two JSP pages, pageA.jsp and pageB.jsp. Also,
suppose you want to place a link on pageA, that will navigate the user to
pageB.</p>
+ <p>One solution would be to place an HTML anchor tag (<a>) on
pageA that links to pageB. But what if you had dozens of pages that needed to
link to pageB? You could repeat the anchor tag solution a dozen times, by
placing an anchor tag on each page that required a link to pageB. But this
solution becomes cumbersome if you ever need to edit those links. At some
point in the future, you may want to change those links, so that they navigate
to another page, say to pageC. But this would require sifting through all of
your web site's JSP pages for anchor tags to edit.</p>
+ <p>Page Flows solve this problem by placing navigational control
within a single file: the Controller file (=JPF file). Methods within the
Controller file decide the target page, whether it is pageB, pageC, or
somewhere else. The job of the JSP page is to invoke the method, not to
directly link to another JSP page. The work of navigation in a Page Flow
breaks down to a two step process: (1) The JSP page invokes a method in the
Controller file, then (2) the method navigates the user to the target page.</p>
+ <p>
+ <strong>How the Code Works</strong>
+ </p>
+ <p>Methods in the Controller file are invoked through specially
designed JSP tags, called "netui" tags. These tags appear with the prefix
<strong><netui:></strong>. (Tags with the <netui:> reference the
netui-tags-html.tld tag library.) Neuti tags like <neuti:anchor>,
<netui:button>, and <netui:imageButton> are all capable of invoking
methods in the Controller file. The method to invoke is specified by the tag's
<code>action</code> attribute. For example, the following <netui:anchor>
tag invokes the <code>toPageB</code> method by referencing the method in it's
<code>action</code> attribute.</p>
+ <p>
+ <strong>pageA.jsp</strong>
+ </p>
+ <source>
+ <!-- Import the netui-tags-html.tld tag library -->
+ <%@ taglib uri="netui-tags-html.tld" prefix="netui"%>
+ ...
+ <!-- Render a link that invokes the toPageB method -->
+ <netui:anchor <strong>action="toPageB"</strong>>Link to
page_B.jsp</netui:anchor>
+</source>
+ <p>(When pageA.jsp is viewed in a broswer, the <netui:anchor>
tag is rendered as ordinary HTML, with associated JavaScript which handles the
invocation.... [todo] )</p>
+ <p>Suppose the link above is clicked. When clicked, the following
method, <code>toPageB</code>, is invoked.</p>
+ <p>The method below, when invoked, navigates the user to
pageB.jsp. The code within the method body is very simple: upon invocation,
the method immediately returns a Forward object, with the String parameter
"success". The code <em>above</em> the method does the real work of
determining the navigational target. The code above the method consists of two
metadata annotations. "Metadata" means that the annotation configures or sets
a property on some part of the Java code. In the example below, the
@Jpf.Action annotation makes the method available to invocation (by netui
tags), while the @Jpf.Forward annotation configures the navigation information.
In the this case the method it configured to navigate to pageB.jsp whenever it
is invoked. </p>
+ <p>
+ <strong>Controller.jpf</strong>
+ </p>
+ <source>
+import org.apache.beehive.netui.pageflow.Forward;
+...
+ @Jpf.Action(
+ forwards = {
+ @Jpf.Forward(name = "<strong>success</strong>", path =
"<strong>pageB.jsp</strong>")
+ }
+ )
+ protected Forward navigate()
+ {
+ return new Forward("success");
+ }</source>
+ <p>Metadata annotations are typically compiled into XML
configuration files, or some other post-compilation artifact. Sometimes the
artifacts are very complex, as in the case of the @WebService annotation. But
in other case the post-compilation artifact is simple: for example, the
@jpf:forward annotation compiles into an entry in the [todo] configuration
file.</p>
+ <p>The first annotation, <code>@jpf:action</code>, declares that
method is an Action method. Action methods are ...[todo]</p>
+ <p>The second annotation, <code>@jpf:forward</code>, configures
the [todo]. As a result, at runtime, when the toPageB method is invoked (say
by the clicking of a <netui:anchor> tag), the [todo] configuration file is
consulted, and the user is navigated to pageB.jsp.</p>
+ <p>
+ <strong>Changing the Navigation Target</strong>
+ </p>
+ <p>To change the navigation target of this action method, simply
change the value of the path attribute. For example, if you want this action
method to navigate to pageC.jsp, you would make the following change to the
controller file (no change to the JSP page is necessary).</p>
+ <source>
+ @Jpf.Action(
+ forwards = {
+ @Jpf.Forward(name = "success", path = "<strong>pageC.jsp</strong>")
+ }
+ )
+ protected Forward navigate()
+ {
+ return new Forward("success");
+ }</source>
+ <p>
+ <strong>Conditional Navigation</strong>
+ </p>
+ <p>By placing navigational control in the Controller file, you can
control conditional navigation.</p>
+ <p>The following example is from the Petstore sample. The
<code>begin</code> method checks to see if the user is logged in or not, and
navigates the user appropriately.</p>
+ <p>
+ <strong>
+
<code>beehive/trunk/samples/petstoreWeb/Controller.jpf</code>
+ </strong>
+ </p>
+ <source>
+ @Jpf.Action(
+ forwards = {
+ @Jpf.Forward(name = "shop", path = "/shop/Controller.jpf"),
+ @Jpf.Forward(name = "index", path = "/index.jsp")
+ }
+ )
+ protected Forward begin()
+ {
+ if (_sharedFlow.isUserLoggedIn())
+ return new Forward("shop");
+ else return new Forward("index");
+ }
+</source>
+ <p>
+Putting it all together, a Forward object is returned by an action method. The
Forward object passes the string "success", indicating that it should behave
according to the directions encoded in the annotation @jpf:forward
name="success". That annotation's path attribute has the value "page_B.jsp",
which causes the page flow controller to load page_B.jsp into the browser.
+
+</p>
</section>
<section id="submit">
- <title>Submitting Data: Form Beans, and Data Binding</title>
+ <title>Submitting Data: Form Beans and Data Binding</title>
+ <p>
+<!--
+Suppose you want to your web application to collect data from users and then
process that data in some way. The following example demonstrates how to set up
a data submission process using page flows. The sample code referred to in this
example can be found at:
+
+BEA_HOME>\weblogic81\samples\workshop\SamplesApp\WebApp\handlingData\simpleSubmit\
+
+Submitting data is a two step process: (1) the data submitted from a JSP page
is loaded into a Form Bean instance and (2) the Form Bean instance is passed to
an action method for processing.
+
+
+
+Form Beans are simple Java classes with fields and setter and getter methods
for accessing those fields. Form Beans classes are contained within the
controller file. In most cases, Form Beans are designed to accept data
submitted from JSP forms. For example, if a JSP page has input elements for
name, eye_color, and height, then the Form Bean will have corresponding fields
for name, eye_color, and height. The following example Form Bean can be found
in the controller file SimpleSubmitController.jpf. It contains one field, name,
and setter and getter methods for that field.
+
+ SimpleSubmitController.jpf
+
+ public class SimpleSubmitController extends PageFlowController
+ {
+
+ ...
+
+ public static class SubmitNameForm extends FormData
+ {
+ private String name;
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return this.name;
+ }
+ }
+ }
+
+The input elements on the JSP page are said to be "data bound" to the fields
in the Form Bean. Data binding allows the the data submitted from the JSP page
to be loaded into the Form Bean instance. For example, the input element on
index.jsp contains a data binding expression that refers to the name field of
the Form Bean: {actionForm.name}. The expression "actionForm" refers to the
Form Bean SubmitNameForm, the property ".name" refers to the name field of the
Form Bean. For detailed information about data binding see Using Data Binding
in Page Flows.
+
+ index.jsp
+ <netui:form action="SubmitName">
+ Name: <netui:textBox dataSource="{actionForm.name}"/>
+ ....
+ </netui:form>
+Finally the Form Bean instance (carrying the submitted data) is passed to the
action method for processing.
+
+ /**
+ * @jpf:action
+ * @jpf:forward name="success" path="showName.jsp"
+ */
+ protected Forward SubmitName(SubmitNameForm form)
+ {
+ //
+ // The data is processed here
+ //
+
+ return new Forward("success");
+ }
+
+The submitted data can be accessed by calling the getter methods on the Form
Bean.
+
+ /**
+ * @jpf:action
+ * @jpf:forward name="success" path="showName.jsp"
+ */
+ protected Forward SubmitName(SubmitNameForm form)
+ {
+ if( form.getName() != null )
+ // do something here
+ else
+ // do something else here
+
+ return new Forward("success");
+ }
+
+By default the Form Bean instance that is passed to the action method exists
only as long as the HTTP request. This is called a "request-scoped Form Bean".
When the HTTP request is destroyed, the Form Bean instance, along with the user
submitted data, is destroyed. As an alternative, you can use a Page Flow-scoped
Form Bean, which has a longer life cycle. For details see Form Bean Scopings.
+
+</p>
</section>
<section id="processing_data">
<title>Processing Data</title>
</section>
<section id="displaying_data">
<title>Displaying Data</title>
+ <p>
+Displaying Data: A Simple Example
+
+Suppose that once you have collected data, you want to display it back to the
user. The following example shows how to use data binding to display data to
the user. The sample code referred to can be found at:
+
+<BEA_HOME>\weblogic81\samples\workshop\SamplesApp\WebApp\handlingData\simpleSubmit\
+
+Displaying data using data binding requires that (1) the data is located
somewhere where it can accessed by the JSP page and (2) the JSP page uses a
data binding expression to retrieve the data from that location.
+
+Notice the syntax of data binding expression on the JSP page. (1) It is framed
by curley braces, (2) it begins with a data binding context, in this case the
request context, and (3) the context is followed by an attribute, in this case
"name".
+
+In the following example, an action method places data on the name attribute
of the request object.
+
+ SimpleSubmitController.jpf
+
+ /**
+ * @jpf:action
+ * @jpf:forward name="success" path="showName.jsp"
+ */
+ protected Forward SubmitName(SubmitNameForm form)
+ {
+ getRequest().setAttribute("name", form.getName());
+ return new Forward("success");
+ }
+
+After the data has been located on the name attribute of the request object,
it is displayed on a JSP page using a data binding expression.
+
+ showName.jsp
+
+ Here is the data you submitted: <netui:label value="{request.name}" />
+
+Note that the request object has a relatively short life-cycle. When the user
makes a new request, by navigating to a new JSP page or invoking another action
method, the current request object is destroyed along with the data it
contains. If your application requires the data to be more persistent, then you
could use a different data binding context, for example the session object or a
Page Flow-scoped Form Bean, which both have longer life-cycles. For detailed
information about the different data binding contexts available, see Using Data
Binding in Page Flows.
+
+-->
+</p>
</section>
<section id="controls">
<title>Accessing Back-End Resources with Controls</title>
Modified: incubator/beehive/site/src/documentation/content/xdocs/site.xml
==============================================================================
--- incubator/beehive/site/src/documentation/content/xdocs/site.xml
(original)
+++ incubator/beehive/site/src/documentation/content/xdocs/site.xml Thu Oct
28 13:24:33 2004
@@ -12,14 +12,14 @@
</beehive>-->
<pageflow label="Page Flows">
<tutorial_pageflow label="Page Flow Tutorial"
href="pageflow/tutorial_pageflow.html"/>
- <!--<pageflow_programming label="Page Flow Programming"
href="pageflow/guide.html"/>-->
+ <pageflow_programming label="Page Flow Programming"
href="pageflow/guide.html"/>
</pageflow>
<controls label="Controls">
<tutorial_control label="Control Tutorial"
href="controls/tutorial_controls.html"/>
<control_overview label="Control Programming"
href="Controls.html"/>
</controls>
<wsm label="Web Services">
- <!--<tutorial_wsm label="Web Services Tutorial"
href="wsm/tutorial_wsm.html"/>-->
+ <tutorial_wsm label="Web Services Tutorial"
href="wsm/tutorial_wsm.html"/>
<jsr181 label="Web Services (JSR 181)" href="webservices.html"/>
</wsm>
<samples label="Samples">
Modified:
incubator/beehive/site/src/documentation/content/xdocs/wsm/sample_AddressBook.xml
==============================================================================
---
incubator/beehive/site/src/documentation/content/xdocs/wsm/sample_AddressBook.xml
(original)
+++
incubator/beehive/site/src/documentation/content/xdocs/wsm/sample_AddressBook.xml
Thu Oct 28 13:24:33 2004
@@ -45,8 +45,9 @@
</li>
</ul>
<li>Set CATALINA_HOME to be the installed directory of the
server. (For example, <code>set
CATALINA_HOME=C:\beehive-src\trunk\installed\jakarta-tomcat-5.0.25</code>)</li>
- <li>Build the AddressBook Sample</li>
+ <li>Build the Backend Java Types of the AddressBook
Sample</li>
<ul>
+ <li>Note: this step is necessary to build the Java
types in /AddressBook/server/src/org/beehive/demo. The web service file itself
(AddressBook.jws), does not need to be pre-compiled, because of the Axis
drop-in deployment model.</li>
<li>cd to
<code>BEEHIVE_HOME/wsm/samples/dropInDeployment/AddressBook/server</code>
</li>
<li>run <code>ant build</code>
Modified:
incubator/beehive/site/src/documentation/content/xdocs/wsm/tutorial_wsm.xml
==============================================================================
--- incubator/beehive/site/src/documentation/content/xdocs/wsm/tutorial_wsm.xml
(original)
+++ incubator/beehive/site/src/documentation/content/xdocs/wsm/tutorial_wsm.xml
Thu Oct 28 13:24:33 2004
@@ -18,7 +18,7 @@
</section>
<section>
<title>Note on the Current State of the Web
Service Tutorial</title>
- <p>This tutorial is currently a work in
progress, and will by changed and amended in the coming weeks. The tutorial
assumes that you are using a Windows machine, however, with a little common
sense it is very easy to run through the tutorial on a Linux machine. For
example, where the tutorial tells you to run FOO.cmd, instead run FOO.sh.</p>
+ <p>This tutorial is currently a work in
progress, and will by changed and amended in the coming weeks. The tutorial
assumes that you are using a Windows machine. But, with a little common sense,
it is very easy to run through the tutorial on a Linux machine. For example,
where the tutorial tells you to run FOO.cmd, instead run FOO.sh.</p>
<p>Please send any comments to Steve Hanson,
at <code>steveh at bea.com</code>.</p>
</section>
</section>
@@ -27,11 +27,11 @@
<section>
<title>Download and Install JDK5</title>
<p>If you do not have JDK5 installed on your
machine, visit <fork
href="http://java.sun.com/j2se/1.5.0/download.jsp">http://java.sun.com/j2se/1.5.0/download.jsp</fork>
and download and install the latest version. (Note: it is important that you
install version beta51 or later.)</p>
- <p>Throughout this tutorial, it is assumed that
you have JDK 5 installed at <code>C:\jdk1.5.0</code>.</p>
+ <p>Throughout this tutorial, it is assumed that
you have JDK 5 installed at <code>C:/jdk1.5.0</code>.</p>
<p></p>
</section>
<section>
- <title>Install ANT</title>
+ <title>Install ANT 1.6.2</title>
<p>If you do not have Ant 1.6.2 installed on
your machine, visit <fork
href="http://svn.apache.org/repos/asf/incubator/beehive/trunk/external/ant/apache-ant-1.6.2-bin.zip">http://svn.apache.org/repos/asf/incubator/beehive/trunk/external/ant/apache-ant-1.6.2-bin.zip</fork></p>
<p>After download is complete, unzip the file
<code>apache-ant-1.6.2-bin.zip</code> into your C: drive.</p>
<p>After the file has unzipped, confirm that
the following directory structure exists: <code>C:/apache-ant-1.6.2</code>.</p>
@@ -45,209 +45,114 @@
</section>
<section>
<title>Download and Install a Beehive Binary
Distribution</title>
- <p>Visit [tbd: distribution download link] and
download the latest binary distribution of Beehive.</p>
- <p>
- Create a directory called
<code>beehive-0.4</code> on your C: drive. Confirm that the the following
directory structure exists: <code>C:/beehive-0.4</code>. This directory will
store the Beehive distribution JARs and all of your Beehive projects.
- </p>
+ <p>Visit [todo: distribution download link] and
download the latest binary distribution of Beehive.</p>
+ <p> Create a directory called
<code>beehive-0.4</code> on your C: drive. This directory will store the
Beehive distribution JARs and all of your Beehive projects.</p>
+ <p>Unzip the distribution JAR into
<code>C:/beehive-0.4</code></p>
</section>
<section>
<title>Set up the Development
Environment</title>
- <p>At the command prompt, enter: <code>set
JAVA_HOME=C:\jdk1.5.0</code>
+ <p>Open a command shell.</p>
+ <p>At the command prompt, enter: <code>set
JAVA_HOME=C:/jdk1.5.0</code>
</p>
<p> Note: if you have
JDK5 installed in a different directory, set JAVA_HOME to that location.</p>
<p>At the command prompt, enter: <code>set
CATALINA_HOME=C:/jakarta-tomcat-5.0.25</code>
</p>
- <p>At the command prompt, enter: <code>set
ANT_HOME=C:\apache-ant-1.6.2</code>
+ <p>At the command prompt, enter: <code>set
ANT_HOME=C:/apache-ant-1.6.2</code>
</p>
- <p>At the command prompt, enter: <code>set
PATH=%PATH%;C:\apache-ant-1.6.2\bin</code>
+ <p>At the command prompt, enter: <code>set
PATH=%PATH%;C:/apache-ant-1.6.2/bin;C:/jdk1.5.0/bin</code>
</p>
<p>Leave the command shell open to use
throughout the tutorial</p>
- <p>You are now ready to create a Beehive web
service.
- </p>
+ </section>
+ <section>
+ <title>Set Up Drop In Deployment</title>
+ <p>Copy the folder
<code>[todo]/AnnotatedAxis</code> into the directory
<code>C:/jakarta-tomcat-5.0.25/webapps</code>.</p>
+ <p>Confirm that the following directory
structure exists:
<code>C:/jakarta-tomcat-5.0.25/webapps/AnnotatedAxis</code></p>
+ <p>At the command prompt, enter:
<code>C:/jakarta-tomcat-5.0.25/bin/startup.bat</code></p>
+ <p>Visit <fork
href="http://localhost:8080/AnnotatedAxis/index.html">http://localhost:8080/AnnotatedAxis/index.html</fork>
to confirm AnnotatedAxis is installed on Tomcat. If you do not see an
information page on AnnotatedAxis, then something is wrong. Ensure that the
AnnotatedAxis directory has been copied to C:/jakarta-tomcat-5.0.25/webapps,
restart Tomcat, and try again.</p>
+ <p>At the command prompt, enter:
<code>C:/jakarta-tomcat-5.0.25/bin/shutdown.bat</code></p>
</section>
</section>
<section id="step_2">
<title>Step 2: Create a New Web Service</title>
<section>
<title>Introduction</title>
- <p>[tbd]</p>
+ <p>[todo]</p>
<p> </p>
<p> </p>
</section>
<section>
- <title>Set Up Drop In Deployment</title>
- <p>Copy the folder
<code>[tbd]/AnnotatedAxis</code> into the directory
<code>C:/jakarta-tomcat-5.0.25/webapps</code>.</p>
- <p>Confirm that the following directory
structure exists:
<code>C:/jakarta-tomcat-5.0.25/webapps/AnnotatedAxis</code></p>
- <p>At the command prompt, enter:
<code>C:/jakarta-tomcat-5.0.25/bin/startup.bat</code></p>
- <p>Visit <fork
href="http://localhost:8080/AnnotatedAxis/index.html">http://localhost:8080/AnnotatedAxis/index.html</fork>
to confirm AnnotatedAxis is installed on Tomcat. If you do not see an
information page on AnnotatedAxis, then something is wrong. Ensure that
AnnotatedAxis directory is in C:/jakarta-tomcat-5.0.25/webapps, restart Tomcat,
and try again.</p>
-
- <p>At the command prompt, enter:
<code>C:/jakarta-tomcat-5.0.25/bin/shutdown.bat</code></p>
- </section>
- <section>
<title>To Create a JWS File</title>
- <p>In the directory
<code>C:/jakarta-tomcat-5.0.25/webapps/AnnotatedAxis</code>, create a folder
named <code>myWebservice</code>.</p>
- <p>In the directory
<code>C:/jakarta-tomcat-5.0.25/webapps/AnnotatedAxis/myWebservice</code>,
create a file named <code>HelloWorld.jws</code>.</p>
+ <p>In the directory
<code>C:/jakarta-tomcat-5.0.25/webapps/AnnotatedAxis</code>, create a folder
named <code>ws_tutorial</code>.</p>
+ <p>In the directory
<code>C:/jakarta-tomcat-5.0.25/webapps/AnnotatedAxis/ws_tutorial</code>, create
a file named <code>HelloWorld.jws</code>.</p>
<p>Edit HelloWorld.jws so it looks like the
following:</p>
- <source><
-public class HelloWorld
[EMAIL PROTECTED]
+public class HelloWorld
{
- /**
- * @throws java.rmi.RemoteException
- */
+
@WebMethod
- public String hello() throws RemoteException
+ public String hello()
{
- return String "Hello, World!";
+ return "Hello, World!";
}
}
]]></source>
- </section>
- <section>
- <title>Compile the Web Service</title>
- <p>At the command prompt, enter: <code>ant -f
C:\beehive-0.4\ant\buildWebappCore.xml build.webapp
-Dwebapp.dir=C:\jakarta-tomcat-5.0.25\webapps\AnnotatedAxis</code>
- </p>
- <p>[tbd: currently gives a Can't find xmlbean
class error. Use ant -f C:\dev-apache\beehive\trunk\test\ant\buildWebapp.xml
build.webapp -Dwebapp.dir=C:\jakarta-tomcat-5.0.25\webapps\AnnotatedAxis as a
temp. workaround.]</p>
- </section>
+ </section>
<section>
- <title>Test the Web Service</title>
- <p>At the command prompt, enter: <code>cd
C:\beehive-0.4\trunk\test\ant</code>
- </p>
- <p>At the command prompt, enter: <code>ant -f
buildWebapp.xml build.webapp
-Dwebapp.dir=C:\beehive-0.4\trunk\installed\jakarta-tomcat-5.0.25\webapps\pageflow_tutorial</code>
- </p>
+ <title>Test the Web Service: URL Invocation of
the web service</title>
+ <p>In this step you will test the web service
by generating a WSDL for the web service....[todo: explain what a WSDL is]</p>
+ <p>At the command prompt, enter:
<code>C:/jakarta-tomcat-5.0.25/bin/startup.bat</code></p>
+ <p>Open a browser, and enter the following URL in
the browser's address bar: <fork
href="http://localhost:8080/AnnotatedAxis/ws_tutorial/HelloWorld.jws?wsdl">http://localhost:8080/AnnotatedAxis/ws_tutorial/HelloWorld.jws?wsdl</fork></p>
+ <p>The URL above will show the web service WSDL
file.</p>
+ <p>Enter the following URL in the browser address
bar: <fork
href="http://localhost:8080/AnnotatedAxis/HelloWorld.jws?method=sayHello">http://localhost:8080/AnnotatedAxis/HelloWorld.jws?method=sayHello</fork></p>
</section>
</section>
- <!--
+
<section id="step_3">
- <title>Step 3: Navigation</title>
- <section>
- <title>Create a Destination JSP Page</title>
- <p>In the directory
<code>C:/beehive-0.4/trunk/installed/jakarta-tomcat-5.0.25/webapps/pageflow_tutorial</code>,
create a file named <code>page2.jsp</code>.</p>
- <p>Edit page2.jsp so it looks like the
following.</p>
- <source><![CDATA[
-<%@ page language="java" contentType="text/html;charset=UTF-8"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0"
prefix="netui-data"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0"
prefix="netui-template"%>
-<netui:html>
- <head>
- <title>page2.jsp</title>
- <netui:base/>
- </head>
- <netui:body>
- <p>
- Welcome to page2.jsp!
- </p>
- </netui:body>
-</netui:html>
- ]]></source>
- </section>
- <section>
- <title>Create a Link to the Destination
Page</title>
- <p>Open the file
C:/beehive-0.4/trunk/installed/jakarta-tomcat-5.0.25/webapps/pageflow_tutorial/index.jsp.</p>
- <p>Edit index.jsp so it appears as follows.</p>
- <source><![CDATA[
-<%@ page language="java" contentType="text/html;charset=UTF-8"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0"
prefix="netui-data"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
-<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0"
prefix="netui-template"%>
-<netui:html>
- <head>
- <title>index.jsp</title>
- <netui:base/>
- </head>
- <netui:body>
- <p>
- index.jsp
- </p>
- <p>
- <netui:anchor action="toPage2">Link to page2.jsp</netui:anchor>
- </p>
- </netui:body>
-</netui:html>
- ]]></source>
- </section>
+ <title>Step 3: Add a Parameter to the
<code>hello</code> Method</title>
<section>
- <title>Add an Action Method to Handle the
Link</title>
- <p>Open the file
C:/beehive-0.4/trunk/installed/jakarta-tomcat-5.0.25/webapps/pageflow_tutorial/Controller.jpf.</p>
- <p>Edit Controller.jpf so it appears as
follows.</p>
+ <title>Edit the JWS File</title>
+ <p></p>
+ <p></p>
<source><![CDATA[
-import org.apache.beehive.netui.pageflow.Forward;
-import org.apache.beehive.netui.pageflow.PageFlowController;
-import org.apache.beehive.netui.pageflow.annotations.Jpf;
-
-public class Controller
- extends PageFlowController
+import javax.jws.WebService;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+
[EMAIL PROTECTED]
+public class HelloWorld
{
- @Jpf.Action(
- forwards={
- @Jpf.Forward(name="success", path="index.jsp")
- }
- )
- protected Forward begin()
+
+ @WebMethod
+ public String hello()
{
- return new Forward("success");
+ return "Hello, World!";
}
- @Jpf.Action(
- forwards={
- @Jpf.Forward(name="success", path="page2.jsp")
- }
- )
- public Forward toPage2()
+ @WebMethod
+ public String sayHello( @WebParam(name="greetee") String greetee )
{
- return new Forward("success");
+
+ if( greetee.equals("") )
+ { greetee = "World"; }
+
+ return "Hello, " + greetee + "!";
+
}
}
]]></source>
</section>
<section>
- <title>Compile the Page Flow</title>
- <p>Open a command shell.</p>
- <p>At the command prompt, enter: <code>set
JAVA_HOME=C:\jdk1.5.0</code>
- </p>
- <p>At the command prompt, enter: <code>cd
C:\beehive-0.4\trunk</code>
- </p>
- <p>At the command prompt, enter:
<code>beehiveEnv.cmd</code>
- </p>
- <p>At the command prompt, enter: <code>cd
C:\beehive-0.4\trunk\test\ant</code>
- </p>
- <p>At the command prompt, enter: <code>ant -f
buildWebapp.xml build.webapp
-Dwebapp.dir=C:\beehive-0.4\trunk\installed\jakarta-tomcat-5.0.25\webapps\pageflow_tutorial</code>
- </p>
- </section>
- <section>
- <title>To Start the Tomcat Server</title>
- <p>At the command prompt, enter: <code>cd
C:\beehive-0.4\trunk\installed\jakarta-tomcat-5.0.25\bin</code>
- </p>
- <p>At the command prompt, enter:
<code>startup.bat</code>
- </p>
- <p>Leave this command shell open, so that you
can stop and restart Tomcat when necessary.</p>
- </section>
- <section>
- <title>To Test the Page Flow Web
Application</title>
- <p>Open a web browser and enter the following
in the address bar: <code>http://localhost:8080/pageflow_tutorial</code>
- </p>
- <p>You will be directed to the index.jsp
page.</p>
- <p>Click the link.</p>
- <p>You will be directed to page2.jsp.</p>
- </section>
- <section>
- <title>Shutdown Tomcat Server</title>
- <p>At the command prompt, enter:
<code>shutdown.bat</code>
- </p>
- </section>
+ <title>Test the Web Service</title>
+ <p>
+ <fork
href="http://localhost:8080/AnnotatedAxis/HelloWorld.jws?method=sayHello">http://localhost:8080/AnnotatedAxis/HelloWorld.jws?method=sayHello</fork>
+ </p>
+ </section>
</section>
- <section id="step_4">
+ <!--<section id="step_4">
<title>Step 4: Submitting Data</title>
<section>
<title>To Create a Submission Form</title>
@@ -467,7 +372,7 @@
<title>Summary: Page Flow Tutorial</title>
<p>This tutorial introduced you to the basics of
building web applications with Beehive Page Flows.</p>
<p>Concepts and Tasks Introduced in This Tutorial</p>
- <p>[tbd: more detailed summary]</p>
+ <p>[todo: more detailed summary]</p>
</section>
-->
</body>