maquiavelbona 9 de fev. de 2007
Primeiramente, você deseja receber informações de 2 forms em um único envio?
andrericarte 9 de fev. de 2007
O que acontece é o seguinte eu adiciono paginas como tiles:insert
uma pagina faz assim (ta generico para ficar facil o entendimento)
PAGINA1
.....
<h:form>
....
<tiles:insert attribute="tela" flush="false"/>
....
<h:form>
.....
o attribute=“tela” esta definido no tiles.xml e esta funcionando e define a tela PAGINA2
PAGINA2
<h:form>
<h:outputText value= "JSP 2" />
<h:commandButton action= "#{meubean.x}" value= "GOTO JSP1" />
</h:form>
Quando eu clico no <h:commandButton action="#{meubean.x}" value=“GOTO JSP1”/> o metodo nao é chamado!
o bean esta assim no faces-config.xml
<managed-bean>
<managed-bean-name> meubean</managed-bean-name>
<managed-bean-class> br.com.knbs.servlet.meubean</managed-bean-class>
<managed-bean-scope> request</managed-bean-scope>
</managed-bean>
<navigation-rule>
<navigation-case>
<from-action> #{meubean.getX}</from-action>
<from-outcome> tela1</from-outcome>
<to-view-id> /WEB-INF/jsp/tela1/tela1.jsp</to-view-id>
</navigation-case>
</navigation-rule>
agradeco a ajuda
maquiavelbona 9 de fev. de 2007
Não sei como ele trabalha com dois forms encadeados assim. Vou dar uma pesquisada aqui, fiquei curioso agora.
andrericarte 9 de fev. de 2007
cara eu ainda estou precisando resolvar o problema anterior, mas naum entendi uma coisa.
tirei a chamada do meu bean da pagina onde ele estava e coloquei no index.jsp msm
e agora ele da esta erro
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request .
exception
javax . servlet . ServletException : # { meubean . x }: javax . faces . el . MethodNotFoundException : x : br . com . knbs . servlet . meubean . x ()
javax . faces . webapp . FacesServlet . service ( FacesServlet . java : 209 )
org . netbeans . modules . web . monitor . server . MonitorFilter . doFilter ( MonitorFilter . java : 368 )
root cause
javax . faces . FacesException : # { meubean . x }: javax . faces . el . MethodNotFoundException : x : br . com . knbs . servlet . meubean . x ()
com . sun . faces . application . ActionListenerImpl . processAction ( ActionListenerImpl . java : 74 )
javax . faces . component . UICommand . broadcast ( UICommand . java : 312 )
javax . faces . component . UIViewRoot . broadcastEvents ( UIViewRoot . java : 267 )
javax . faces . component . UIViewRoot . processApplication ( UIViewRoot . java : 381 )
com . sun . faces . lifecycle . InvokeApplicationPhase . execute ( InvokeApplicationPhase . java : 75 )
com . sun . faces . lifecycle . LifecycleImpl . phase ( LifecycleImpl . java : 200 )
com . sun . faces . lifecycle . LifecycleImpl . execute ( LifecycleImpl . java : 90 )
javax . faces . webapp . FacesServlet . service ( FacesServlet . java : 197 )
org . netbeans . modules . web . monitor . server . MonitorFilter . doFilter ( MonitorFilter . java : 368 )
note The full stack trace of the root cause is available in the Apache Tomcat / 5.5.17 logs .
minha pagina principal…
<html>
<% @ taglib uri = "http://java.sun.com/jstl/core" prefix = "c" %>
<% @ taglib uri = "http://java.sun.com/jsf/core" prefix = "f" %>
<% @ taglib uri = "http://java.sun.com/jsf/html" prefix = "h" %>
<% @ taglib uri = "http://jakarta.apache.org/struts/tags-tiles" prefix = "tiles" %>
<f:view>
<head>
<link href= "styles.css" rel= "stylesheet" type= "text/css" />
<title> TILES</title>
<LINK href= "CSS/Estilo.css" type= text/css rel= stylesheet >
</head>
<body>
<f:subview id= "formato" >
<h:form>
<tiles:insert definition= "formato" flush= "false" />
</h:form>
</f:subview>
</body>
<h:form>
<h:outputText value= "JSP 2" />
<h:commandButton action= "#{meubean.x}" value= "GOTO JSP1" />
</h:form>
</f:view>
</html>
desculpa o incomodo mas so iniciante no assunto… vlw
andrericarte 9 de fev. de 2007
Problema quase resolvido…
qdo eu chamo o bean no meu index.jsp funciona agora qdo esta dentro do tiles naum…