Formulário JSF (MyFaces + TomaHawk) não está renderizando

10 respostas
L

Pessoal,

Alguém já teve problemas com renderização do formulário?

Este formulário simples de uplod não está renderizando...

<%@ page session="false" contentType="text/html;charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>

<html>
<head>
</head>
<body>
	<f:view>  
		<h:form id="form1" enctype="multipart/form-data" >
	        <h:outputText value=""/>
	        <t:inputFileUpload id="arquivo"
    			               accept="image/*"
                               value="#{arquivo.conteudo}"
                               storage="file"
                               styleClass="fileUploadInput"
                               required="true"
                               maxlength="200000"/>
            &lt;f:verbatim&gt;<br>&lt;/f:verbatim&gt;
            &lt;h:commandButton value="Enviar" action="#{arquivo.enviarArquivo}" /&gt;
        &lt;/h:form&gt;		          
	&lt;/f:view&gt; 
&lt;body&gt;
&lt;/html&gt;

Alguém tem uma idéia do q pode ser?

Abraços

10 Respostas

L

alguém ae?

X

não entendo mto mas…

na linha 24 acredito que o correto seja , ou não?

tenta ai

felipeguerra

Algumas perguntas:

1 - Versão do JSF?
2 - Qual Tomcat?
3 - Posta seu web.xml

Falou!

L

Opa!

O JSF é 1.1
O servidor não é TomCat é Websphere 6.1.17

Segue meu web.xml

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&gt;
	&lt;display-name&gt;
	teste-web&lt;/display-name&gt;
	&lt;context-param&gt;
		&lt;param-name&gt;javax.faces.STATE_SAVING_METHOD&lt;/param-name&gt;
		&lt;param-value&gt;server&lt;/param-value&gt;
	&lt;/context-param&gt;
	&lt;context-param&gt;
		&lt;param-name&gt;javax.faces.CONFIG_FILES&lt;/param-name&gt;
		&lt;param-value&gt;&lt;/param-value&gt;
	&lt;/context-param&gt;
	&lt;context-param&gt;
		&lt;param-name&gt;javax.faces.DEFAULT_SUFFIX&lt;/param-name&gt;
		&lt;param-value&gt;.jsp&lt;/param-value&gt;
	&lt;/context-param&gt;
	&lt;context-param&gt;
		&lt;param-name&gt;com.sun.faces.NUMBER_OF_VIEWS_IN_SESSION&lt;/param-name&gt;
		&lt;param-value&gt;15&lt;/param-value&gt;
	&lt;/context-param&gt;
	&lt;context-param&gt;
		&lt;param-name&gt;com.sun.faces.enableHighAvailability&lt;/param-name&gt;
		&lt;param-value&gt;false&lt;/param-value&gt;
	&lt;/context-param&gt;
	&lt;context-param&gt;
		&lt;param-name&gt;com.sun.faces.COMPRESS_STATE&lt;/param-name&gt;
		&lt;param-value&gt;false&lt;/param-value&gt;
	&lt;/context-param&gt;
	&lt;context-param&gt;
		&lt;param-name&gt;com.ibm.ws.jsf.JSP_UPDATE_CHECK&lt;/param-name&gt;
		&lt;param-value&gt;true&lt;/param-value&gt;
	&lt;/context-param&gt;
	&lt;context-param&gt;
		&lt;param-name&gt;com.ibm.ws.jsf.LOAD_FACES_CONFIG_AT_STARTUP&lt;/param-name&gt;
		&lt;param-value&gt;true&lt;/param-value&gt;
	&lt;/context-param&gt;
	&lt;listener&gt;
		&lt;listener-class&gt;com.sun.faces.config.ConfigureListener&lt;/listener-class&gt;
	&lt;/listener&gt;
	&lt;servlet id="Servlet_1221664567196"&gt;
       &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;  
       &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;  
       &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;  
   &lt;/servlet&gt;  
     
   &lt;servlet-mapping&gt;  
       &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;  
       &lt;url-pattern&gt;/faces/*&lt;/url-pattern&gt;  
   &lt;/servlet-mapping&gt;  
     
   &lt;servlet-mapping&gt;  
       &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;  
       &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;  
   &lt;/servlet-mapping&gt;  
     
	&lt;filter&gt;
		&lt;filter-name&gt;MyFacesExtensionsFilter&lt;/filter-name&gt;
		&lt;filter-class&gt;org.apache.myfaces.webapp.filter.ExtensionsFilter&lt;/filter-class&gt;
	    &lt;init-param&gt;
	        &lt;param-name&gt;uploadMaxFileSize&lt;/param-name&gt;
	        &lt;param-value&gt;20m&lt;/param-value&gt;
	    &lt;/init-param&gt;
	&lt;/filter&gt;
	
	&lt;filter-mapping&gt;
	    &lt;filter-name&gt;MyFacesExtensionsFilter&lt;/filter-name&gt;
	    &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
	&lt;/filter-mapping&gt;
	
	&lt;filter-mapping&gt;
	    &lt;filter-name&gt;MyFacesExtensionsFilter&lt;/filter-name&gt;
	    &lt;url-pattern&gt;/faces/myFacesExtensionResource/*&lt;/url-pattern&gt;
	&lt;/filter-mapping&gt;

  	&lt;welcome-file-list&gt;
		&lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
		&lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
	&lt;/welcome-file-list&gt;
&lt;/web-app&gt;
felipeguerra

t:inputFileUpload, exige o commons-fileupload…

L

Mas o common upload e o io estão na lib do projeto…

Nem aparece o form no html gerado…

L

xxta:
não entendo mto mas…

na linha 24 acredito que o correto seja , ou não?

tenta ai

Te juro que torci pra isso… mas não adiantou…

Olha o código HTML gerado…

<html>
<head>
</head>
<body>
	  
		
	        
	        
            
            
        		          
	 
<!-- MYFACES JAVASCRIPT -->

</body>
</html>
felipeguerra

leandroqbs:
Opa!

O JSF é 1.1
O servidor não é TomCat é Websphere 6.1.17


Só pra saber, o Websphere tem um container web próprio? Eu não lembro disso!

Outra coisa, somente essa página faz uso de algum componente do tomahawk? Se a resposta for não, somente ela da pau?

L

O websphere é completo, application server e container web…

Estou começando o projeto agora, não nada além dessa página e um managed bean…

felipeguerra

Cara, vc vai ter que pedir suporte para a IBM.

Pq eu acredito que seja alguma incompatibilidade de jars.

Criado 18 de setembro de 2008
Ultima resposta 18 de set. de 2008
Respostas 10
Participantes 3