Rich faces

15 respostas
Naruto

Boa tarde pessoal quero usar o rich faces para criar um Menu porem to com o seguinte erro

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 8

5:     See <welcome-file-list> in web.xml file.
6: --%>
7: 
8: <jsp:forward page="Menu.faces"/>


Stacktrace:
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

org.apache.jasper.JasperException: An exception occurred processing JSP page /Menu.jsp at line 17

14:     This file is an entry point for JavaServer Faces application.
15: --%>
16: 
17:     <h:form>
18: 
19:         <h:panelGrid styleClass="vertical-menu-cell" columnClasses="optionList" columns="1" cellspacing="0" cellpadding="0">
20:             <rich:dropDownMenu style="border:1px solid #{a4jSkin.panelBorderColor}" value="Option1"


Stacktrace:
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
	com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
	com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
	org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
	org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
	com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
	com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
	com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
	org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:696)
	org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:667)
	org.apache.jsp.index_jsp._jspService(index_jsp.java:58)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

javax.servlet.ServletException: javax.servlet.jsp.JspException: java.lang.IllegalStateException: Component org.ajax4jsf.component.AjaxViewRoot@1bda1e0 not expected type.  Expected: javax.faces.component.UIForm.  Perhaps you're missing a tag?
	org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
	org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
	org.apache.jsp.Menu_jsp._jspService(Menu_jsp.java:102)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
	com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
	com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
	org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
	org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
	com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
	com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
	com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
	org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:696)
	org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:667)
	org.apache.jsp.index_jsp._jspService(index_jsp.java:58)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

java.lang.IllegalStateException: Component org.ajax4jsf.component.AjaxViewRoot@1bda1e0 not expected type.  Expected: javax.faces.component.UIForm.  Perhaps you're missing a tag?
	com.sun.faces.taglib.html_basic.FormTag.setProperties(FormTag.java:199)
	javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:604)
	javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1126)
	com.sun.faces.taglib.html_basic.FormTag.doStartTag(FormTag.java:273)
	org.apache.jsp.Menu_jsp._jspx_meth_h_005fform_005f0(Menu_jsp.java:119)
	org.apache.jsp.Menu_jsp._jspService(Menu_jsp.java:93)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408)
	com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442)
	com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)
	org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
	org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
	com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
	com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
	com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
	javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
	org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:696)
	org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:667)
	org.apache.jsp.index_jsp._jspService(index_jsp.java:58)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.
Apache Tomcat/6.0.18

e o codigo do menu é esse

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="rich" uri="http://richfaces.org/rich"%>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<%--
    This file is an entry point for JavaServer Faces application.
--%>

    <h:form>

        <h:panelGrid styleClass="vertical-menu-cell" columnClasses="optionList" columns="1" cellspacing="0" cellpadding="0">
            <rich:dropDownMenu style="border:1px solid #{a4jSkin.panelBorderColor}" value="Option1"
                        submitMode="none" direction="bottom-right" jointPoint="tr">
                <rich:menuItem value="Suboption1-1" />
                <rich:menuItem value="Suboption1-2">
                    <f:facet name="icon">
                    <h:graphicImage value="/richfaces/toolBar/images/print.gif" />
                    </f:facet>

                </rich:menuItem>
                <rich:menuItem value="Suboption1-3" />
            </rich:dropDownMenu>
            <rich:dropDownMenu style="border:1px solid #{a4jSkin.panelBorderColor}" value="Option2"
                        submitMode="none" direction="bottom-right"  jointPoint="tr">
                <rich:menuItem value="Suboption2-1" />
                <rich:menuItem value="Suboption2-2" />
                <rich:menuGroup value="Group2" direction="#{bean.groupDirection}">
                    <rich:menuItem value="SuboptionG2-2-1" />
                    <rich:menuItem value="SuboptionG2-2-2" />
                </rich:menuGroup>

                <rich:menuItem value="Suboption2-3" />
            </rich:dropDownMenu>
            <rich:dropDownMenu style="border:1px solid #{a4jSkin.panelBorderColor}" value="Option3"
                        submitMode="none" direction="bottom-right"  jointPoint="tr">
                <rich:menuItem value="Suboption3-1" />
                <rich:menuItem value="Suboption3-2" />
                <rich:menuItem value="Suboption3-3" />
            </rich:dropDownMenu>

        </h:panelGrid>
    </h:form>

alguem pode me ajudar?

