Class PageMetadataUtils
java.lang.Object
com.endurancetrio.app.common.utils.PageMetadataUtils
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 Summary
Modifier and TypeMethodDescriptionstatic PageMetadatacreate(String view, String title, String description, jakarta.servlet.http.HttpServletRequest request, AppProperties properties) Creates aPageMetadatainstance populated with the given page data and application-wide configuration properties.static StringgetBaseUrl(jakarta.servlet.http.HttpServletRequest request) Extracts the base URL (scheme, host, and port) from the given request.
-
Method Details
-
getBaseUrl
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 aPageMetadatainstance populated with the given page data and application-wide configuration properties.- Parameters:
view- the template view nametitle- the page titledescription- the page descriptionrequest- the current HTTP requestproperties- the application configuration properties- Returns:
- a fully populated
PageMetadatainstance
-