Facelets com Flash... Não funciona?

3 respostas
R

Pessoal,
estou fazendo um projeto aqui e tô com o seguinte problema:
Quando coloco normal, sem referência a nenhum Template (ui:Composition), o flash aparece... Porém, quando referencio o meu Template, o flash some... Queria saber como corrigir... Alguem sabe se o Flash pega ou não no Facelets ?

Está ai o código do XHTML que funciona:
<!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"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html">
<body>
<ui:composition>

	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
		codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
		width="100%" height="100%" id="calendario6" align="middle">
		<param name="allowScriptAccess" value="sameDomain" />
		<param name="allowFullScreen" value="false" />
		<param name="movie" value="calendario6.swf" />
		<param name="quality" value="high" />
		<param name="bgcolor" value="#ffffff" />
	</object>

</ui:composition>
</body>

</html>

E este é o que não funciona:

<!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"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html">
<body>
<ui:composition template="/template/layout.xhtml">
	<ui:define name="conteudo">
		<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
			codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
			width="100%" height="100%" id="calendario6" align="middle">
			<param name="allowScriptAccess" value="sameDomain" />
			<param name="allowFullScreen" value="false" />
			<param name="movie" value="calendario6.swf" />
			<param name="quality" value="high" />
			<param name="bgcolor" value="#ffffff" />
		</object>
	</ui:define>
</ui:composition>
</body>

</html>

E este é o layout.xhmtl:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!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"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j">

<head>

<title><ui:insert name="titulo" /><h:outputText
	value=" X "/></title>
<link
	href="${facesContext.externalContext.requestContextPath}/css/estilo.css"
	rel="stylesheet" type="text/css" />
<link
	href="${facesContext.externalContext.requestContextPath}/css/estiloTabelas.css"
	rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
	margin-left: 00px;
	margin-top: 0px;
	margin-right: 00px;
	margin-bottom: 0px;
	background-image:
		url(${facesContext.externalContext.requestContextPath}/imagens/layout/imagem_01.jpg)
		;
	background-repeat: repeat-x;
}
-->
</style>
<ui:insert name="head"></ui:insert>
</head>

<body>
<table width="100" border="00" align="center" cellpadding="0"
	cellspacing="0">
	<tr>
		<td width="10" rowspan="2"><img
			src="${facesContext.externalContext.requestContextPath}/imagens/layout/imagem_02.jpg"
			width="38" height="152" alt="" /></td>
		<td width="56"><img
			src="${facesContext.externalContext.requestContextPath}/imagens/layout/imagem_03.jpg"
			width="741" height="29" alt="" /></td>
		<td width="34" rowspan="2"><img
			src="${facesContext.externalContext.requestContextPath}/imagens/layout/imagem_04.jpg"
			width="32" height="152" alt="" /></td>
	</tr>
	<tr>
		<td
			background="${facesContext.externalContext.requestContextPath}/imagens/layout/imagem_06.jpg">
		<table width="100%" border="00" cellspacing="0" cellpadding="0">
			<tr>
				<td colspan="2"><img
					src="${facesContext.externalContext.requestContextPath}/imagens/layout/spacerr.gif"
					alt="" width="100%" height="2" /></td>
			</tr>
			<tr>
				<td width="1%"><img
					src="${facesContext.externalContext.requestContextPath}/imagens/layout/spacerr.gif"
					width="3" height="121" /></td>
				<td width="99%">
				<table>
					<tr>
						<td><h:outputText value="" /></td>
						<td>
						<div id="login"><ui:insert name="login">
							<ui:include src="/login/login.xhtml" />
						</ui:insert></div>
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td height="8" colspan="3"><img
			src="${facesContext.externalContext.requestContextPath}/imagens/layout/imagem_07.jpg"
			alt="" width="811" height="8" /></td>
	</tr>
	<tr>
		<td height="402" nowrap="nowrap" valign="top"><img
			src="${facesContext.externalContext.requestContextPath}/imagens/layout/imagem_08.jpg"
			alt="" width="38" height="402" /></td>
		<td rowspan="2" bgcolor="#FFFFFF">
		<div id="conteudo"><h:panelGrid id="conteudo" columns="1">
			<ui:insert name="conteudo"></ui:insert>
		</h:panelGrid></div>

		</td>
		<td height="402" nowrap="nowrap" valign="top"><img
			src="${facesContext.externalContext.requestContextPath}/imagens/layout/imagem_10.jpg"
			alt="" width="32" height="402" /></td>
	</tr>
	<tr>
		<td width="10" height="100%">&nbsp;</td>
		<td width="34" height="100%">&nbsp;</td>
	</tr>
	<tr>
		<td colspan="3">
		<div align="center" class="style1"><h:outputText
			value=" X " styleClass="textoNormal" /></div>
		</td>
	</tr>
</table>

</body>
</html>

... É isso ai !! Bom espero que funcione, pois tive que colocar algumas funcionalidades do sistema em Flash...

Agradeço desde já !!

[]'s !

3 Respostas

Javabuntu

mesmo que rode…mas ele gera algum erro no conteiner :?:

no final vc está acessando ele .jsf ou .xhtml mesmo :?: no caso se vc configurou ou não no web-xml…

R

Olá,
Eu estou acessando ele como .jsf mesmo !
E não está gerando erro nenhum, quando ele roda (No primeiro exemplo)…

[]´s

R

Problema Resolvido !!

A solução foi adotar o SwfObject para poder colocar os Flash´s certinhos… Até agora tá tudo funcionando…
Depois posto um tutorial de como usar o SwfObject direitinho !!

Pessoal, o link é esse:
http://andregs.blogspot.com/2006/09/swfobject-insero-e-deteco-do-flash.html
… Para o blog do André Gomes. Tá tudo MUITO BEM explicado lá !!

Obs.: Moderação, favor marcar como RESOLVIDO !

[]´s.

Criado 7 de abril de 2008
Ultima resposta 9 de abr. de 2008
Respostas 3
Participantes 2