Package org.apache.commons.workflow.web

Implementations of Steps in the web library.

See:
          Description

Class Summary
ActivityServlet Demonstration servlet that illustrates one way that workflow support can be integrated into web applications (or web services) without any dependency on application frameworks.
DemoBean JavaBean used in the demonstration web application.
ForwardStep Perform a RequestDispatcher.forward() operation on the specified context relative path, and tell our Context to suspend execution until control is returned.
GotoStep Unconditionally transfer control to the step that is identified by a request parameter with the specified name.
HttpSessionScope HttpSessionScope is a specialized Scope implementation corresponding the the attributes of a specified HttpSession.
IncludeResponse23 Implementation of HttpServletResponseWrapper for use in IncludeStep23.
IncludeStep23 Perform a RequestDispatcher.include() operation on the specified context relative path, and push the response data (as a String onto the evaluation stack.
PopulateStep For each associated Descriptor, populate the properties of the bean specified by that descriptor from the request parameters of the current request.
ServletContextScope ServletContextScope is a specialized Scope implementation corresponding the the attributes of a specified ServletContext.
ServletRequestScope ServletRequestScope is a specialized Scope implementation corresponding the the attributes of a specified ServletRequest.
WebContext WebContext is a specialized Context implementation appropriate for web applications that run on top of a Servlet 2.2 (or later) container.
WebRuleSet RuleSet for the Step definitions supported by the web library.
 

Package org.apache.commons.workflow.web Description

Implementations of Steps in the web library.

Web Step Library - Overview

This package contains org.apache.commons.workflow.Step implementations for the web library. This library includes Steps for that are executed in a web application, utilizing the org.apache.commons.workflow.web.WebContext implementation of Context. Utilizing this feature makes the request, session, and application scope attributes of the servlet API available to workflows as Scopes named "request", "session", and "application", respectively.

The sections below define each of the Step definitions included in this library, utilizing the XML syntax that is recognized by the Digester used to process your Activity definition files. Although you can use any namespace prefix, the convention is to declare io as the namespace prefix, as in the following example:

  <base:activity id="Demonstration Activity"
    xmlns:base="http://commons.apache.org/workflow/base"
    xmlns:core="http://commons.apache.org/workflow/core"
    xmlns:web="http://commons.apache.org/workflow/web"
  >

    <web:forward page="/mainMenu.jsp"/>

  </base:activity>

NOTE - It is not required that you use the XML syntax, processed with a Digester, to initialize the Steps associated with each Activity. However, this usage is very convenient, and is likely to be the most common case, so the Steps are documented from that perspective. To use the underlying implementation classes directly, see the Javadocs for each Step implementation class, just as you would for any other Java class.

[web:forward] [web:goto] [web:include] [web:populate]

Web Step Library - Step Definitions

web:forward

The web:forward Step performs a RequestDispatcher.forward() call to the specified context-relative URL, and then tells our Context to suspend execution until the application calls context.execute() again. This is useful in MVC-based application architectures using a controller servlet to receive and process all events.

The web:forward element recognizes the following attributes:

web:goto

The web:goto Step unconditionally transfers control to the Step that is identified by a request parameter with the specified name.

The web:goto element recognizes the following attributes:

web:include

The web:include Step performs a RequestDispatcher.include() operation on the specified context-relative path, and pushes the response data (as a String) on to the evaluation stack. WARNING - This Step is only available on servlet contiainers implementing the Servlet 2.3 (or later) specification, because it uses the new response wrapper facilities.

The web:include element recognizes the following attributes:

web:populate

The web:populate Step, for each nested Descriptor, populates the properties of the bean specified by that Descriptor from the request parameters of the current request.

The web:populate element recognizes the following attributes:

You may nest any number of io:descriptor elements within a web:populate element. All of them will be evaluated and displayed in order specified.

In the example below, the request parameters included with the current request are used to populate the properties of an OrderBean stored under the identifier "order".

  <web:populate>
    <web:descriptor xpath="order"/>
  </web:populate>

Web Step Library - Nested Elements

web:descriptor

An web:descriptor element is a description of the mechanism by which an arbitrary Java object (typically a JavaBean) in some Scope, is referenced. This element recognizes the following attributes:

The syntax for XPath expressions is a sequence of one or more identifier strings, separated by forward slash ("/") characters. The expression is evaluated as follows:

When deciding what bean a particular descriptor applies to, the following rules are applied, in this priority order:

FIXME - Support the property attribute for access to bean properties via the Commons Beanutils package.



Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.