Using tags

The WFNM framework provides the following tags:

The webflow tag

The webflow tag allows to declare a web page as an entry for a named webflow. For example the following tag indicates to the WFNM framework that the page is an entry for webflow A:

<wfnm:webflow name="A"/>

If not specified in the tag, the default ownership of objects placed into the http session during the webflow is "webflow" (see here), unless a different default configuration has been specified (see here).

For example the following tag indicates to the WFNM framework that the page is an entry for webflow A with default ownership to "page":

<wfnm:webflow name="A" owner="page"/>

In some cases, a webflow must be considered a starting point for a use case: it doesn't matter which is the caller webflow, it has to force as a the previous webflow a specific (already opened) webflow, which is tipically the global webflow that contains the home page of the application.

In such that cases, the attribute "forcePrevious" can be used to force the return to a previously visited webflow. For example:

<wfnm:webflow name="B" forcePrevious="A"/>

The owner tag

If the default ownership specified with the above webflow tag or the default "webflow" configuration (that can be changed as described here) is not appropriated for some object that will be placed into the http session, the owner tag can be used.

Basically the owner tag allows to tie a single object (that is not yet into the http session) with an element of the stack of pages/webflows (see here).

For example the following tag indicates to the WFNM framework that the bean with key "myBean" is tied to the current page:

<wfnm:owner key="myBean" owner="page"/>

The object that will be placed into the http session with key "myBean" will be automatically removed only when the current page will be closed (i.e.: when returning to a previous page).

The value of the owner attribute can be "page", "webflow", "previous", "working", "global" or "none" as described here.

The reset tag

The reset tag allows to completely reset the WFNM framework; it is useful if for some reason only a part of the web application should be managed by the framework.

The syntax of the reset tag is the following:

<wfnm:reset/>

By resetting the framework, the stack of webflows is removed and every object owned by each webflow (and pages contained into the internal page stack) are removed from session. Furthermore the "stack of stacks" data structure itself is removed from the user http session.

In the provided sample, the reset tag is used in the pages just before entering the demos (Struts and JSF versions): when exiting the demo, by returning to those pages, the WFNM framework is resetted.

The ignore tag

The ignore tag allows to notify to the WFNM framework that a page should not be considered for navigation, should not handled by the framework and inserted into the stack of pages.

This is especially useful for pages, for instance a "login" page or a "help" page, which should not be considered for server side history.

The syntax of the ignore tag is the following:

<wfnm:ignore/>

In the provided sample, the ignore tag is used in the status page, that allows to display the internal status of the framework: a stack of webflows each containing a stack of pages.

The status tag

The status tag allows to display the internal status of the WFNM framework. It can be used to help developer to quickly display the internal status of the framework.

An example of the usage of the status tag can be found here.

The syntax of the status tag is the following:

<wfnm:status width="..." height="..." pageColor="..." [webflowColors="wf1=...;wf2=...;wfn=..."]/>

The attributes of the tag are:

  • width (mandatory): the width of the status table
  • height (mandatory): the height of the status table
  • pageColor (mandatory): the background color for pages
  • webflowColors (optional): the background color for webflow as a list <webflow name>=<color>

For example:

<wfnm:status width="600" height="350" pageColor="#F0E0F0" webflowColors="A=#CFFAFA; B=#FAFA9A; C=#FACF9A; D=#DAFADA"/>

The notify tag

The notify tag allows to notify to the WFNM framework that a page has been reached.

It should be used only for J2EE 1.3 implementations which do not allow a filter to handle both FORWARD and REQUEST (see here).

The syntax of the notify tag is the following:

<wfnm:notify/>

The notify tag must be used only at the very end of a JSP with older version of J2EE.