Incubator > Beehive
 

Reference Documentation: beehive-netui-config.xml File

Description

The beehive-netui-config.xml file configures the runtime behavior of your Page Flow web app.

Use beehive-netui-config.xml to declare interceptor classes, override the default handler classes, etc.

General Structure

Elements

<action-interceptor>

Syntax

<action-interceptor>
  <interceptor-class> xsd:string </interceptor-class> [occurrences: 1]
  <custom-property> 
    <name> xsd:string </name> [occurrences: 1]
    <value> xsd:string </value> [occurrences: 1]  
  </custom-property> [occurrences: 0-*]
</action-interceptor>

Parents:

<global>, <per-pageflow>, <per-action>

Children:

<interceptor-class>, <custom-property>

<action-name>

Syntax

<action-name> xsd:string <action-name> [occurrences: 1]

Parents:

<per-action>

Children:

none

<after-action>

Syntax

 <after-action> xsd:boolean <after-action> [occurrences: 0-1] 

Parents:

<intercept-path>

Children:

none

<binding-context>

Syntax

<binding-context> [occurrences: 0-*]
  <name> xsd:string </name> [occurrences: 1]
  <factory-class> xsd:string </factory-class> [occurrences: 1]
</binding-context>

Parents:

<binding-contexts>

Children:

<name>, <factory-class>

<binding-contexts>

Syntax

</binding-contexts> [occurrences: 0-1]
  <binding-context> [occurrences: 0-*]
    <name> xsd:string </name> [occurrences: 1]
    <factory-class> xsd:string </factory-class> [occurrences: 1]
  </binding-context>
</binding-contexts>

Parents:

<expression-language>

Children:

<binding-context>

<converter-class>

Syntax

<converter-class> xsd:string </converter-class> [occurrences: 1]

Parents:

<type-converter>

Children:

none

<custom-property>

Syntax

<custom-property>
  <name> xsd:string </name> [occurrences: 1]
  <value> xsd:string </value> [occurrences: 1]
</custom-property>

Parents:

<action-interceptor>

Children:

<name>, <value>

<default-language>

Syntax

<default-language> xsd:string </default-language> [occurrences: 1]

Parents:

<expression-language>

Children:

none

<description>

Syntax

<description> xsd:string </description> [occurrences: 0-1]

Parents:

<module-config-locator>

Children:

none

<doctype>

Syntax

<doctype> [ html4-loose | xhtml1-transitional ] </doctype> [occurrences: 0-1]

Parents:

<jsp-tag-config>

Children:

none

<enable-renesting>

Syntax

<enable-renesting> xsd:boolean </enable-renesting> [occurrences: 0-1]

Parents:

<pageflow-config>

Children:

none

<ensure-secure-forwards>

For some server implementations, security checks are executed only when an URL is called directly, while security checks for server forwards are ignored.

When this element is set to true, server forwards are guaranteed to be checked.

Syntax

<ensure-secure-forwards> xsd:boolean </ensure-secure-forwards> [occurrences: 0-1]

Parents:

<pageflow-config>

Children:

none

<exceptions-handler-class>

Typically, exceptions thrown by the controller class are delivered in a wrapper exception class. The class named here, can be used to unwrap these exceptions and handle the underlying exception in a more fine-grained manner.

Syntax

<exceptions-handler-class> xsd:string </exceptions-handler-class> [occurrences: 0-1]

Parents:

<pageflow-handlers>

Children:

none

<expression-language>

Syntax

  <expression-language> [occurrences: 1-*]
    <name> xsd:string </name> [occurrences: 1]
    <factory-class> xsd:string </factory-class> [occurrences: 1]
    <binding-contexts> binding-contexts </binding-contexts> [occurrences: 0-1]
  </expression-language>

Parents:

<pageflow-handlers>

Children:

<name>, <factory-class>, <binding-contexts>

<expression-languages>

Syntax

<expression-languages> [occurrences: 1]
  <default-language> xsd:string </default-language> [occurrences: 1]
  <expression-language> [occurrences: 1-*]
    <name> xsd:string </name> [occurrences: 1]
    <factory-class> xsd:string </factory-class> [occurrences: 1]
    <binding-contexts> binding-contexts </binding-contexts> [occurrences: 0-1]
  </expression-language> 
