Home| Printable Version
The XGate configuration resides in the deployment descriptor of the Web application. If {webapps_location} is the web application deployment area of the Web server, the XML deployment descriptor of a {myapp} application can be found under {webapps_location}/{myapp}/WEB-INF/web.xml. An example web.xml file is shown below:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
    <servlet>
        <servlet-name>xgate</servlet-name>
        <servlet-class>com.hyfinity.xgate.HTTP2Java</servlet-class>
        <init-param>
            <param-name>morphyc</param-name>
            <!-- Sets the Morphyc configuration file to use for this application -->
            <param-value>c:/jprogramfiles/hyfinity/runtime/morphyc/helloworld_morphyc.xml</param-value>
        </init-param>
        <load-on-startup>10</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>xgate</servlet-name>
        <!-- Set all incoming requests to be handled by XGate.
             For an MVC application the mapping would be '*.do' to not pick up CSS, image, etc requests-->
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>30</session-timeout>
    </session-config>
</web-app>

                    
XGate also accepts a second configuration file stored in {webapps_location}/{myapp}/doc/xgate.xml. This file is optional, and if not present all the settings it contains will be defaulted to false. An example of this configuration file is given below. This example shows a typical configuration for an MVC project.
<?xml version="1.0" encoding="UTF-8"?>
<xgate xmlns:xg="http://www.hyfinity.com/xgate" xmlns:xfact="http://www.hyfinity.com/xfactory">
    <product>mvc</product>
    <plugins>
        <!--Turn on SXForms processing for binding HTTP Parameters into XML structure -->
        <sxforms mark_unbound="true" delete_bound="true">true</sxforms>
        <!--Ensure HTML output is returned to the browser -->
        <ensure_html_response>true</ensure_html_response>
        <!--Output the XHTML 1.0 Transitional Doctype-->
        <output_doctype doctype_system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" doctype_public="-//W3C//DTD XHTML 1.0 Transitional//EN">true</output_doctype>
        <!-- disable pre processing of soap requests
             If this is enabled, then a transform can be applied to incoming SOAP requests to format them for
             processing as standard HTML parameter based requests.-->
        <soap_preprocessing>false</soap_preprocessing>
        <!-- Define any custom plugins required -->
        <custom_plugins>
            <custom_plugin name="My Plugin" runtime_instance="com.test.MyPlugin" priority="10"/>
        </custom_plugins>
    </plugins>
</xgate>
                    
This file provides control over a number of inbuilt plugin capabilities as well as defining your own custom plugins. Each of these plugins sit between the browser and XPlatform and allow interception and inspection of the data received from the browser, and the response being sent out. For example, a plugin could be used to enforce custom security checks before allowing access to the application. If you are interested in developing custom XGate plugins please contact Hyfinity for more information on how they should be created, and the interface that must be implemented. Both of these configuration files will be automatically set up when deploying applications from XStudio. If you need to make any changes to these files however you can do, and these changes will be maintained even if the application is redeployed. XGate also makes use of other configuration files that are located within the doc directory within a particular web app structure, but these files should be managed automatically by the studio. For example, the mapping.xml file details all the actions that a particular web application will understand and process. If you would like more information on these files, please contact Hyfinity.
Managing Communication Protocols Invoking the Platform