Class PageMetadataUtils

java.lang.Object
com.endurancetrio.app.common.utils.PageMetadataUtils

public final class PageMetadataUtils extends Object
The PageMetadataUtils class provides utility methods for building PageMetadata instances across controller classes in the application. The constructed metadata is shared between HTML <head> elements and other layout fragments (e.g. navigation bar, footer).
  • Method Details

    • getBaseUrl

      public static String getBaseUrl(jakarta.servlet.http.HttpServletRequest request)
      Extracts the base URL (scheme, host, and port) from the given request.
      Parameters:
      request - the current HTTP request
      Returns:
      the base URL, e.g. http://localhost:8080
    • create

      public static PageMetadata create(String view, String title, String description, jakarta.servlet.http.HttpServletRequest request, AppProperties properties)
      Creates a PageMetadata instance populated with the given page data and application-wide configuration properties.
      Parameters:
      view - the template view name
      title - the page title
      description - the page description
      request - the current HTTP request
      properties - the application configuration properties
      Returns:
      a fully populated PageMetadata instance