</expression-languages>

Parents:

<netui-config>

Children:

<default-language>, <expression-language>

<factory-class>

Syntax

<factory-class> xsd:string </factory-class> [occurrences: 1]

Parents:

<binding-contexts>

Children:

none

<forward-redirect-handler-class>

Syntax

<forward-redirect-handler-class> xsd:string </forward-redirect-handler-class> [occurrences: 0-1]

Parents:

<pageflow-handlers>

Children:

none

<global>

Syntax

<global> [occurrences: 0-1]
  <simple-action-interceptor> 
    <intercept-path> xsd:string </intercept-path> [occurrences: 1]
    <after-action> xsd:boolean </after-action> [occurrences: 0-1]  
  </simple-action-interceptor> [occurrences: 0-*]
  <action-interceptor> 
    <interceptor-class> xsd:string </interceptor-class> [occurrences: 1]
    <custom-property> 
      <name> xsd:string </name> [occurrences: 1]
      <value> xsd:string </value> [occurrences: 1]
    </custom-property> [occurrences: 0-*]
  </action-interceptor> [occurrences: 0-*]
</global>

Parents:

<pageflow-action-interceptors>

Children:

<simple-action-inteceptor>, <action-inteceptor>

<id-javascript>

Syntax

<id-javascript> [ default | legacy | legacyOnly ] </id-javascript> [occurrences: 0-1]

Parents:

<jsp-tag-config>

Children:

none

<interceptor-class>

Syntax

<interceptor-class> xsd:string <interceptor-class> [occurrences: 1]

Parents:

<jsp-tag-config>

Children:

none

<intercept-path>

Syntax

<intercept-path> xsd:string </intercept-path> [occurrences: 1]

Parents:

<simple-action-interceptor>

Children:

none

<iterator-factories>

Syntax

<iterator-factories>
  <iterator-factory> [occurrences: 0-*]
    ...
  </iterator-factory>
</iterator-factories>

Parents:

<netui-config>

Children:

<iterator-factory>

<iterator-factory>

Syntax

<iterator-factory> [occurrences: 0-*]
  <name> xsd:string </name> [occurrences: 1]
  <factory-class> xsd:string </factory-class> [occurrences: 1]
</iterator-factory>

Parents:

<iterator-factorys>

Children:

<name>, <factory-class>

<jsp-tag-config>

Syntax

<jsp-tag-config>
  <doctype> xsd:string </doctype> [occurrences: 0-1]
  <id-javascript> [ default | legacy | legacyOnly ] </id-javascript> [occurrences: 0-1]
  <tree-image-location> xsd:string </tree-image-location> [occurrences: 0-1]
</jsp-tag-config>

Parents:

<netui-config>

Children:

<doctype>, <id-javascript>, <tree-image-location>,

<legacy-tag-support>

Syntax

<legacy-tag-support> xsd:boolean </legacy-tag-support> [occurrences: 0-1]

Parents:

<netui-config>

Children:

none

<locator-class>

Syntax

<locator-class> xsd:string </locator-class> [occurrences: 1]

Parents:

<module-config-locators>

Children:

none

<login-handler-class>

Syntax

<login-handler-class> xsd:string </login-handler-class> [occurrences: 0-1]

Parents:

<pageflow-handlers>

Children:

none

<max-forwards-per-request>

If the number of server forwards exceeds the given count, an error is written to the response and no further forwarding is excuted. This is mainly to prevent infinite loops of server forwards. To reproduce the error, invoke this action in a Page Flow:

    @Jpf.Action(
        forwards={
            @Jpf.Forward(name="self", path="overflow.do")
        }
    )
    public Forward overflow()
    {
        return new Forward( "self" );
    }

If the jpf-forward-overflow-count parameter is omitted from the web.xml file, the error will be written to the response after 50 server forwards within a single request.  

When an application is in development, a descriptive error is sent; for deployed applications, a 500 response is sent.

Syntax

<max-forwards-per-request> xsd:int </max-forwards-per-request> [occurrences: 0-1]

Parents:

<pageflow-config>

Children:

none

<max-nesting-stack-depth>

