Class Base


@Marshalled(typeName="base") public class Base extends HtmlElementVoid<Base>
DTO for an HTML <base> element.

The base element specifies the base URL for all relative URLs in a document. It also specifies the default target for all links and forms in the document. Only one base element is allowed per document and it must be placed in the head section.

Examples:

// Set base URL for all relative links Base base1 = base().href("https://example.com/docs/"); // Set default target for all links Base base2 = base().target("_blank"); // Set both base URL and default target Base base3 = base().href("https://example.com/").target("_self");

The following convenience methods are provided for constructing instances of this bean:

See Also:
  • Constructor Details

    • Base

      public Base()
      Creates an empty Base element.
    • Base

      public Base(Object value)
      Creates a Base element with the specified href(Object) attribute.
      Parameters:
      value - The href(Object) attribute. Can be null, in which case the attribute is stored with a null value (not removed).
  • Method Details

    • href

      public Base href(Object value)
      href attribute.

      Document base URL.

      The value can be of any of the following types: URI, URL, String. Strings must be valid URIs.

      URIs defined by UriResolver can be used for values.

      Parameters:
      value - The new value for this attribute. Typically a URL or String. Can be null, in which case the attribute is stored with a null value (not removed).
      Returns:
      This object.
    • target

      public Base target(String value)
      target attribute.

      Specifies the default target for all links and forms in the document.

      Common values:

      • "_blank" - Open in a new window/tab
      • "_self" - Open in the same frame (default)
      • "_parent" - Open in the parent frame
      • "_top" - Open in the full body of the window
      • "framename" - Open in a named frame
      Parameters:
      value - The default target for links and forms. Can be null to unset the attribute.
      Returns:
      This object.