How to work JSF with iframe

This is my xhtml page. Here i am using <iframe> and giving source like as shown below,

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

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

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

<body>

<f:view>

<h:form>

<iframe height="110%" src="main/chartSummary/visits1.xhtml">

</iframe>

</h:form>

</f:view>

</body>

</html>

and this is my visits.xhtml page.

<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">

<body>

<f:view>

<h:form>

<h:dataTable id="adresstable">

<h:column id="date">

<f:facet name="header">

<h:outputText value="FName" />

</f:facet>

<h:outputText value="Vinutha" />

</h:column>

<h:column id="title">

<f:facet name="header">

<h:outputText value="FName" />

</f:facet>

<h:outputText value="ML}" />

</h:column>

</h:dataTable>

</h:form>

</f:view>

</body>

</html>

Now, when i deploy first file, only frame is displaying but its not displaying JSF components within frame.

So, how to work JSF with iframe.......

Thanks,

Vinutha.

[1542 byte] By [vinuthamla] at [2007-11-26 16:19:39]
# 1

I know you know it, but, are you putting the right file-pattern to call your jsf page in the src attribute of your iframe?.

Just to be clear, in your web.xml you map a file pattern for all your jsf files and the file that you request in the src attributte of the ifrma must math that file pattern.

Example:

web.xml

<servlet>

<servlet-name>Faces Servlet</servlet-name>

<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

<load-on-startup>0</load-on-startup>

</servlet>

...

<servlet-mapping>

<servlet-name>Faces Servlet</servlet-name>

<url-pattern>*.xhtml</url-pattern>

</servlet-mapping>

and then your iframe will work

<iframe width="100%" height="110%" src="main/chartSummary/visits1.xhtml">

Othon_Reyesa at 2007-7-8 22:43:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Hi Othon_Reyes ,

Thanks for your reply............

In my web. xml, i given url-pattern as,

<url-pattern>*.jsf</url-pattern>

so, i chaged my code as,

<iframe width="100%" height="110%" src="main/chartSummary/visits1.jsf">

Its working now.........

Thanks once again........

Vinutha.

vinuthamla at 2007-7-8 22:43:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...