This parameter sets the maximum size of the Page Flow nesting stack. If Page Flows are repeatedly nested until the stack exceeds the specified value, an error is written to the response object and any further nesting is not allowed. This helps prevent the nesting stack from consuming large amounts of resources.

When an application is in development, a descriptive error is sent; for deployed applications, a 500 response is sent.

Syntax

<max-nesting-stack-depth> xsd:int </max-nesting-stack-depth> [occurrences: 0-1]

Parents:

<pageflow-config>

Children:

none

<module-config-locator>

Syntax

<module-config-locator> [occurrences: 0-*]
  <description> xsd:string </description> [occurrences: 0-1]
  <locator-class> xsd:string </locator-class> [occurrences: 1]
</module-config-locator>

Parents:

<module-config-locators>

Children:

<description>, <locator-class>

<module-config-locators>

Names a class or group of classes that know the location of the web application's Struts configuration files. By default these configuation files are saved to WEB-INF/.pageflow-struts-generated/. But, in cases where this default location has been overridden by a custom compilation process, use <module-config-locators> to point to a Java class that knows the new location.

Syntax

<module-config-locators> [occurrences: 0-1]
  <module-config-locator> [occurrences: 0-*]
    <description> xsd:string </description> [occurrences: 0-1]
    <locator-class> xsd:string </locator-class> [occurrences: 1]
  </module-config-locator>
</module-config-locators>

Parents:

<pageflow-config>

Children:

<module-config-locator>

<multipart-handler>

By default multi-part file uploading is disabled for page flow web applications. To turn it on, you must (1) explicitly set this element to memory or disk, or (2) decorate a given controller class with the @Jpf.MultipartHandler annotation. Doing (1) will enable file uploading across the entire web applcation, doing (2) enables file uploading on a controller-by-controller basis.

Syntax

<multipart-handler> [ disabled | memory | disk ] </multipart-handler> [occurrences: 0-1]

Parents:

<pageflow-config>

Children:

none

To disable file upload, set the value to "none". [todo: other values include memory, ?, ...]

<name>

Syntax

<name> xsd:string </name> [occurrences: 1]

Parents:

<expression-language>, <iterator-factory>, <binding-context>, <custom-property>

Children:

none

<netui-config>

The top-level element in the beehive-netui-config.xml file.  

Syntax

<netui-config>
  <legacy-tag-support> xsd:boolean </legacy-tag-support> [occurrences: 0-1]
  <expression-languages> ... </expression-languages> [occurrences: 1]
  <pageflow-action-interceptors> ... </pageflow-action-interceptors> [occurrences: 0-1]
  <pageflow-handlers> ... </pageflow-handlers> [occurrences: 0-1]
  <pageflow-config> ... </pageflow-config> [occurrences: 0-1]
  <type-converters> ... </type-converters> [occurrences: 0-1]
  <jsp-tag-config> ... </jsp-tag-config> [occurrences: 0-1]
  <iterator-factories> ... </iterator-factories> [occurrences: 0-1]
  <request-interceptors> ... </request-interceptors> [occurrences: 0-1]
</netui-config>

Parents:

Children:

<legacy-tag-support>, <expression-languages>, <pageflow-action-interceptors>, <pageflow-handlers>, <pageflow-config>, <type-converters>, <jsp-tag-config>, <iterator-factories>, <request-interceptors>

<pageflow-action-interceptors>

If you want to be notified before (or after) every action that's run in the webapp, you configure a <pageflow-action-interceptor> group. A simple example of this would be a monitoring infrastructure that keeps track of the number of actions raised. To keep track of the number of actions raised, register an interceptor that runs the counting code before going to any action. A more complex example is an interceptor that *redirects* you to another page flow before allowing you to go to the current one; for instance, it might take you to a nested page flow that asks you to fill out a "satisfaction survey" before sending you to the destination page flow.

The action-intercepting class is run twice: both before and after the execution of the action.

Also see:

Interface org.apache.beehive.netui.pageflow.interceptor.ActionInterceptor

Syntax

