Uniface URL Format

Uniface supports both semantic and non-semantic URLs.

Semantic URLs are intended to be readable and easy to understand by application users. They provide insight into the structure of data, and conform to a style of software architecture known as representational state transfer (REST). For this reason they are also known as RESTful URLs.

To illustrate the difference between tradition and semantic URLs, consider the following URLs for the same component and information:

  • Non-semantic URL: http://example.com/products?category=chairs&color=red

    This URL contains a query string of input parameters in which the information being requested may be opaque to users. Such query strings may include internal numeric identifiers for database values, illegibly-encoded data, session IDs, implementation details, and so on.

  • Semantic URL: http://example.com/products/chairs/red

    This URL can easily be interpreted by a user as a request for all products that are chairs that are red. It also means that this URL can be optimized for search engines (SEO), and that individual web resources can remain consistently at the same URL.

Uniface URL Format

When Uniface receives an HTTP request, it populates a number of channels of $webinfo. You can use $webinfo to retrieve the required information and prepare a response.

Uniface URLs can accept input parameters as:

  • Paths for semantic URLs:

    http://HostServer:Port/uniface/Servlet/ComponentName{.PublicOperation}{/PathInput}

    For example:

    http://example.com:8080/uniface/wrd/products.getInfo/chairs/red
  • Query strings for non-semantic URLs:

    http://HostServer:Port/uniface/Servlet/ComponentName{.PublicOperation}{?QueryString}

    http://example.com:8080/uniface/wrd/products.getInfo?category=chairs&color=red

where:

  • HostServer—IP address or domain name of the machine where the web server, such as Apache Tomcat, is running.
  • Port— port number on which the Uniface WRD servlet engine listens
  • uniface—virtual directory containing the web application's configuration file,web.xml, which contains the servlet definitions and their startup parameters
  • Servlet—Uniface servlet for brokering requesting between the web server and the Uniface Web Application Server (WASV). The Web Request Dispatcher (WRD) handles requests for dynamic and static server pages. The SOAP Request Dispatcher (SRD) handles requests for Uniface web services.
  • ComponentName—name of the Uniface component
  • PublicOperation—name of an operation that does not have parameters defined in the signature.
  • PathInput—optional; used for semantic URLs; string of input parameters in the form:

    Value{/Value}

    The PathInput is used for semantic URLs. Input path parameters are put into the PATHINPUT channel of $webinfo as a Uniface list.

  • QueryString—optional; used for non-semantic URLs; string of input parameters in the form:

    Key=Value{&Key=Value}

    The list can contain key=value pairs or value-only parameters but not both.

    For dynamic server pages, the parameters are put in the HTTPREQUESTPARAMS channel of $webinfo.

    For static server pages, they are put into the INPUT channel of $webinfo.

Related Topics