Obrigado

15 Respostas

Kleber-rr

Eae man, conseguiu resolver teu problema??

Naruto

ou consegui sim fiz um menuzim massa ate
se quiser me da um toque
flwww

Kleber-rr

Naruto:
ou consegui sim fiz um menuzim massa ate
se quiser me da um toque
flwww

Cara, se for possível, te agradeço!! Eu consegui resolver o meu ontem tb, mas é estático, e naum dinâmico.

Flws.

Naruto
aqui o que ue fiz não sei c vai ser util para você mais para mim era isso que eu precisava
<%-- 
    Document   : menu
    Created on : 09/11/2009, 18:09:00
    Author     : Jeferson Guerrero
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="rich" uri="http://richfaces.org/rich"%>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<f:subview id="menu">
    <rich:toolBar width="800px" height="30">
        <rich:dropDownMenu value="EMPRESA">
            <rich:menuItem icon="/icones/cadastrar.png" value="CADASTRAR" action="#{EmpresaManagedBean.montarPaginaParaInsercao}" submitMode="ajax" />
            <rich:menuItem icon="/icones/consultar.png" value="CONSULTAR" action="#{EmpresaManagedBean.listar}" submitMode="ajax"/>
        </rich:dropDownMenu>
        <rich:dropDownMenu value="USUÃ?RIO" >
            <rich:menuItem icon="/icones/cadastrar.png" value="CADASTRAR" action="#{UsuarioManagedBean.montarPaginaParaInsercao}" submitMode="ajax"/>
            <rich:menuItem icon="/icones/consultar.png" value="CONSULTAR" action="#{UsuarioManagedBean.listar}" submitMode="ajax"/>
        </rich:dropDownMenu>
    </rich:toolBar>
</f:subview>

flwwww

Kleber-rr
Naruto:
aqui o que ue fiz não sei c vai ser util para você mais para mim era isso que eu precisava
<%-- 
    Document   : menu
    Created on : 09/11/2009, 18:09:00
    Author     : Jeferson Guerrero
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="rich" uri="http://richfaces.org/rich"%>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<f:subview id="menu">
    <rich:toolBar width="800px" height="30">
        <rich:dropDownMenu value="EMPRESA">
            <rich:menuItem icon="/icones/cadastrar.png" value="CADASTRAR" action="#{EmpresaManagedBean.montarPaginaParaInsercao}" submitMode="ajax" />
            <rich:menuItem icon="/icones/consultar.png" value="CONSULTAR" action="#{EmpresaManagedBean.listar}" submitMode="ajax"/>
        </rich:dropDownMenu>
        <rich:dropDownMenu value="USUÃ?RIO" >
            <rich:menuItem icon="/icones/cadastrar.png" value="CADASTRAR" action="#{UsuarioManagedBean.montarPaginaParaInsercao}" submitMode="ajax"/>
            <rich:menuItem icon="/icones/consultar.png" value="CONSULTAR" action="#{UsuarioManagedBean.listar}" submitMode="ajax"/>
        </rich:dropDownMenu>
    </rich:toolBar>
</f:subview>

flwwww

Mano, já tinha conseguido resolver aqui, mas agradeço mto.

Flw!!

Naruto

flw desculpa a demora tinha tentando postar antes porem minha net tava com problemas
flwww

Naruto

como você tinha feito o seu primeiro? é igual ao que eu postei???
flwww

Kleber-rr

Naruto:
como você tinha feito o seu primeiro? é igual ao que eu postei???
flwww

Isso!! :smiley:

FLWS

Naruto

e como é este dinamico que tu fez?
flwww

Kleber-rr

Naruto:
e como é este dinamico que tu fez?
flwww

Foi dinamico naum, foi estático mesmo…
flws

sauron_fight

Tenho um menu que esta muito paracido com o seu, mais nao estou conseguindo fazer
uma include em outra pagina com jsf. alguem pode me ajudar?