<pageflow-action-interceptors>
	<global> [occurrences: 0-1]
		<simple-action-interceptor> ... </simple-action-interceptor> [occurrences: 0-*]
		<action-interceptor> ... </action-interceptor> [occurrences: 0-*]
	</global>
	<per-pageflow> [occurrences: 0-*]
		<pageflow-uri> xsd:string </pageflow-uri> [occurrences: 1]
		<simple-action-interceptor> ... </simple-action-interceptor> [occurrences: 0-*]
		<action-interceptor> ... </action-interceptor> [occurrences: 0-*]
		<per-action> [occurrences: 0-*]
			<action-name> xsd:string </action-name> [occurrences: 1]
			<simple-action-interceptor> ... </simple-action-interceptor> [occurrences: 0-*]
			<action-interceptor> ... </action-interceptor> [occurrences: 0-*]
		</per-action>
	</per-pageflow>
</pageflow-action-interceptors>

Parents

<netui-config>

Children

<global>, <per-pageflow>

<pageflow-config>

Syntax

<pageflow-config>
	<enable-renesting> xsd:boolean </enable-renesting> [occurrences: 0-1]
	<max-forwards-per-request> xsd:int </max-forwards-per-request> [occurrences: 0-1]
	<max-nesting-stack-depth> xsd:int </max-nesting-stack-depth> [occurrences: 0-1]
	<ensure-secure-forwards> xsd:boolean </ensure-secure-forwards> [occurrences: 0-1]
	<throw-session-expired-exception> xsd:boolean </throw-session-expired-exception> [occurrences: 0-1]
	<multipart-handler> [ disabled | memory | disk ] </multipart-handler> [occurrences: 0-1]
	<module-config-locators> ... </module-config-locators> [occurrences: 0-1]
</pageflow-config>

Parents:

<netui-config>

Children:

<enable-renesting>, <max-forwards-per-request>, <max-nesting-stack-depth>, <ensure-secure-forwards>, <throw-session-expired-exception>, <multipart-handler>, <module-config-locators>,

Configures the page flow runtime across the webapp. If you want to disable file-upload, for instance, you set the multipart-handler to "none". There will be more settings here soon.  

<pageflow-handlers>

These settings let you override base framework behavior. A good example is the LoginHandler. By default, we use standard Servlet APIs to see if you're logged in, and we use some server-specific APIs to actually log you in when login() is called inside a page flow. If you want to replace this behavior with your own login scheme (which may look at a User database table for login information), you can provide your own LoginHandler that defines methods like login() and isUserInRole().

Syntax

<pageflow-handlers>
	<login-handler-class> xsd:string </login-handler-class> [occurrences: 0-1]
	<forward-redirect-handler-class> xsd:string </forward-redirect-handler-class> [occurrences: 0-1]
	<reloadable-class-handler-class> xsd:string </reloadable-class-handler-class> [occurrences: 0-1]
	<exceptions-handler-class> xsd:string </exceptions-handler-class> [occurrences: 0-1]
</pageflow-handlers>

Parents:

<netui-config>

Children:

<login-handler-class>, <forward-redirect-handler-class>, <reloadable-class-handler-class>, <exceptions-handler-class>

<pageflow-uri>

Syntax

<pageflow-uri> xsd:string </pageflow-uri> [occurrences: 1]

Parents:

<per-pageflow>

Children:

none

<per-action>

Syntax

<per-action> [occurrences: 0-*]
	<action-name> xsd:string </action-name> [occurrences: 1]
	<simple-action-interceptor> netui:simple-action-interceptor </simple-action-interceptor> [occurrences: 0-*]
	<action-interceptor> netui:action-interceptor </action-interceptor> [occurrences: 0-*]
</per-action>

Parents:

<global>

Children:

<action-name>, <simple-action-interceptor>, <action-interceptor>

<per-pageflow>

Syntax

<per-pageflow> [occurrences: 0-*]
	<pageflow-uri> xsd:string </pageflow-uri> [occurrences: 1]
	<simple-action-interceptor> netui:simple-action-interceptor </simple-action-interceptor> [occurrences: 0-*]
	<action-interceptor> netui:action-interceptor </action-interceptor> [occurrences: 0-*]
	<per-action> [occurrences: 0-*]
		<action-name> xsd:string </action-name> [occurrences: 1]
		<simple-action-interceptor> netui:simple-action-interceptor </simple-action-interceptor> [occurrences: 0-*]
		<action-interceptor> netui:action-interceptor </action-interceptor> [occurrences: 0-*]
	</per-action>
</per-pageflow>

