Jsp, jsf, richfaces >> Menu

25 respostas
JotaJota

Estou com uma duvida…

eu quero usar mais ou menos a tecnica de iframe mas no jsp/jsf

Não queria criar muito código… e queria fazer minha visão, minhas paginas jsp de forma separada do conteudo com o menu
mas nao queria ser redundante e ficar rescrevendo o menu…
alguem tem algum framework ou alguma dica pra fazer que nao se altere o menu e apenas mude o conteudo de acordo com o menu selecionado?

Atenciosamente,

25 Respostas

viniciusfaleiro

To procurando a mesma coisa… parece que existem uns gerenciadores de layout… na página de exemplo do richfaces tem lá… se conseguir me fala…

JotaJota

http://livedemo.exadel.com/richfaces-demo/richfaces/layouts/page/template.jsf

http://community.jboss.org/wiki/LayoutcomponentsforRichFaces331

viniciusfaleiro

Testou?

JotaJota

Estou testando…

:stuck_out_tongue:
aviso e posto o resultado tbm

viniciusfaleiro

blz

R

JotaJota:
Estou com uma duvida…

eu quero usar mais ou menos a tecnica de iframe mas no jsp/jsf

Não queria criar muito código… e queria fazer minha visão, minhas paginas jsp de forma separada do conteudo com o menu
mas nao queria ser redundante e ficar rescrevendo o menu…
alguem tem algum framework ou alguma dica pra fazer que nao se altere o menu e apenas mude o conteudo de acordo com o menu selecionado?

Atenciosamente,


Não seria Facelets o que vc tá querendo?

Tchello

Exatamente, use o facelets. É exatamente o que você está precisando.

JotaJota

Estou estudando facelets…
caramba que dor de cabeçaa isso! :shock: ahuahuahuha

So uma duvida …

O facelets funciona apenas para xhtml???

vlw

Tchello

Sim, apenas xhtml.
Ou seja, diga adeus a seus scriptlets hehehehe (isso é bom).

Bom, leia:
http://www.rponte.com.br/2008/11/12/aplicacoes-serias-em-jsf-usam-facelets/

Tchello

Also read:

JotaJota

muito obrigado!

JotaJota

facelets é muito bonito, mas é mto chato tbm… bom… eu estou apanhando um pouco… mas é bem complexo os problemas…
att,

JotaJota

Showwww
depois de quase duas semanas estudando facelets… eu posso falar

Facelets é muitoooooooo bom
show de bola
abraçãoo

sauron_fight

Estou com um problema quero usar Richfaces e facelets.

coloquei no xhtml : xmlns:rich=“http://richfaces.org/rich

dentro do arquivo xhtml chamo o compomente richfaces: <rich:calendar></rich:calendar>

mais dentro dos componente richfaces não tenho acesso aos atributos, so tendo acesso ao atributo id, estou usando
facelets 1.1.14 e richfaces 3.3.0

Como esta :<rich:calendar></rich:calendar>

Como deveria esta <rich:calendar converter="" currentDate="" dayStyleClass=""> </rich:calendar>

Desde ja agradeco a todos.

JotaJota

é realmente. com o xhtml vc dificulmente vai conseguir ver os atributos do richfaces e outros componentes também.
vc precisa abrir a api para usar as properties de lá…
mas se ficar muito dificil eu dou uma dica…

cria um jsp no projeto chamado teste, dai voce cria a pagina lá, com as facilidades do IDE que te mostra as propriedades.
depois de finalizado, voce pode copiar para o xhtml.
vai funcionar do mesmo jeito

espero ter ajudado…

sauron_fight

Quando eu faco isso a linha fica em vermelho
e aparece o erro “O componente converter nao esta definido na interface do componente”

JotaJota

manda os codigos ai…
vamos ver o que tá pegando :smiley:

sauron_fight

web.xml :
<context-param>
<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
<param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param>

TemplateMenu.xhtml :

<?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://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j=“http://richfaces.org/a4j”>

&lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/&gt;
    &lt;link href="./../css/default.css" rel="stylesheet" type="text/css" /&gt;
    &lt;link href="./../css/cssLayout.css" rel="stylesheet" type="text/css" /&gt;
    &lt;title&gt;SIGRH - Sistema de Gestão Recursos Humanos&lt;/title&gt;
    &lt;style&gt;
      .pic {
    margin-bottom: -4px;
    margin-right: 2px;
           }
    &lt;/style&gt;
&lt;/head&gt;


