Help needed in facelets with frames

Hi,

I have one sample facelet appln, but i am trying to implement using frames. In the listing jsp i am calling two jsp thru frames but when i access the listing jsp, content of the two jsp's are not getting displayed in the UI, I mean if give anthing outside the frameset, it is getting displayed. Please look at code below and can anybody tell me how to solve this problem....

Please look at the sample code below..

listing.xhtml

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Frameset.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"

xmlns:ui="http://java.sun.com/jsf/facelets"

xmlns:h="http://java.sun.com/jsf/html"

xmlns:f="http://java.sun.com/jsf/core"

xmlns:a="http://www.arc-mind.com/jsf">

<ui:composition template="/WEB-INF/layout/layout.xhtml">

<ui:define name="title">Backend Listing screen</ui:define>

<ui:define name="content">

<h:form>

<frameset rows="33%,*" border="0" frameborder="0">

<frame name="f1" src="/body.xhtml" scrolling="no" noresize="noresize" />

<frame name="f1" src="/footer.xhtml" scrolling="no" noresize="noresize" />

</frameset>

<h:commandLink action="#{CDManagerBean.addNew}">

<f:verbatim>Add CD</f:verbatim>

</h:commandLink>

</h:form>

</ui:define>

</ui:composition>

</html>

body.xhtml page is below

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Frameset.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"

xmlns:ui="http://java.sun.com/jsf/facelets"

xmlns:h="http://java.sun.com/jsf/html"

xmlns:f="http://java.sun.com/jsf/core"

xmlns:a="http://www.arc-mind.com/jsf">

<h:dataTable id="items" value="#{CDManagerBean.cds}" var="cd"

rowClasses="oddRow, evenRow" headerClass="tableHeader">

<a:column entity="${cd}" fieldName="title" backingBean="${CDManagerBean}"/>

<a:column entity="${cd}" fieldName="artist" backingBean="${CDManagerBean}"/>

<a:column entity="${cd}" fieldName="price" backingBean="${CDManagerBean}"

sort="${false}"/>

<a:columnCommand label="Edit" action="editCD" backingBean="${CDManagerBean}"/>

</h:dataTable>

<h:commandLink action="#{CDManagerBean.addNew}">

<f:verbatim>Add CD</f:verbatim>

</h:commandLink>

</html>

Regards,

Saravanan

[2658 byte] By [skumar_tvma] at [2007-11-27 7:31:28]
# 1

I see a number of issues here:

1) you are using facelets, so there are no JSPs

2) in the src of your frames you are referring to the XHTML files directly, you should be using .jsf or whatever you mapped the FacesServlet to

3) you are mixing regular content (e.g. form tags) with framesets, an HTML no-no

Also, you did not post the contents of layout.xhtml, there may be more issues there.

RaymondDeCampoa at 2007-7-12 19:11:42 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

All the files are xhtml files only, just while explaining i was mentioned jsp's. layout.xhtml code is available below. Can you tell me one thing

can i use frames indside the facelet's application? if so please give me an explanation with simple example.

layout.xhtml is given below

<!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://java.sun.com/jsf/facelets">

<head>

<title><ui:insert name="title">Default Title</ui:insert></title>

<link rel="stylesheet" type="text/css" href="./css/main.css"/>

</head>

<body>

<div id="header">

<ui:insert name="header">

<ui:include src="header.xhtml"/>

</ui:insert>

</div>

<div id="left">

<ui:insert name="navigation" >

<ui:include src="navigation.xhtml"/>

</ui:insert>

</div>

<div id="center">

<span class="titleText"> <ui:insert name="title" /> </span>

<hr />

<ui:insert name="content">

<div>

<ui:include src="content.xhtml"/>

</div>

</ui:insert>

</div>

<div id="right">

<ui:insert name="news">

<ui:include src="news.xhtml"/>

</ui:insert>

</div>

<div id="footer">

<ui:insert name="footer">

<ui:include src="footer.xhtml"/>

</ui:insert>

</div>

</body>

</html>

Thanks in advance

Regards,

Saravanan

skumar_tvma at 2007-7-12 19:11:42 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
I can think of no technical reason that would prevent the use of frames with facelets. However, I think as a first step you need to figure out how to use frames with plain vanilla HTML. Also, your posts would be more legible if you used the code tags.
RaymondDeCampoa at 2007-7-12 19:11:42 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...