File serving URIs

This topic explains how GAS uses the URL of a request to determine the file system location from where to serve a file.

This topic provides examples of how the GAS uses configuration elements defined in your GAS configuration file to locate a file resource specified in an application's URL path (e.g. http://localhost:6394/demos.html) .

Table 1. File serving URIs
URI path Description
/ The slash (/) is the path to the document root configured in the Genero Application Server (GAS) configuration file. The DOCUMENT_ROOT element is located at /CONFIGURATION/APPLICATION_SERVER/INTERFACE_TO_CONNECTOR/DOCUMENT_ROOT, see DOCUMENT_ROOT.
For example, this excerpt is from the default GAS configuration file (as.xcf).
...
 <RESOURCE_LIST>
  <PLATFORM_INDEPENDENT>
   ...
   <RESOURCE Id="res.path.docroot" Source="INTERNAL">$(res.path.as)/web</RESOURCE>
   ...
  </PLATFORM_INDEPENDENT>
 </RESOURCE_LIST>
 ...
 <INTERFACE_TO_CONNECTOR>
  ...
  <DOCUMENT_ROOT>$(res.path.docroot)</DOCUMENT_ROOT>
  ...
 </INTERFACE_TO_CONNECTOR>
...

In this example, when calling the demo page using the URL http://localhost:6394/demos.html, you expect to find the demos.html file in the directory specified by the DOCUMENT_ROOT entry, i.e. the /web directory in your application server path.

/ua/i/ In this URL the slash (/) following the ua/i / is the path to the public resource directory, where resources such as images are found, see Paths to application resources.

In this example, when accessing the photo.jpeg with the URL http://localhost:6394/ua/i/photo.jpeg, you expect to find the photo.jpeg file in the directory specified by the $(res.public.resources), which expands to $(res.appdata.path)/public/common directory in your application server's application data path.

/ua/components In this URL the slash (/) following the ua/components/ is the path to the web component directory configured in the Genero Application Server (GAS) configuration file where web components are found. The WEB_COMPONENT_DIRECTORY element is located at /CONFIGURATION/APPLICATION_SERVER/WEB_APPLICATION_EXECUTION_COMPONENT/WEB_COMPONENT_DIRECTORY, see WEB_COMPONENT_DIRECTORY .
For example, this excerpt is from the default GAS configuration file (as.xcf).
 ...
 <WEB_APPLICATION_EXECUTION_COMPONENT Id="cpn.wa.execution.local">
  ...
      <WEB_COMPONENT_DIRECTORY>$(application.path)/webcomponents</WEB_COMPONENT_DIRECTORY>
  ...
 </WEB_APPLICATION_EXECUTION_COMPONENT>

...

In this example, when accessing a web component with the URL http://localhost:6394/ua/components/mywebcomponent, you expect to find the file in the directory specified by the WEB_COMPONENT_DIRECTORY entry, i.e. the /webcomponents directory in your application path.