Note that there are some explanatory texts on larger screens.

plurals
  1. POJSF <ui:composition> is not working on destination page
    primarykey
    data
    text
    <p>I am making a simple JSF application which is uses templating It's very basic stuff but taking a lot of time to find the fix. Issue is, I am having index.jsp which just forwards the request to startPage.xhtml. startPage.xhtml uses main.xhtml for templating. Till here everything is ok. But there is a anchor link of startPage.xhtml which leads the control to expression/expression.html. When I click on that link browser is not rendering my header and footer (part of main.xhtml template). IE consider expression/expression.xhtml a file and open it with open/save dialogue.</p> <p>Index.jsp</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;jsp:forward page="startPage.jsf" /&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>main.xhtml</p> <pre><code> &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" xmlns:c="http://java.sun.com/jstl/core"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" /&gt; &lt;meta http-equiv="pragma" content="no-cache" /&gt; &lt;meta http-equiv="cache-control" content="no-cache" /&gt; &lt;meta http-equiv="expires" content="0" /&gt; &lt;title&gt;X&lt;/title&gt; &lt;link href="css/styles.css" rel="stylesheet" type="text/css" /&gt; &lt;style&gt; .rich-table-headercell { text-align: left; } .rich-table-cell { vertical-align: top; } &lt;/style&gt; &lt;/head&gt; &lt;body style="bgcolor: #FFFFFF; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 20;"&gt; &lt;!-- Start Header --&gt; &lt;h:form id="mainForm"&gt; &lt;ui:include src="../includes/header.xhtml"/&gt; &lt;table width="100%" cellpadding="0" cellspacing="0" border="0"&gt; &lt;tr&gt; &lt;td nowrap="nowrap"&gt; &lt;table style="background-repeat: no-repeat; background-color: #E9ECEF; " width="100%" height="20px"&gt; &lt;tr&gt; &lt;td nowrap="nowrap"&gt;&lt;img src="images/spacer.gif" width="18" height="1" border="0" alt="" /&gt; &lt;/td&gt; &lt;td class="globalNavGrey" align="right" nowrap="nowrap"&gt; &lt;h:outputText value="Help" /&gt; &lt;rich:spacer width="10" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/h:form&gt; &lt;!-- main content area --&gt; &lt;table align="left"&gt; &lt;tr&gt; &lt;td&gt;&lt;img src="images/spacer.gif" width="5" height="1" border="0" alt="" /&gt; &lt;/td&gt; &lt;td style="vertical-align: top;"&gt; &lt;!-- Body starts --&gt; &lt;ui:insert name="body"&gt; &lt;/ui:insert&gt; &lt;!-- Body ends --&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>startPage.xhtml</p> <pre><code>&lt;?xml version="1.0" encoding="windows-1252"?&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/1999/xhtml http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd" template="/includes/main.xhtml"&gt; &lt;style&gt; .cellBackground { background-color:yellow; } &lt;/style&gt; &lt;ui:param name="subTitle" value="Understanding Disease Informatics System" /&gt; &lt;ui:define name="body"&gt; &lt;div style="margin-left: 30px; top: 120px; width: 800px; margin-bottom: 50px;" class="mainscreen"&gt; &lt;br/&gt; &lt;b&gt;&lt;font size="+1" color="003366"&gt; X &lt;/font&gt; &lt;/b&gt;&lt;br/&gt; &lt;br/&gt; This page is the entry point for X developers development is organized into these subsystems: &lt;p&gt;&lt;/p&gt; &lt;center&gt; &lt;table border="1" cellpadding="15" cellspacing="25"&gt; &lt;tr&gt; &lt;td class="cellBackground" title="Enabled" &gt; &lt;a href="${facesContext.externalContext.requestContextPath}/expression/expression.xhtml" style="font-size:20px;"&gt; Expression Subsystem&lt;/a&gt; &lt;/td&gt; &lt;td title="Disable" style="font-size:20px;" &gt;Pathways&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/center&gt; &lt;hr&gt;&lt;/hr&gt; &lt;font size="+1"&gt; &lt;a href="contact"&gt;Contacts&lt;/a&gt; &lt;hr&gt;&lt;/hr&gt; &lt;/font&gt; &lt;/div&gt; &lt;/ui:define&gt; &lt;/ui:composition&gt; </code></pre> <p>expression.xhtml</p> <pre><code>&lt;?xml version="1.0" encoding="windows-1252"?&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/1999/xhtml http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd"&gt; &lt;ui:composition template="main.xhtml"&gt; &lt;ui:param name="subTitle" value="Expression Data" /&gt; &lt;ui:define name="body"&gt; Expression page! &lt;/ui:define&gt; &lt;/ui:composition&gt; &lt;/html&gt; </code></pre> <p>Any suggestions?</p> <p>NOTE: As all the links on page are static so I am not using any managed bean.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload