Suppressing the Struts Page Flow Diagram
Written by Duncan Mills, Oracle Corporation
As part of the its support for the Oracle ADF runtime framework, JDeveloper 10g provides a visual page flow diagram to represent the Actions, Forwards and other implicit page flow defined in the struts-config.xml file. Developers are presented with a dual pane tabbed editor which gives them access to both the visual representation of the flow, and the source XML. This arrangement will give developers the flexibility to work in either a modeling or a code driven mode depending on which tab they have selected. However, some developers have expressed an interest in hiding the diagram view all together, either because they have very large configuration files that cannot be easily visualized in a diagram, or they are using Tiles based views that are not yet fully supported in the diagram view, or to simply remove the overhead of maintaining a diagram when they only ever want to work directly in the XML. This tip explains how to configure JDeveloper to manage the struts-config file in source only view.
The Struts Extensions
Like most parts of JDeveloper 10g, the Struts support is provided in the product in the form of an extension. There are in fact two nested extensions which make up the Struts design time support:
Given this modularity it is possible to switch off the diagram support without effecting the rest of the Struts handing such as XML validation against the DTD and property inspector support.
The IDE Without Struts Diagram Support
Struts diagram support has to be enabled or disabled at the extension level, this means that when JDeveloper is running with the support disabled, all Struts configurations in the IDE will be shown without diagrams. However, JDeveloper allows you to create multiple IDE configurations that can be switched between, to provide the option of working with or without diagram support. If you create a struts-config.xml without a diagram, and later switch JDeveloper to enable diagram support, then a diagram file will be automatically generated for you when you next open the XML file.
Creating the Extension Configuration
Developing Struts Without a Diagram
Running and Debugging
Without a Page flow diagram it is still possible to run selected Actions. Rather than selecting the action in the diagram and using the Run or Debug options off of the context menu, you can use the Structure Pane (Control+Shift+S) to select the required Action in the configuration and again choose run or debug from the context menu.
Setting the Default Run Target
To set an Action as the default run target for a configuration you will need to carry out two steps:
Creating New Struts Elements
To create new Struts Objects such as Action Mappings you can of course manually add them to the XML, or you can use the context menu on the structure pane to add any object that you require, using the property inspector to define any attributes such as an Action's path. The console style editor is also available from the context menu via the Edit Struts Config... option as an alternate editing UI.