Naruto
Olha so como eu fiz.. em uma página layout...
<?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">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>SUI - Sistema Único de Identificação</title>
        <script type="text/javascript"  src="#{facesContext.externalContext.requestContextPath}/resources/jquery.maskedinput-1.2.1.js"></script>
        <script type="text/javascript"  src="#{facesContext.externalContext.requestContextPath}/resources/funcoes.js"></script>
        <link rel="stylesheet" type="text/css" href="#{facesContext.externalContext.requestContextPath}/css/estilos.css"/>

    </head>
    <body  style="background-image: url('/SUI_QRCODE/imagens/fundo.png')" >
        <ui:include src="mensagens.xhtml"/>
        <table style="background: url('/SUI_QRCODE/imagens/fundoconteudo.png');" cellspacing="1" cellpadding="0" border="0"  align="center" width="800px">
            <tr>
                <td id="topo" width="800px">
                    <ui:insert name="topo">
                        <div><h:graphicImage width="800px" url="/imagens/topo.png"/></div>
                    </ui:insert>
                </td>
            </tr>
            <tr>
                <td id="menu" width="800px" height="30px">
                    <ui:insert name="menu"><f:subview id="menu">
                            <h:form>
                                <div><rich:toolBar width="800px" height="30px" contentClass="rich-toolbar">
                                        <rich:menuItem selectClass="rich-menu-item-Principal-Select" value="HOME" onclick="this.disabled=true" icon="/imagens/home.png" action="home"  submitMode="ajax" immediate="true"  />
                                        <rich:menuItem selectClass="rich-menu-item-Principal-Select" value="CADASTRE-SE" onclick="this.disabled=true" icon="/imagens/cadastre.png" action="#{EmpresaManagedBean.montarPaginaCadastroEmpresa}" submitMode="ajax" immediate="true"/>
                                        <rich:menuItem selectClass="rich-menu-item-Principal-Select" value="EFETUE SEU LOGIN" onclick="this.disabled=true" icon="/imagens/login.png" action="loginEmpresa" submitMode="ajax" immediate="true" />
                                        <rich:menuItem selectClass="rich-menu-item-Principal-Select" value="ÁREA RESTRITA" onclick="this.disabled=true" icon="/imagens/area.png" action="loginAdministrador" submitMode="ajax" immediate="true" />
                                        <rich:menuItem selectClass="rich-menu-item-Principal-Select" value="CONTATO" onclick="this.disabled=true" action="#{ContatoManagedBean.montarPaginaCadastroContato}" icon="/imagens/contato.png" submitMode="ajax" immediate="true"/>
                                    </rich:toolBar></div>
                            </h:form>
                        </f:subview>                                      
                    </ui:insert>
                </td>
            </tr>
            <tr>
                <td id="meio" width="800px">
                    <ui:insert name="meio"></ui:insert>
                </td>
            </tr>
            <tr>
                <td id="rodape" width="800px">
                    <ui:insert name="rodape">
                        <div><h:graphicImage width="800px" url="/imagens/rodape.png"/></div>
                    </ui:insert>
                </td>
            </tr>
        </table>
    </body>
</html>
e depois so chamo as outras páginas
<?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">
    <body>
        <ui:composition template="layout.xhtml">
            <ui:define name="meio">
                <table align="center" border="0"  cellpadding="0" cellspacing="0">
                    <f:view>
                        <h:form id="formHome">
                            <tr>
                                <td align="center">
                                    <div><h:graphicImage url="/imagens/propaganda.png" /></div>                                    
                                </td>
                            </tr>
                        </h:form>
                    </f:view>
                </table>
            </ui:define>
        </ui:composition>
    </body>
</html>
sauron_fight

Fiz da seguinte forma com a pagina denominada cabecalho.jspf que possui o seguinte codigo

<f:subview id=“idmenu”>
<f:verbatim>
<f:view>
<body>
<h:form >

Menu com Riche Faces

    &lt;/h:form&gt;
&lt;/body&gt;


&lt;/f:view&gt;
&lt;/f:verbatim&gt;
&lt;/f:subview&gt;

A pagina que deverar incluir a pagina acima esta da seguinte forma:

&lt;jsp:directive.include file="cabecalho.jspf" /&gt;

Mais esta ocorrendo o seguinte erro:

org.apache.jasper.JasperException: An exception occurred processing JSP page /cabecalho.jspf at line 32

29:
30: <f:subview id=“idmenu”>
31: <f:verbatim>
32: <f:view>

javax.servlet.jsp.JspException: java.lang.IllegalStateException

Naruto

porque tu num usa templates eu usava include mais quando usei templates
achei muito melhor

sauron_fight

Na verdade nunca trabalhei com templates, vou dar uma pesquisa para ver como funciona. Obrigado a todos.

Criado 2 de novembro de 2009
Ultima resposta 21 de jun. de 2010
Respostas 15
Participantes 3