diff --git a/doc/release-notes/6.2025.2_update.md b/doc/release-notes/6.2025.2_update.md
new file mode 100644
index 00000000000..5724612c6e9
--- /dev/null
+++ b/doc/release-notes/6.2025.2_update.md
@@ -0,0 +1,35 @@
+- Payara application server has been upgraded to version 6.2025.2. See #11126 and #11128.
+
+## Installation
+
+The following assumes the standard instructions to `export PAYARA=/usr/local/payara6`, undeploy v6.5, stop payara have been done already.
+
+### Upgrade to Payara 6.2025.2
+
+The steps below reuse your existing domain directory with the new distribution. You may also want to review the Payara upgrade instructions as it could be helpful during any troubleshooting:
+[Payara Release Notes](https://docs.payara.fish/community/docs/6.2025.2/Release%20Notes/Release%20Notes%206.2025.2.html).
+We also recommend you ensure you followed all update instructions from the past releases regarding Payara.
+(The most recent Payara update was for [v6.3](https://github.com/IQSS/dataverse/releases/tag/v6.3).)
+
+Move the current Payara directory out of the way:
+
+```shell
+mv $PAYARA $PAYARA.6.2024.6
+```
+
+Download the new Payara version 6.2025.2 (from https://www.payara.fish/downloads/payara-platform-community-edition/ or https://nexus.payara.fish/repository/payara-community/fish/payara/distributions/payara/6.2025.2/payara-6.2025.2.zip), and unzip it in its place:
+
+```shell
+cd /usr/local
+unzip payara-6.2025.2.zip
+```
+
+Replace the brand new `payara/glassfish/domains/domain1` with your old, preserved domain1:
+
+```shell
+mv payara6/glassfish/domains/domain1 payara6/glassfish/domains/domain1_DIST
+mv payara6.6.2024.6/glassfish/domains/domain1 payara6/glassfish/domains/
+```
+
+Deploy/install as normal
+
diff --git a/doc/sphinx-guides/source/developers/classic-dev-env.rst b/doc/sphinx-guides/source/developers/classic-dev-env.rst
index e002f950d19..2e32b8d4bfb 100755
--- a/doc/sphinx-guides/source/developers/classic-dev-env.rst
+++ b/doc/sphinx-guides/source/developers/classic-dev-env.rst
@@ -93,15 +93,15 @@ On Linux, install ``jq`` from your package manager or download a binary from htt
 Install Payara
 ~~~~~~~~~~~~~~
 
-Payara 6.2024.6 or higher is required.
+Payara 6.2025.2 or higher is required.
 
 To install Payara, run the following commands:
 
 ``cd /usr/local``
 
-``sudo curl -O -L https://nexus.payara.fish/repository/payara-community/fish/payara/distributions/payara/6.2024.6/payara-6.2024.6.zip``
+``sudo curl -O -L https://nexus.payara.fish/repository/payara-community/fish/payara/distributions/payara/6.2025.2/payara-6.2025.2.zip``
 
-``sudo unzip payara-6.2024.6.zip``
+``sudo unzip payara-6.2025.2.zip``
 
 ``sudo chown -R $USER /usr/local/payara6``
 
diff --git a/doc/sphinx-guides/source/developers/tips.rst b/doc/sphinx-guides/source/developers/tips.rst
index 8d715c7d016..d466dff5c76 100755
--- a/doc/sphinx-guides/source/developers/tips.rst
+++ b/doc/sphinx-guides/source/developers/tips.rst
@@ -296,3 +296,14 @@ with the following code in ``SettingsWrapper.java``:
 A more serious example would be direct calls to PermissionServiceBean methods used in render logic expressions. This is something that has happened and caused some problems in real life. A simple permission service lookup (for example, whether a user is authorized to create a dataset in the current dataverse) can easily take 15 database queries. Repeated multiple times, this can quickly become a measurable delay in rendering the page. PermissionsWrapper must be used exclusively for any such lookups from JSF pages.
 
 See also :doc:`performance`.
+
+JSF1103 Errors
+~~~~~~~~~~~~~~
+
+Errors of the form ``JSF1103: The metadata facet must be a direct child of the view in viewId /dataverse.xhtml`` come from use of the f:metadata tag at the wrong depth in the .xhtml.
+
+Most/all known instances of the problem were corrected in https://github.com/IQSS/dataverse/pull/11128.
+
+Any page that used <ui:composition template="/dataverse_template.xhtml"> was including the f:metadata farther down in the tree rather than as a direct child of the view.
+As of Payara 6.2025.2, it is not clear that this error was resulting in changes to UI behavior, but the error messages were in the log.
+If you see these errors, this note and the examples in the PR will hopefully provide some insight as to how to fix them.
diff --git a/doc/sphinx-guides/source/installation/prerequisites.rst b/doc/sphinx-guides/source/installation/prerequisites.rst
index d8f585270e3..0e17bc47166 100644
--- a/doc/sphinx-guides/source/installation/prerequisites.rst
+++ b/doc/sphinx-guides/source/installation/prerequisites.rst
@@ -44,7 +44,7 @@ On RHEL/derivative you can make Java 17 the default with the ``alternatives`` co
 Payara
 ------
 
-Payara 6.2024.6 is recommended. Newer versions might work fine. Regular updates are recommended.
+Payara 6.2025.2 is recommended. Newer versions might work fine. Regular updates are recommended.
 
 Installing Payara
 =================
@@ -55,8 +55,8 @@ Installing Payara
 
 - Download and install Payara (installed in ``/usr/local/payara6`` in the example commands below)::
 
-	# wget https://nexus.payara.fish/repository/payara-community/fish/payara/distributions/payara/6.2024.6/payara-6.2024.6.zip
-	# unzip payara-6.2024.6.zip
+	# wget https://nexus.payara.fish/repository/payara-community/fish/payara/distributions/payara/6.2025.2/payara-6.2025.2.zip
+	# unzip payara-6.2025.2.zip
 	# mv payara6 /usr/local
 
 If nexus.payara.fish is ever down for maintenance, Payara distributions are also available from https://repo1.maven.org/maven2/fish/payara/distributions/payara/
diff --git a/doc/sphinx-guides/source/qa/test-automation.md b/doc/sphinx-guides/source/qa/test-automation.md
index fe0d51f9174..73e7e570879 100644
--- a/doc/sphinx-guides/source/qa/test-automation.md
+++ b/doc/sphinx-guides/source/qa/test-automation.md
@@ -52,7 +52,7 @@ Go to the end of the log and then scroll up, looking for the failure. A failed A
 
 ```
 TASK [dataverse : download payara zip] *****************************************
-fatal: [localhost]: FAILED! => {"changed": false, "dest": "/tmp/payara.zip", "elapsed": 10, "msg": "Request failed: <urlopen error timed out>", "url": "https://nexus.payara.fish/repository/payara-community/fish/payara/distributions/payara/6.2024.6/payara-6.2024.6.zip"}
+fatal: [localhost]: FAILED! => {"changed": false, "dest": "/tmp/payara.zip", "elapsed": 10, "msg": "Request failed: <urlopen error timed out>", "url": "https://nexus.payara.fish/repository/payara-community/fish/payara/distributions/payara/6.2025.2/payara-6.2025.2.zip"}
 ```
 
 In the example above, if Payara can't be downloaded, we're obviously going to have problems deploying Dataverse to it!
diff --git a/modules/dataverse-parent/pom.xml b/modules/dataverse-parent/pom.xml
index 2e72f7c8794..c5a96f9c25a 100644
--- a/modules/dataverse-parent/pom.xml
+++ b/modules/dataverse-parent/pom.xml
@@ -148,7 +148,7 @@
         <argLine>-Duser.timezone=${project.timezone} -Dfile.encoding=${project.build.sourceEncoding} -Duser.language=${project.language} -Duser.region=${project.region}</argLine>
     
         <!-- Major system components and dependencies -->
-        <payara.version>6.2024.6</payara.version>
+        <payara.version>6.2025.2</payara.version>
         <postgresql.version>42.7.4</postgresql.version>
         <solr.version>9.8.0</solr.version>
         <aws.version>1.12.748</aws.version>
diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java b/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
index 1779b65cbe6..851722e0b47 100644
--- a/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
+++ b/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
@@ -6235,7 +6235,7 @@ public String getEffectiveMetadataLanguage(boolean ofParent) {
 
     public String getLocaleDisplayName(String code) {
         String displayName = settingsWrapper.getBaseMetadataLanguageMap(false).get(code);
-        if(displayName==null && !code.equals(DvObjectContainer.UNDEFINED_CODE)) {
+        if(displayName==null && code!=null && !code.equals(DvObjectContainer.UNDEFINED_CODE)) {
             //Default (for cases such as :when a Dataset has a metadatalanguage code but :MetadataLanguages is no longer defined).
             displayName = new Locale(code).getDisplayName();
         }
@@ -6251,6 +6251,11 @@ public List<String> getVocabScripts() {
     }
 
     public String getFieldLanguage(String languages) {
+        //Prevent NPE in Payara 6-2024-12 with CVoc
+        logger.info("Languages: " + languages);
+        if(languages==null) {
+            languages="";
+        }
         return fieldService.getFieldLanguage(languages,session.getLocaleCode());
     }
 
diff --git a/src/main/java/edu/harvard/iq/dataverse/DataverseSession.java b/src/main/java/edu/harvard/iq/dataverse/DataverseSession.java
index e8d76e1825e..607bc9d5a47 100644
--- a/src/main/java/edu/harvard/iq/dataverse/DataverseSession.java
+++ b/src/main/java/edu/harvard/iq/dataverse/DataverseSession.java
@@ -209,19 +209,17 @@ public String getLocaleTitle() {
     
     public void initLocale() {
         
-        if(FacesContext.getCurrentInstance() == null) {
-            localeCode = "en";
-        }
-        else if (FacesContext.getCurrentInstance().getViewRoot() == null ) {
-            localeCode = FacesContext.getCurrentInstance().getExternalContext().getRequestLocale().getLanguage();
-        }
-        else if (FacesContext.getCurrentInstance().getViewRoot().getLocale().getLanguage().equals("en_US")) {
-            localeCode = "en";
-        }
-        else {
-            localeCode = FacesContext.getCurrentInstance().getViewRoot().getLocale().getLanguage();
+
+        localeCode = "en";
+        if (FacesContext.getCurrentInstance() != null) {
+            if (FacesContext.getCurrentInstance().getViewRoot() == null) {
+                localeCode = FacesContext.getCurrentInstance().getExternalContext().getRequestLocale().getLanguage();
+            } else if (FacesContext.getCurrentInstance().getViewRoot().getLocale().getLanguage().equals("en_US")) {
+                localeCode = "en";
+            } else {
+                localeCode = FacesContext.getCurrentInstance().getViewRoot().getLocale().getLanguage();
+            }
         }
-        
         logger.fine("init: locale set to "+localeCode);
     }
 
diff --git a/src/main/webapp/ThemeAndWidgets.xhtml b/src/main/webapp/ThemeAndWidgets.xhtml
index fd8d7c7cf12..cde8b720aef 100644
--- a/src/main/webapp/ThemeAndWidgets.xhtml
+++ b/src/main/webapp/ThemeAndWidgets.xhtml
@@ -15,12 +15,14 @@
             <ui:param name="dataverse" value="#{themeWidgetFragment.editDv}"/>  
            
             <ui:param name="showMessagePanel" value="#{true}"/>
-            <ui:define name="body">
+            <ui:define name="metadata">
                 <f:metadata>
                     <f:viewParam name="id" value="#{themeWidgetFragment.editDv.id}"/>
                     <f:viewAction action="#{themeWidgetFragment.initEditDv}"/>
                     <f:viewAction action="#{dataverseHeaderFragment.initBreadcrumbs(themeWidgetFragment.editDv, bundle['dataverse.option.themeAndWidgets'])}"/>
                 </f:metadata>
+            </ui:define>
+            <ui:define name="body">
                 <h:form id="themeWidgetsForm">
                     <ui:include src="themeAndWidgetsFragment.xhtml"/>
                 </h:form>
diff --git a/src/main/webapp/confirmemail.xhtml b/src/main/webapp/confirmemail.xhtml
index 2a071c83817..8eac2d8db00 100644
--- a/src/main/webapp/confirmemail.xhtml
+++ b/src/main/webapp/confirmemail.xhtml
@@ -14,12 +14,14 @@
             <ui:param name="dataverse" value="#{dataverseServiceBean.findRootDataverse()}"/>
             <ui:param name="showDataverseHeader" value="false"/>
             <ui:param name="loginRedirectPage" value="dataverse.xhtml"/>
-            <ui:define name="body">
+            <ui:define name="metadata">
                 <f:metadata>
                     <f:viewParam name="token" value="#{ConfirmEmailPage.token}"/>
                     <f:viewAction action="#{dataverseSession.updateLocaleInViewRoot}"/>
                     <f:viewAction action="#{ConfirmEmailPage.init}" />
                 </f:metadata>
+            </ui:define>
+            <ui:define name="body">
 
                 <!--This is just the button. The error message is added via addErrorMessage in the backing bean.-->
                 <h:form styleClass="form-horizontal" rendered="#{ConfirmEmailPage.invalidToken}">
diff --git a/src/main/webapp/dashboard.xhtml b/src/main/webapp/dashboard.xhtml
index 5f083a7455f..577d8c67f63 100644
--- a/src/main/webapp/dashboard.xhtml
+++ b/src/main/webapp/dashboard.xhtml
@@ -12,13 +12,15 @@
         <ui:composition template="/dataverse_template.xhtml">
             <ui:param name="pageTitle" value="#{bundle['dashboard.title']} - #{dataverseServiceBean.findRootDataverse().name}"/>
             <ui:param name="showDataverseHeader" value="false"/>
-            <ui:define name="body">
+            <ui:define name="metadata">
                 <f:metadata>
                     <f:viewParam name="dataverseId" value="#{dashboardPage.dataverseId}"/>
                     <f:viewAction action="#{dataverseSession.updateLocaleInViewRoot}"/>
                     <f:viewAction action="#{dashboardPage.init}"/>
                     <f:viewAction action="#{dataverseHeaderFragment.initBreadcrumbs(dataverseServiceBean.findRootDataverse(), bundle['dashboard.title'])}"/>
                 </f:metadata>
+            </ui:define>
+            <ui:define name="body">
                
                 <div id="dashboard-block" class="content">
                     <div class="container">
diff --git a/src/main/webapp/dataset-widgets.xhtml b/src/main/webapp/dataset-widgets.xhtml
index f635099dfdb..ed551a1676f 100644
--- a/src/main/webapp/dataset-widgets.xhtml
+++ b/src/main/webapp/dataset-widgets.xhtml
@@ -15,13 +15,15 @@
             <ui:param name="dataverse" value="#{DatasetWidgetsPage.dataset.owner}"/>
             <ui:param name="dataset" value="#{DatasetWidgetsPage.dataset}"/>
             <ui:param name="showMessagePanel" value="#{true}"/>
-            <ui:define name="body">
+            <ui:define name="metadata">
                 <f:metadata>
                     <f:viewParam name="datasetId" value="#{DatasetWidgetsPage.datasetId}"/>
                     <f:viewAction action="#{dataverseSession.updateLocaleInViewRoot}"/>
                     <f:viewAction action="#{DatasetWidgetsPage.init}" />
                     <f:viewAction action="#{dataverseHeaderFragment.initBreadcrumbs(DatasetWidgetsPage.dataset, bundle['dataset.thumbnailsAndWidget.breadcrumbs.title'])}"/>
                 </f:metadata>
+            </ui:define>
+            <ui:define name="body">
                 <h:form id="themeWidgetsForm" styleClass="row form-horizontal">
                 <p:tabView rendered="#{themeWidgetFragment.editDv!=null}" id="themeWidgetsTabView" widgetVar="content">
                     <p:tab id="thumbnailsTab" title="#{bundle['dataset.thumbnailsAndWidget.thumbnails.title']}">
diff --git a/src/main/webapp/dataset.xhtml b/src/main/webapp/dataset.xhtml
index 77258325b21..6a4e0432736 100644
--- a/src/main/webapp/dataset.xhtml
+++ b/src/main/webapp/dataset.xhtml
@@ -96,6 +96,29 @@
                     <meta property="article:published_time" content="#{DatasetPage.workingVersion.publicationDateAsString}" />
                 </ui:fragment>
             </ui:define>
+            <ui:define name="metadata">
+                <f:metadata>
+                  <f:viewParam name="id" value="#{DatasetPage.id}"/>
+                  <o:viewParam name="ownerId" value="#{DatasetPage.ownerId}"/>
+                  <f:viewParam name="version" value="#{DatasetPage.version}"/>
+                  <f:viewParam name="versionId" value="#{DatasetPage.versionId}"/>
+                  <f:viewParam name="persistentId" value="#{DatasetPage.persistentId}"/>
+                  <f:viewParam name="showIngestSuccess" value="#{DatasetPage.showIngestSuccess}"/>
+                  <f:viewParam name="fileSortField" value="#{DatasetPage.fileSortField}"/>
+                  <f:viewParam name="fileSortOrder" value="#{DatasetPage.fileSortOrder}"/>
+                  <o:viewParam name="tagPresort" value="#{DatasetPage.tagPresort}" default="true"/>
+                  <o:viewParam name="folderPresort" value="#{DatasetPage.folderPresort}" default="true"/>
+                  <f:viewParam name="q" value="#{DatasetPage.fileLabelSearchTerm}"/>
+                  <f:viewParam name="fileTypeGroupFacet" value="#{DatasetPage.fileTypeFacet}"/>
+                  <f:viewParam name="fileAccess" value="#{DatasetPage.fileAccessFacet}"/>
+                  <f:viewParam name="fileTag" value="#{DatasetPage.fileTagsFacet}"/>
+                  <o:viewParam name="selectTab" value="#{DatasetPage.selectTab}" default="dataFilesTab"/>
+                  <f:viewAction action="#{dataverseSession.updateLocaleInViewRoot}"/>
+                  <f:viewAction action="#{DatasetPage.init}" rendered="true"/>
+                  <f:viewAction action="#{DatasetPage.viewActionInitBreadcrumbs()}"/> 
+                  <f:viewAction action="#{EditDatafilesPage.initCreateMode(DatasetPage.editMode, DatasetPage.workingVersion, DatasetPage.uploadInProgress, DatasetPage.newFiles, DatasetPage.uploadedFiles, DatasetPage.selectedFiles)}"/>
+                </f:metadata>
+            </ui:define>
             <ui:define name="body">
                 <!-- Add Signposting-->
                 <c:if test="#{not empty DatasetPage.getSignpostingLinkHeader()}">
@@ -106,27 +129,6 @@
                 <o:importConstants type="edu.harvard.iq.dataverse.settings.FeatureFlags" />
                 <ui:param name="versionNoteEnabled" value="#{FeatureFlags.VERSION_NOTE.enabled()}"/>
                 
-                <f:metadata>
-                    <f:viewParam name="id" value="#{DatasetPage.id}"/>
-                    <o:viewParam name="ownerId" value="#{DatasetPage.ownerId}"/>
-                    <f:viewParam name="version" value="#{DatasetPage.version}"/>
-                    <f:viewParam name="versionId" value="#{DatasetPage.versionId}"/>
-                    <f:viewParam name="persistentId" value="#{DatasetPage.persistentId}"/>
-                    <f:viewParam name="showIngestSuccess" value="#{DatasetPage.showIngestSuccess}"/>
-                    <f:viewParam name="fileSortField" value="#{DatasetPage.fileSortField}"/>
-                    <f:viewParam name="fileSortOrder" value="#{DatasetPage.fileSortOrder}"/>
-                    <o:viewParam name="tagPresort" value="#{DatasetPage.tagPresort}" default="true"/>
-                    <o:viewParam name="folderPresort" value="#{DatasetPage.folderPresort}" default="true"/>
-                    <f:viewParam name="q" value="#{DatasetPage.fileLabelSearchTerm}"/>
-                    <f:viewParam name="fileTypeGroupFacet" value="#{DatasetPage.fileTypeFacet}"/>
-                    <f:viewParam name="fileAccess" value="#{DatasetPage.fileAccessFacet}"/>
-                    <f:viewParam name="fileTag" value="#{DatasetPage.fileTagsFacet}"/>
-                    <o:viewParam name="selectTab" value="#{DatasetPage.selectTab}" default="dataFilesTab"/>
-                    <f:viewAction action="#{dataverseSession.updateLocaleInViewRoot}"/>
-                    <f:viewAction action="#{DatasetPage.init}" rendered="true"/>
-                    <f:viewAction action="#{DatasetPage.viewActionInitBreadcrumbs()}"/> 
-                    <f:viewAction action="#{EditDatafilesPage.initCreateMode(DatasetPage.editMode, DatasetPage.workingVersion, DatasetPage.uploadInProgress, DatasetPage.newFiles, DatasetPage.uploadedFiles, DatasetPage.selectedFiles)}"/>
-                </f:metadata>
                 <h:form id="datasetForm">
                     <h:inputHidden id="validateFilesOutcome" value="#{DatasetPage.validateFilesOutcome}" />
                     <h:inputHidden id="validTermsofAccess" value="#{DatasetPage.hasValidTermsOfAccess}" />
diff --git a/src/main/webapp/dataverse.xhtml b/src/main/webapp/dataverse.xhtml
index d452f76c9cd..4ffac1c24b3 100644
--- a/src/main/webapp/dataverse.xhtml
+++ b/src/main/webapp/dataverse.xhtml
@@ -18,8 +18,7 @@
             <ui:define name="meta_header">
             <meta name="description" content="#{MarkupChecker:stripAllTags(DataversePage.dataverse.description)}"/>
             </ui:define>
-            <ui:define name="body">
-                <f:loadBundle basename="ValidationMessages" var="valMsg"/>
+            <ui:define name="metadata">
                 <f:metadata>
                     <f:viewParam name="id" value="#{DataversePage.id}"/>
                     <f:viewParam name="alias" value="#{DataversePage.alias}"/>
@@ -49,6 +48,9 @@
                     <f:viewParam name="adjustFacetNumber" value="#{SearchIncludeFragment.adjustFacetNumber}"/>
                     <f:viewAction action="#{SearchIncludeFragment.search()}" />
                 </f:metadata>
+            </ui:define>
+            <ui:define name="body">
+                <f:loadBundle basename="ValidationMessages" var="valMsg"/>
                 <h:form id="dataverseForm">
                     <!-- Edit Mode -->
                     <ui:fragment rendered="#{DataversePage.editMode == 'INFO' or DataversePage.editMode == 'CREATE'}">
diff --git a/src/main/webapp/dataverse_homepage.xhtml b/src/main/webapp/dataverse_homepage.xhtml
index bbf03ea22ad..f12fb40ae68 100644
--- a/src/main/webapp/dataverse_homepage.xhtml
+++ b/src/main/webapp/dataverse_homepage.xhtml
@@ -14,12 +14,14 @@
         <ui:composition template="/dataverse_template.xhtml">
             <ui:param name="pageTitle" value="#{empty DataversePage.dataverse.name ? bundle.new : DataversePage.dataverse.name}"/>
             <ui:param name="dataverse" value="#{DataversePage.dataverse}"/>
-            <ui:define name="body">
+            <ui:define name="metadata">
                 <f:metadata>
                     <f:viewParam name="showDataverseHeader" value="false"/>
                     <f:viewAction action="#{dataverseSession.updateLocaleInViewRoot}"/>
                     <f:viewAction action="#{DataversePage.init}"/>
                 </f:metadata>
+            </ui:define>
+            <ui:define name="body">
                 
                 <o:resourceInclude path="/CustomizationFilesServlet?customFileType=homePage" />
 
diff --git a/src/main/webapp/dataverse_template.xhtml b/src/main/webapp/dataverse_template.xhtml
index a1f22a97642..719a59674a9 100644
--- a/src/main/webapp/dataverse_template.xhtml
+++ b/src/main/webapp/dataverse_template.xhtml
@@ -11,8 +11,9 @@
       lang="#{dataverseSession.localeCode}"
       xml:lang="#{dataverseSession.localeCode}">
     <f:view locale="#{dataverseSession.localeCode}">
+    <ui:insert name="metadata" />
     <h:head>
-	<o:importFunctions type="edu.harvard.iq.dataverse.util.MarkupChecker" />
+        <o:importFunctions type="edu.harvard.iq.dataverse.util.MarkupChecker" />
         <f:facet name="first">
             <o:resourceInclude path="/CustomizationFilesServlet?customFileType=analytics" />
             <title><h:outputText value="#{pageTitle}"/></title>
diff --git a/src/main/webapp/dataverseuser.xhtml b/src/main/webapp/dataverseuser.xhtml
index edf65e7472b..3cabca45a26 100644
--- a/src/main/webapp/dataverseuser.xhtml
+++ b/src/main/webapp/dataverseuser.xhtml
@@ -17,6 +17,17 @@
             <ui:param name="showDataverseHeader" value="false"/>
             <ui:param name="showMessagePanel" value="#{true}"/>
             <ui:param name="loginRedirectPage" value="dataverseuser.xhtml"/>
+            <ui:define name="metadata">
+                <f:metadata>
+                    <f:event type="preRenderView" listener="#{facesContext.externalContext.response.setHeader('Cache-Control', 'no-cache, no-store')}"/>
+                    <o:viewParam name="editMode" value="#{DataverseUserPage.editMode}"/>
+                    <f:viewParam name="redirectPage" value="#{DataverseUserPage.redirectPage}"/>
+                    <o:viewParam name="selectTab" value="#{DataverseUserPage.selectTab}" default="dataRelatedToMe"/>
+                    <f:viewAction action="#{dataverseSession.updateLocaleInViewRoot}"/>
+                    <f:viewAction action="#{DataverseUserPage.init}" />
+                    <f:viewAction action="#{dataverseHeaderFragment.initBreadcrumbs(dataverseServiceBean.findRootDataverse(), (DataverseUserPage.editMode == 'CREATE' ? bundle['user.createBtn'] : bundle.account))}"/>
+                </f:metadata>
+            </ui:define>
             <ui:define name="body">
                 <!-- 
                  The following script is needed to protect a user's personal data 
@@ -35,15 +46,7 @@
                 </script>
 
                 <f:loadBundle basename="propertyFiles.Bundle" var="bundle"/>
-                <f:metadata>
-                    <f:event type="preRenderView" listener="#{facesContext.externalContext.response.setHeader('Cache-Control', 'no-cache, no-store')}"/>
-                    <o:viewParam name="editMode" value="#{DataverseUserPage.editMode}"/>
-                    <f:viewParam name="redirectPage" value="#{DataverseUserPage.redirectPage}"/>
-                    <o:viewParam name="selectTab" value="#{DataverseUserPage.selectTab}" default="dataRelatedToMe"/>
-                    <f:viewAction action="#{dataverseSession.updateLocaleInViewRoot}"/>
-                    <f:viewAction action="#{DataverseUserPage.init}" />
-                    <f:viewAction action="#{dataverseHeaderFragment.initBreadcrumbs(dataverseServiceBean.findRootDataverse(), (DataverseUserPage.editMode == 'CREATE' ? bundle['user.createBtn'] : bundle.account))}"/>
-                </f:metadata>
+
                 <h1>#{pageTitle}</h1>
                 <h:form id="dataverseUserForm">
 
diff --git a/src/main/webapp/editdatafiles.xhtml b/src/main/webapp/editdatafiles.xhtml
index be78359e02b..b2192089bf3 100644
--- a/src/main/webapp/editdatafiles.xhtml
+++ b/src/main/webapp/editdatafiles.xhtml
@@ -21,7 +21,7 @@
             <ui:param name="version" value="#{EditDatafilesPage.workingVersion}"/>
             <ui:param name="fileMetadatas" value="#{EditDatafilesPage.fileMetadatas}"/>
             <ui:param name="showMessagePanel" value="#{true}"/>
-            <ui:define name="body">
+            <ui:define name="metadata">
                 <f:metadata>
                     <f:viewParam name="datasetId" value="#{EditDatafilesPage.dataset.id}"/>
                     <o:viewParam name="mode" value="#{EditDatafilesPage.mode}"/>
@@ -35,6 +35,8 @@
                     <o:viewAction action="#{dataverseHeaderFragment.initBreadcrumbsForFileMetadata(EditDatafilesPage.singleFile, (EditDatafilesPage.mode == 'REPLACE' ? bundle['file.replaceFile'] : bundle['file.editFiles']))}"
                                   if="#{EditDatafilesPage.referrer == 'FILE'}" />
                 </f:metadata>
+            </ui:define>
+            <ui:define name="body">
                 <h:form id="datasetForm">
                     <!-- BEGIN: file replace original -->
                     <div class="row" jsf:rendered="#{EditDatafilesPage.fileReplaceOperation}">
diff --git a/src/main/webapp/file.xhtml b/src/main/webapp/file.xhtml
index 925daa3feb4..b72c7dd4cb5 100644
--- a/src/main/webapp/file.xhtml
+++ b/src/main/webapp/file.xhtml
@@ -25,7 +25,7 @@
             <ui:define name="meta_header">
             <meta name="description" content="#{FilePage.fileMetadata.description}"/>
             </ui:define>
-            <ui:define name="body">
+            <ui:define name="metadata">
                 <f:metadata>
                     <o:viewParam name="fileId" value="#{FilePage.fileId}"/>
                     <f:viewParam name="version" value="#{FilePage.version}"/>
@@ -36,6 +36,8 @@
                     <f:viewAction action="#{FilePage.init}"/>
                     <f:viewAction action="#{dataverseHeaderFragment.initBreadcrumbsForFileMetadata(FilePage.fileMetadata)}"/>
                 </f:metadata>
+            </ui:define>
+            <ui:define name="body">
                 <h:form id="fileForm">
                     <!-- Top Button/Citation Blocks -->
                     <div id="fileVersionBlock" class="row">
diff --git a/src/main/webapp/guestbook.xhtml b/src/main/webapp/guestbook.xhtml
index 3528ff5f032..04bf30614fe 100644
--- a/src/main/webapp/guestbook.xhtml
+++ b/src/main/webapp/guestbook.xhtml
@@ -15,7 +15,7 @@
             <ui:param name="dataverse" value="#{GuestbookPage.guestbook.dataverse}"/>
             <ui:param name="guestbook" value="#{GuestbookPage.guestbook}"/>
             <ui:param name="showMessagePanel" value="#{true}"/>
-            <ui:define name="body">
+            <ui:define name="metadata">
                 <f:metadata>
                     <f:viewParam name="id" value="#{GuestbookPage.guestbookId}"/>
                     <f:viewParam name="ownerId" value="#{GuestbookPage.ownerId}"/>
@@ -24,7 +24,8 @@
                     <f:viewAction action="#{GuestbookPage.init}" />
                     <f:viewAction action="#{dataverseHeaderFragment.initBreadcrumbs(GuestbookPage.dataverse, (GuestbookPage.editMode == 'CREATE' ? bundle['dataset.manageGuestbooks.createBtn'] : GuestbookPage.guestbook.name))}"/>
                 </f:metadata>
-
+            </ui:define>
+            <ui:define name="body">
                 <h:form id="guestbookForm">
                     <p:focus context="guestbookForm"/>
                     <!-- Header / Button Panel -->
diff --git a/src/main/webapp/mydata_page.xhtml b/src/main/webapp/mydata_page.xhtml
index b8c70f16079..084a482f0f7 100644
--- a/src/main/webapp/mydata_page.xhtml
+++ b/src/main/webapp/mydata_page.xhtml
@@ -15,11 +15,13 @@
     <ui:composition template="/dataverse_template.xhtml">
       <ui:param name="pageTitle" value="Role/Permission Relationships - #{dataverseServiceBean.findRootDataverse().name}"/>
       <ui:param name="showDataverseHeader" value="false"/>
-      <ui:define name="body">
+      <ui:define name="metadata">
           <f:metadata>   
                 <f:viewAction action="#{dataverseSession.updateLocaleInViewRoot}"/>
                 <f:viewAction action="#{MyDataPage.init}" />
           </f:metadata>
+      </ui:define>
+      <ui:define name="body">
           <ui:include src="mydata_fragment.xhtml"></ui:include>
     </ui:define>
     </ui:composition>
diff --git a/src/main/webapp/passwordreset.xhtml b/src/main/webapp/passwordreset.xhtml
index 4ffbdf21e08..e475f870394 100644
--- a/src/main/webapp/passwordreset.xhtml
+++ b/src/main/webapp/passwordreset.xhtml
@@ -14,13 +14,15 @@
             <ui:param name="dataverse" value="#{dataverseServiceBean.findRootDataverse()}"/>
             <ui:param name="showDataverseHeader" value="false"/>
             <ui:param name="loginRedirectPage" value="dataverse.xhtml"/>
-            <ui:define name="body">
+
+            <ui:define name="metadata">
                 <f:metadata>
                     <f:viewParam name="token" value="#{PasswordResetPage.token}"/>
                     <f:viewAction action="#{dataverseSession.updateLocaleInViewRoot}"/>
                     <f:viewAction action="#{PasswordResetPage.init}" />
                 </f:metadata>
-
+            </ui:define>
+            <ui:define name="body">
                 <ui:fragment id="debugVariables" rendered="false">
                     <div style="background-color: lightgray; margin-top:3em;">
                         <tt>
diff --git a/src/main/webapp/previewurl.xhtml b/src/main/webapp/previewurl.xhtml
index 980d775506b..c9e2ffeedfa 100644
--- a/src/main/webapp/previewurl.xhtml
+++ b/src/main/webapp/previewurl.xhtml
@@ -12,7 +12,7 @@
         <ui:composition template="/dataverse_template.xhtml">
             <ui:param name="pageTitle" value="#{bundle['dataset.privateurl.header']}"/>
             <ui:param name="showDataverseHeader" value="false"/>
-            <ui:define name="body">
+            <ui:define name="metadata">
                 <f:metadata>
                     <f:viewParam name="token" value="#{PrivateUrlPage.token}"/>
                     <f:viewAction action="#{dataverseSession.updateLocaleInViewRoot}"/>
diff --git a/src/main/webapp/privateurl.xhtml b/src/main/webapp/privateurl.xhtml
index 5ca90112a84..a1bac00534e 100644
--- a/src/main/webapp/privateurl.xhtml
+++ b/src/main/webapp/privateurl.xhtml
@@ -12,7 +12,7 @@
         <ui:composition template="/dataverse_template.xhtml">
             <ui:param name="pageTitle" value="#{bundle['dataset.privateurl.header']}"/>
             <ui:param name="showDataverseHeader" value="false"/>
-            <ui:define name="body">
+            <ui:define name="metadata">
                 <f:metadata>
                     <f:viewParam name="token" value="#{PrivateUrlPage.token}"/>
                     <f:viewAction action="#{dataverseSession.updateLocaleInViewRoot}"/>
diff --git a/src/main/webapp/role_permission_helper.xhtml b/src/main/webapp/role_permission_helper.xhtml
index 88430a8ad81..cd2504089cf 100644
--- a/src/main/webapp/role_permission_helper.xhtml
+++ b/src/main/webapp/role_permission_helper.xhtml
@@ -12,7 +12,7 @@
     <ui:composition template="/dataverse_template.xhtml">
       <ui:param name="pageTitle" value="Role/Permission Relationships - #{dataverseServiceBean.findRootDataverse().name}"/>
       <ui:param name="showDataverseHeader" value="false"/>
-      <ui:define name="body">
+      <ui:define name="metadata">
           <f:metadata>
                 <ui:remove>
                     <f:viewParam name="id" value="#{DatasetPage.dataset.id}"/>
@@ -24,6 +24,8 @@
                 <f:viewAction action="#{dataverseSession.updateLocaleInViewRoot}"/>
                 <f:viewAction action="#{RolePermissionHelperPage.init}" />
           </f:metadata>
+      </ui:define>
+      <ui:define name="body">
           <div>
         
               <h4>Related roles for each DvObject type</h4>
diff --git a/src/main/webapp/search/advanced.xhtml b/src/main/webapp/search/advanced.xhtml
index 24b78ba0dc9..c921fe930d5 100644
--- a/src/main/webapp/search/advanced.xhtml
+++ b/src/main/webapp/search/advanced.xhtml
@@ -15,13 +15,15 @@
             <ui:param name="pageTitle" value="#{thisPageTitle}"/>
             <ui:param name="dataverse" value="#{AdvancedSearchPage.dataverse}"/>
             <ui:param name="ownerId" value="#{DataversePage.ownerId}"/>
-            <ui:define name="body">
+            <ui:define name="metadata">
                 <f:metadata>
                     <f:viewAction action="#{dataverseSession.updateLocaleInViewRoot}"/>
                     <f:viewAction action="#{AdvancedSearchPage.init}"/>
                     <f:viewParam name="dataverseIdentifier" value="#{AdvancedSearchPage.dataverseIdentifier}"/>
                     <f:viewAction action="#{dataverseHeaderFragment.initBreadcrumbs(AdvancedSearchPage.dataverse, bundle['dataverse.search.advancedSearch'])}"/>
                 </f:metadata>
+            </ui:define>
+            <ui:define name="body">
                 <p:fragment>
                     <p:autoUpdate/>
                     <ui:repeat value="#{AdvancedSearchPage.vocabScripts}" var="vocabScriptUrl">
diff --git a/src/main/webapp/superuser.xhtml b/src/main/webapp/superuser.xhtml
index bc7426948b7..3c4212dcf92 100644
--- a/src/main/webapp/superuser.xhtml
+++ b/src/main/webapp/superuser.xhtml
@@ -13,11 +13,13 @@
     <ui:composition template="/dataverse_template.xhtml">
       <ui:param name="pageTitle" value="Superuser - #{dataverseServiceBean.findRootDataverse().name}"/>
       <ui:param name="showDataverseHeader" value="false"/>
-      <ui:define name="body">
+      <ui:define name="metadata">
           <f:metadata>
               <f:viewAction action="#{dataverseSession.updateLocaleInViewRoot}"/>
               <f:viewAction action="#{SuperUserPage.init}"/>
           </f:metadata>
+      </ui:define>
+      <ui:define name="body">
         <h:form id="indexAllForm">
           <div>
             <button class="btn btn-default" jsf:action="#{SuperUserPage.startIndexAll()}">
diff --git a/src/main/webapp/template.xhtml b/src/main/webapp/template.xhtml
index 12dca612f1b..5f1e6592971 100644
--- a/src/main/webapp/template.xhtml
+++ b/src/main/webapp/template.xhtml
@@ -16,7 +16,7 @@
             <ui:param name="dataverse" value="#{TemplatePage.template.dataverse}"/>
             <ui:param name="template" value="#{TemplatePage.template}"/>
             <ui:param name="showMessagePanel" value="#{true}"/>
-            <ui:define name="body">
+            <ui:define name="metadata">
                 <f:metadata>
                     <f:viewParam name="id" value="#{TemplatePage.templateId}"/>
                     <f:viewParam name="ownerId" value="#{TemplatePage.ownerId}"/>
@@ -25,6 +25,8 @@
                     <f:viewAction action="#{TemplatePage.init}"/>
                     <f:viewAction action="#{dataverseHeaderFragment.initBreadcrumbs(TemplatePage.template.dataverse, (TemplatePage.editMode == 'CREATE' ? bundle['dataset.manageTemplates.createBtn'] : TemplatePage.template.name))}"/>
                 </f:metadata>
+            </ui:define>
+            <ui:define name="body">
                 <h:form id="templateForm">
                     <p:focus context="templateForm"/>
                     <!-- Header / Button Panel -->