Parents:

<global>

Children:

<pageflow-uri>, <simple-action-interceptor>, <action-interceptor>, <per-action>

<reloadable-class-handler-class>

Syntax

<reloadable-class-handler-class> xsd:string </reloadable-class-handler-class> [occurrences: 0-1]

Parents:

<pageflow-handlers>

Children:

none

<request-interceptors>

Syntax

<request-interceptors>
  <interceptor-class> xsd:string </interceptor-class> [occurrences: 1-*]
</request-interceptors>

Parents:

<netui-config>

Children:

<interceptor-class>

<simple-action-interceptor>

Syntax

<simple-action-interceptor>
  <intercept-path> xsd:string </intercept-path> [occurrences: 1]
  <after-action> xsd:boolean </after-action> [occurrences: 0-1]
</simple-action-interceptor>

Parents:

<netui-config>

Children:

none

<throw-session-expired-exception>

Syntax

<throw-session-expired-exception> xsd:boolean </throw-session-expired-exception> [occurrences: 0-1]

Parents:

<pageflow-config>

Children:

none

<tree-image-location>

Syntax

<tree-image-location> xsd:string </tree-image-location> [occurrences: 0-1]

Parents:

<jsp-tag-config>

Children:

none

<type>

Syntax

<type> xsd:string </type> [occurrences: 1]

Parents:

<type-converter>

Children:

none

<type-converter>

Syntax

<type-converter> [occurrences: 0-*]
  <type> xsd:string </type> [occurrences: 1]
  <converter-class> xsd:string </converter-class> [occurrences: 1]
</type-converter>

Parents:

<type-converters>

Children:

none

<type-converters>

Syntax

<type-converters>
  <type-converter> [occurrences: 0-*]
    <type> xsd:string </type> [occurrences: 1]
    <converter-class> xsd:string </converter-class> [occurrences: 1]
  </type-converter>
</type-converters>

Parents:

<netui-config>

Children:

<type-converter>

<value>

Syntax

<value> xsd:string </value> [occurrences: 1]

Parents:

<custom-property>

Children:

none

Example

Use the following example netui-config.xsd file as a template.

<?xml version="1.0" encoding="UTF-8"?>

<netui-config xmlns="http://beehive.apache.org/netui/2004/server/config">

    <legacy-tag-support>false</legacy-tag-support>

    <expression-languages>
        <default-language>netuiel</default-language>
        <expression-language>
            <name>netuiel</name>
            <factory-class>org.apache.beehive.netui.script.el.ExpressionEvaluatorImpl$NetUIELEngineFactory</factory-class>
        </expression-language>
    </expression-languages>

    <pageflow-action-interceptors>
        <global>
            <before-action>
                <action-interceptor>
                    <interceptor-class>miniTests.interceptors.InterceptorsController$BeforeInterceptor</interceptor-class>
                </action-interceptor>
                <action-interceptor>
                    <interceptor-class>miniTests.interceptors.InterceptorsController$BeforeInterceptor2</interceptor-class>
                </action-interceptor>
            </before-action>
            <after-action>
                <action-interceptor>
                    <interceptor-class>miniTests.interceptors.InterceptorsController$AfterInterceptor</interceptor-class>
                </action-interceptor>
                <action-interceptor>
                    <interceptor-class>miniTests.interceptors.InterceptorsController$AfterInterceptor2</interceptor-class>
                </action-interceptor>
            </after-action>
        </global>
    </pageflow-action-interceptors>

    <pageflow-handlers>
        <forward-redirect-handler-class>pageFlowCore.forwards.Controller$Redirector</forward-redirect-handler-class>
    </pageflow-handlers>

    <pageflow-config>
        <multipart-handler>memory</multipart-handler>
        <module-config-locators>
            <module-config-locator>
                <description>For /miniTests/moduleConfigLocator.</description>
                <locator-class>moduleConfigLocator.Locator1</locator-class>
            </module-config-locator>
        </module-config-locators>
    </pageflow-config>

    <jsp-tag-config>
       <doctype>html4-loose</doctype>
       <id-javascript>Legacy-JavaScript-Only</id-javascript>
    </jsp-tag-config>

    <iterator-factories>
    </iterator-factories>

</netui-config>
            
        

Related Topics