Getting started

The best way for getting started with WFNM framework is to run the provided sample which is self-explanatory.

Download from SourceForge the file wfnm-sample-<version>.zip , unpack it and take a look of the content of the "build" directory: it contains two version of the WFNM sample, one for J2EE 1.4 implementations and one for J2EE 1.3 implementations.

The file "wfnm-sample.war" can be deployed into J2EE 1.4 web containers. It has been sucessfully tested with the following J2EE 1.4 implementations:

  • Jakarta Tomcat 5
  • Sun's J2EE 1.4 reference implementation

The file "wfnm-sample-j2ee13.war" can be deployed into J2EE 1.3 web containers. It has been sucessfully tested with the following J2EE 1.3 implementations:

  • IBM Websphere 5.1.0.3
  • BEA Weblogic 8.1 sp3

After the deployment, you can open a browser and digit the URL of the WFNM sample, which is tipically something like http://<host>:<port>/wfnm-sample

Please refer to the sample description to have more information about it.

Below a brief description on how the sample shows the WFNM framework capabilities:

It also allows other features like:

  • Avoid multiple form submits
  • Transparently add the "no cache" header directive
  • Log statistics on http session size

Webflow definition

The WFNM framework allows to define a webflow by placing a tag on pages which are entry for that webflow. Every page of the sample show the WFNM tags used on the page JSP source, if any is present.

For example a tag <wfnm:webflow name="A"/> indicates that the page is an entry for webflow A .

Server side navigation history

The WFNM provide a java factory, called DynamicFactory, that provides the information needed to implement the following dynamic navigation capabilities:

  • Back to the previous page
  • Back to the previous webflow
  • Back to a specific previous webflow given its name
  • Reload the current page

Each page of the sample (excluding pages for entering and configuring the framework) provide the following dynamic navigation buttons:

Automatic session cleaning

The WFNM framework allows to automatic clean the session when returning to a previous visited page or webflow. When it happens, it writes on the application server console messages like the following:

Removed from container object set [b1Form, obj_a2_b1, obj_b2_b4, obj_b1_b2, b4Form, b2Form]

If statistics are enabled, a session statistic file called "wfnm-sample-stats.csv" is also created inside the java temporary directory defined by the "java.io.tmpdir" system property (%CATALINA_HOME%/temp for Tomcat 5).

The session statistic file contains information like:

wfnm activepage urlsession size
TRUE/jsp/struts/a1.jsp1314
TRUE/jsp/struts/a2.jsp2676
TRUE/jsp/struts/b1.jsp4107
TRUE/jsp/struts/b2.jsp5469
TRUE/jsp/struts/b4.jsp6831
TRUE/jsp/struts/a2.jsp2676

In the above example, the file "wfnm-sample-stats.csv" shows numerically how the session size increase and how, by returning to page a2, it is automatically cleaned returning to be of the same size it was when the page a2 has been visited for the first time.

Other features

The WFNM framework provides other interesting features that are useful when developing a web application:

  • Avoid multiple form submits: if this feature is enabled, the WFNM framework executes only the first submit when the user press more that one time a submit button
  • Transparently add the "no cache" header directive: if this feature is enabled, the WFNM framework add a "no cache" header directive to every page.
  • Log statistics on http session size: if this feature is enabled, the WFNM framework write statistics on http session size on a file called "wfnm-sample-stats.csv" inside the java temporary directory defined by the "java.io.tmpdir" system property (%CATALINA_HOME%/temp for Tomcat 5), as also described in the previous section.