You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@juneau.apache.org by James Bognar <ja...@apache.org> on 2017/05/29 16:09:23 UTC

Improvements to URI resolution.

Quick heads-up....

I'm making across-the-board improvements to the URI-resolution support
(i.e. how URIs get serialized).

One new feature will be the support for resolving the following URI
protocols:

   - "context:/..." - Relative to context-root of the application.
   - "servlet:/..." - Relative to the servlet URI.
   - "request:/..." - Relative to the request URI.

For example, currently we define HTML page links using variables and
servlet-relative URIs...

pageLinks="{up:'$R{requestParentURI}', options:'?method=OPTIONS',
upload:'upload'}"

With these new protocols, we can define them like so:

pageLinks="{top:'context:/', up:'request:/..'
,options:'servlet:/?method=OPTIONS', upload:'servlet:/upload'}"

The old method of using variables and servlet-relative URIs will still be
supported, but using these new protocols should (hopefully) be easier to
understand.

These protocols work on all serialized URL and URI objects, as well as
classes and properties annotated with @URI.

Configuration properties will be provided for controlling whether URIs are
resolved to absolute or context-root-relative form, and for specifying
whether relative URIs are relative to the request URI or servlet URI.