0

Here's template

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />        
        <meta http-equiv="refresh" content="30">
        <title><ui:insert name="title">Default Title</ui:insert></title>
        <h:outputStylesheet library="css" name="jsfcrud.css"/>
    </h:head>

    <h:body>
        <h1>
            <ui:insert name="title">Default Title</ui:insert>
        </h1>
        <p>
            <ui:insert name="body">Default Body</ui:insert>
        </p>
    </h:body>

</html>

here's a client

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">           
    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ListPhonerecordTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">                   
            <h:form styleClass="jsfcrud_list_form">
                <p:poll interval="10" listener="#{phonerecordController.prepareList}" update="@all" />
                ...
                ...
                ...                
            </h:form>
        </ui:define>
    </ui:composition>

</html>

When I run client page meta refresh is not working (refresh page every 30 seconds).

I tried putting meta refresh tag in template (inside h:head) but when client page is run it is not refreshing the page.

Should I try putting the meta refresh tag inside ui:composition tag in client page?

Logan Lee
  • 807
  • 9
  • 21

2 Answers2

0

If I add an image inside h:body in template like this

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />        
        <title><ui:insert name="title">Default Title</ui:insert></title>
        <h:outputStylesheet library="css" name="jsfcrud.css"/>
    </h:head>

    <h:body>
        <h:graphicImage value = "resources/phonegirl1.PNG"/><br />
        <h1>
            <ui:insert name="title">Default Title</ui:insert>
        </h1>
        <p>
            <ui:insert name="body">Default Body</ui:insert>
        </p>
    </h:body>

</html>

and try to open in client page image is not there. It's not visible when i run template page as well.

This may have the answer: Template content not displaying

Logan Lee
  • 807
  • 9
  • 21
0

if i add a text "Hello World" in template like so

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />        
        <title><ui:insert name="title">Default Title</ui:insert></title>
        <h:outputStylesheet library="css" name="jsfcrud.css"/>                        
    </h:head>

    <h:body>
        Hello World!
        <h1>
            <ui:insert name="title">Default Title</ui:insert>
        </h1>        
        <p>
            <ui:insert name="body">Default Body</ui:insert>
        </p>
    </h:body>

</html>

every client page referring to template has Hello World written on its page.

But if I try the same in one of the client pages they don't work.

Logan Lee
  • 807
  • 9
  • 21
  • if i put apple in template and put Hi there apple in client it works. Now the challenge is if i put meta refresh tag in template will it work on all pages? – Logan Lee Oct 17 '17 at 01:55
  • added in head of template and ran template and yes it refreshes. now the question is will it refresh every client pages? – Logan Lee Oct 17 '17 at 01:59
  • yes meta refresh seems to work on template and all its client pages. all i had to do was to rebuild the project in netbeans. cheers. – Logan Lee Oct 17 '17 at 02:10