Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

WebWork comes with a utility called SiteGraph. SiteGraph is used to generate graphical diagrams representing the flow of your web application. It does this by parsing your configuration files, action classes, and view (JSP, Velocity, and FreeMarker) files. An example of a typical output of WebFlow SiteGraph is provided (for the full size, click here):

...

Wiki Markup
{snippet:id=javadocs-intro|lang=none|url=https://webwork.dev.java.net/source/browse/*checkout*/webwork/src/java/com/opensymphony/webwork/webFlowsitegraph/WebFlowSiteGraph.java}

Understanding the Output

There are several key things to notice when looking at the output from WebFlowSiteGraph:

  • Boxes: those shaded red indicate an action; those shaded green indicate a view file (JSP, etc).
  • Links: arrows colored green imply that no new HTTP request is being made; black arrows indicate a new HTTP request.
  • Link labels: labels may sometimes contain additional useful information. For example, a label of href means that the link behavior is that of a hyper-text reference. The complete label behaviors are provided:
    • href - a view file references an action by name (typically ending with the extension ".action")
    • action - a view file makes a call to the Action Tag
    • form - a view file is linked to an action using the Form Tag
    • redirect - an action is redirecting to another view or action
    • ! notation - a link to an action overrides the method to invoke

...

Wiki Markup
{snippet:id=sitegraph-usage|lang=none|url=https://webwork.dev.java.net/source/browse/*checkout*/webwork/src/java/com/opensymphony/webwork/webFlowsitegraph/webflowsitegraph-usage.txt}
Warning

You must supply the correct classpath when invoking the SiteGraph tool. Specifically, the XWork, WebWork, and their dependencies must be included in the classpath. Futhermore, you must also include your action class files referenced in xwork.xml. Without the proper class path entries, WebFlow SiteGraph will not function properly.

...

Wiki Markup
{snippet:id=javadocs-api|lang=none|url=https://webwork.dev.java.net/source/browse/*checkout*/webwork/src/java/com/opensymphony/webwork/webFlowsitegraph/WebFlowSiteGraph.java}

The command line version of SiteGraph does exactly this (except for overriding the Writer):

Wiki Markup
{snippet:id=example-api|lang=java|url=https://webwork.dev.java.net/source/browse/*checkout*/webwork/src/java/com/opensymphony/webwork/webFlowsitegraph/WebFlowSiteGraph.java}