The base.context accessors

The base.context.* accessors supply application-global information.

In a string context, the expression ${calyxo.base.context} itself can be used as a synonym for ${calyxo.base.context.path}.

path

Answers the application context path by delegating to HttpServletRequest.getContextPath().

Example

In the JSP fragment below, a resource is referenced by a context relative path without having to know the application context path.

<html>
  ...
  <img src="${calyxo.base.context.path}/images/logo.gif" alt="Logo"/>
  ...
</html>

home

Answers an absolute url pointing to the application root. The result is of the form http://<host>:<port><context>.

Example

Assuming an application running as /foo on host www.calyxo.org at port 8081, the fragment

<html>
  <head>
    ...
    <base href="${calyxo.base.context.home}/index.jsp"/>
    ...
  </head>
  ...
</html>

will cause the browser to set the HTML base to http://www.calyxo.org:8081/foo/index.jsp.

name

Answers the display name of the servlet context by delegating to ServletContext.getServletContextName().