&lt;body&gt;
    
    &lt;div id="top" class="top"&gt;
        &lt;ui:insert name="top"&gt;

            &lt;f:view&gt;
                &lt;h:form&gt;
                &lt;h:graphicImage value="pics/layout/logoCERHpequenaRodape.png" &gt;&lt;/h:graphicImage&gt;
             

          &lt;rich:calendar converter="" currentDate="" dayStyleClass=""&gt; &lt;/rich:calendar&gt;


                &lt;rich:toolBar &gt;
                    &lt;rich:dropDownMenu id="dropDownMenu" &gt;
                &lt;f:facet name="label"&gt;
                    &lt;h:panelGroup &gt;
                    &lt;h:graphicImage value="./images/file.png" styleClass="pic"/&gt;
                    &lt;h:outputText value="File"/&gt;
                    &lt;/h:panelGroup&gt;
                &lt;/f:facet&gt;

                &lt;rich:menuGroup   &gt;
                    &lt;rich:menuItem  &gt;
                        &lt;h:commandLink action="#{PersonFaces.doAddPerson}" value="Pessoa"/&gt;
                    &lt;/rich:menuItem&gt;
                    &lt;rich:menuItem&gt;
                        &lt;h:commandLink action="#{ClienteFaces.doAddCliente}" value="Cliente"/&gt;
                    &lt;/rich:menuItem&gt;
                &lt;/rich:menuGroup&gt;
            &lt;/rich:dropDownMenu&gt;
             &lt;/rich:toolBar&gt;
                &lt;/h:form&gt;
            &lt;/f:view&gt;
          
          




          


            &lt;/ui:insert&gt;
    &lt;/div&gt;
    
    &lt;div id="content" class="center_content"&gt;
        &lt;ui:insert name="content"&gt;Content&lt;/ui:insert&gt;
    &lt;/div&gt;
    
&lt;/body&gt;

</html>

Include Template:

<!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:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j=“http://richfaces.org/a4j”>

&lt;body&gt;

    &lt;ui:composition template="/templates/TemplateMenu.xhtml"&gt;

        &lt;ui:define name="title"&gt;

        &lt;/ui:define&gt;


    &lt;/ui:composition&gt;

&lt;/body&gt;

</html>

JotaJota

dá uma conferida:

se tiver tudo ok… vou acreditar que esta faltando libs…

sauron_fight

Continua dando o mesmo erro. O engracado e que uso o richFaces normalmente
em outras paginas no sistema. Se eu usar o componente ele funciona mais nao tenho
como usar nenhum atributo do componente.

Será que não a alguma outra configuração no web.xml?

JotaJota

enviei uma mp pra vc.
se quiser te ajudo on line velho!

JotaJota

cara, pois é. configuração no web.xml não é so isso não velho!

pega ae

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	id="WebApp_ID" version="2.5">
	<display-name>webxmlExemplo</display-name>
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
	</welcome-file-list>
	<context-param>
		<param-name>org.richfaces.SKIN</param-name>
	<!-- <param-value>emeraldTown</param-value>-->           
    <!-- <param-value>blueSky</param-value> -->  
    <!-- <param-value>ruby</param-value> -->  
    <!-- <param-value>wine</param-value> -->   
    <!-- <param-value>deepMarine</param-value> -->  
    <!-- <param-value>japanCherry</param-value> -->  
    <!-- <param-value>plain</param-value> -->  
	<param-value>classic</param-value>
	</context-param>
	
	<context-param>
      <param-name>org.richfaces.CONTROL_SKINNING</param-name>
      <param-value>enable</param-value>
	</context-param>
	<context-param>
		<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
		<param-value>server</param-value>
	</context-param>
	<context-param>
		<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
		<param-value>.xhtml</param-value>
	</context-param>
	<filter>
		<display-name>Ajax4jsf Filter</display-name>
		<filter-name>ajax4jsf</filter-name>
		<filter-class>org.ajax4jsf.Filter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>ajax4jsf</filter-name>
		<servlet-name>Faces Servlet</servlet-name>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>INCLUDE</dispatcher>
	</filter-mapping>
	<servlet>
		<servlet-name>Faces Servlet</servlet-name>
		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>Faces Servlet</servlet-name>
		<url-pattern>*.jsf</url-pattern>
	</servlet-mapping>
		<servlet>
	<servlet-name>teste</servlet-name>
	<servlet-class>ServletVendaToPagSeguro</servlet-class>
	</servlet>
	<servlet-mapping>
	<servlet-name>teste</servlet-name>
	<url-pattern>/servlet/teste</url-pattern>
	</servlet-mapping>
	
</web-app>
JotaJota

são as configurações para o hxml.

depois me fala o resultado blz?
abração
qq coisa abre a MP e add eu lah no msn

sauron_fight

Amigo muito obrigado pela atencao!! consegui resolver removendo as libs richfaces-3.3.0 e adicionei 3.3.3 e deu certo.
Tudo de bom a todos.

JotaJota

Que bom
Até mais!

Criado 22 de fevereiro de 2010
Ultima resposta 28 de jun. de 2010
Respostas 25
Participantes 5