Class UrlVar

public class UrlVar extends SimpleVar
URL variable resolver.

The format for this var is "$U{uri}".

The advantage of using this variable is that you can resolve URLs with special protocols such as "servlet:/xxx".

See UriResolver for the kinds of URIs that can be resolved.

This variable resolver requires that a RestRequest bean be available in the session bean store.

Uses the URI resolver returned by RestRequest.getUriResolver().

See Also:
  • Field Details

  • Constructor Details

    • UrlVar

      public UrlVar()
  • Method Details

    • resolve

      public String resolve(VarResolverSession session, String key)
      Description copied from class: Var
      The interface that needs to be implemented for subclasses of SimpleVar.
      Specified by:
      resolve in class Var
      session - The session object used for a single instance of a var resolution.
      key - The inside argument of the variable.
      The resolved value.
    • canResolve

      public boolean canResolve(VarResolverSession session)
      Description copied from class: Var
      Returns true if this variable can be resolved in the specified session.

      For example, some variable cannot resolve unless specific context or session objects are available.

      canResolve in class Var
      session - The current session.
      true if this variable can be resolved in the specified session.