You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Rogerio Eduardo Oliveira <ro...@yahoo.com.br> on 2007/12/13 19:29:08 UTC

inputFileUpload dont decode!!

Hello All,

Im new with JSF and tomahawk and dont know what could be happen with my page. I put the tag <t:inputFileUpload> in my page and it dont appear. Anyone already have this problem? I use the tomahawk.jar (versão 1.1.6) and commons-fileuploader(1.2).

My web.xml:

<?xml version="1.0" encoding="UTF-8"?>

    <display-name>SIM</display-name>

  ...
 
     <filter>
        <filter-name>MyFacesExtensionsFilter</filter-name>
        <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
        <init-param>
            <param-name>maxFileSize</param-name>
            <param-value>20m</param-value>            
        </init-param>
    </filter>

    <!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages  -->
    <filter-mapping>
        <filter-name>MyFacesExtensionsFilter</filter-name>
        <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
        <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
... 
</web-app>

My page:

<?xml version="1.0" encoding="ISO-8859-1"?> 

      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:t="http://myfaces.apache.org/tomahawk">
<body>
<ui:composition template="/pages/template.jsp">
    
    <ui:define name="titulo">SIM - Importar CSV </ui:define>
    
    <ui:define name="body">
    
        <h:form id="formIncluirServico" enctype="multipart/form-data">
        <br/>
        <br/>

        <table>
            <tr>
                <td>
                    
                     <t:inputFileUpload id="fileupload"
                               value="#{ImportadorPagina.arquivo}"
                               memory="file"
                               required="true"/>
                </td>
            </tr>
        </table>        
            <h:commandButton id="cmdImportar" value="Importar" action="#{ImportadorPagina.importar}"/>
        </h:form>
    </ui:define>

</ui:composition>

</body>
</html>

My page after decode:
...
<td valign="top" colspan="2">
	<form id="formIncluirServico" method="post" action="/SIM/pages/importador/importar.jsf" enctype="multipart/form-data">
	<br />
	<br />
	<table>
		<tr>
			<td>
				<t:inputFileUpload id="fileupload" value="" memory="file" required="true"></t:inputFileUpload>
			</td>
		</tr>
	</table>
	<input id="formIncluirServico:cmdImportar" type="submit" name="formIncluirServico:cmdImportar" value="Importar" /> <input type="hidden" name="com.sun.faces.VIEW"
 value="H4sIAAAAAAAAAM1bS2wcSRkuT+zY8XqVxN68SJw4cbLJZifzftrJbvz2JOMkZBzD7h6Scnd73ElPd9Nd7ZlsRNgVAsGCEGgFAikIJA4gwUrA3jiB9oBYaUEEcVkJiQMSQuIhceFxWKiqfkx3T/VM2+M8fGi3e6r++v+vvv/7q2vKP/ob6NM1MMYptZhuyLE1yAl6zECiFFvWBKGCNINDhiY8t3Z49sjXb41FQG8ZDHDrosRrgozAvvJtuAHjpEN8StPg3bKoo8ky2MVJUNevwJqAwLDZRoJyNY4NinIVN9hJRkI6AiMuC4tQX1+CKv44IvKfAvdBpKFi70ZIC9MpZ4zGmw9Hv/VL+O0doKcEenXxdaGhAgB66734OqiTzoBe+/xPVQReJAYbVrA4dFWRcTCxdVSTYov4sqBBdV3kSjVYFXDzIUmpKktiVYMcVHymh6jpPY7p02zTN0oYCxz5jCIjKMqChpsO6huLUOPrUBOc7mc7eDaj1GpQ5suifAe37r0p8nmrL7kOW88Krme7zZEqgrYh8orma92HWydTrIdpn41n9Q08uCGLXBMFbw+/J/Sh35Vd2BWkaBhYRusUy5NUumF3HtA3ppC4oei+Sej3zK/desiKmlNuaBzLcIH1sOizstuxwgvXBZ7ldjrNepjxOdnT4qTTNN9w+VzCk64hiOfKeTro+KAzumcSDQTGOxBnXtFqhB01QTYctr3QodNVA6kGWhYayB4q6xp/2n6YbxspAtFwpJ42EFJk3P4ZrsZbKJgYvIwfDq/hCEoyJxmiZoGBwz6jaNUYvA0bmdv6WmxNw4JTV7Q79FFsCl9WRKF+XVFIALtublh/GFhTXqO6EyOqFLu6elvg0ORXf/3J7+zRX5AiAFAxiRhk8Cueu17nbgAr096mMlna1df/4S/e23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ynhCBOYDGZ8IbdumJR54uUKdvnF7FlwLGhWzdNgXqosgvkAKHPRQhhdsYxSkhwLVGezFfEw9RgEupjt8qta1nu5J16mRge+l+ezHd7LmbYD8y5NF4iZ8HnHejP3iqdNja2+mZsRhlRqhzJPmVgXM11+q5kGZ9pPbYBefxxcZcNaSETzidDECSHZacqaXHjqnGeE5JfRkOQJTA8zytCqzabPkxbuYoYnp88YC9Tm6VjSYZKpfz3bS+Q8JL6caOcLZQPdE54Iz4Yk45sB+6DmTGWlIwVmwXQABbLRTBsKuMfwzfuQfex2DH/Inmr1UWpGbpVAPUihpiebyccvhYf0FNg7fu+GbkBNVGLk9KGBOsJYADk2jMUE+c6lCaPPrg+6kQoUNfJ/FGMVoWpoUH7v+3CrCDZx29ERwYgXwUSS/F0lF5Gpv8g6QBxut+/A+D3DDHvlakxWasKCIWga9IBqHmEkUF4Ak0woU8kk2Rmj4xIkmSapzJqHzMnoM81Z9x2loufRzePSduo/OjiFDnDim8h4GCzPgOfcgUsKatm+bwI5CYqBQCaTWRaStsEmjFSP5jzJEzm7KeBCnMG24UoJMJErmtuxFlzsQ/vks8vejL5jlpCRmiEhUYUaitNDzzxErRnUVuRHt6I8pufpNPH3aKu/E65/RiBdLrl5OezmpfX/C8HqlCC7PM2i4ZPjTawXA072Y34Uo0X39mLwYD71GrBDtPjBPqHt/QQXfd1YrYmoyaH/A7ccCOxPNgAA" />
	<input type="hidden" name="formIncluirServico" value="formIncluirServico" />
	</form>
</td>
...

Thanks for attention!




      Abra sua conta no Yahoo! Mail, o único sem limite de espaço para armazenamento!
http://br.mail.yahoo.com/

Re: inputFileUpload dont decode!!

Posted by Song Jason <ja...@gmail.com>.
my changed DiskFileItem.java to let it correct decoding. related should be
change correspondly.


On 12/13/07, Song Jason <ja...@gmail.com> wrote:
>
> I knew commons-file-uploads really didn't decode correctly. It just
> support MIME contextType has a charset=xxx but not use the charactorEncoding
> of the request/response. DiskFileItem should be change to support.
>
> On 12/13/07, simon <si...@chello.at> wrote:
> >
> >
> > On Thu, 2007-12-13 at 10:29 -0800, Rogerio Eduardo Oliveira wrote:
> > > Hello All,
> > >
> > > Im new with JSF and tomahawk and dont know what could be happen with
> > my page. I put the tag <t:inputFileUpload> in my page and it dont appear.
> > Anyone already have this problem? I use the tomahawk.jar (versão 1.1.6)
> > and commons-fileuploader(1.2).
> >
> > To use tomahawk with facelets, you need to create and place in your
> > webapp an appropriate facelets taglib file.
> >
> > This is unfortunately not an easy process. See the myfaces wiki for more
> >
> > information; a link to the wiki can be found on the main myfaces
> > website.
> >
> > When facelets finds an xml tag in a page that it does *not* recognise as
> > a jsf tag, it just copies the data literally to the output. As you can
> > see, your html output contains an t:inputFileUpload tag. What should be
> > there is the html that a t:inputFileUpload component renderer generates,
> > but facelets doesn't realise that it should create and render a
> > component for this tag because there is no installed tomahawk taglib.
> >
> > And a web-browser always just ignores elements that it doesn't know
> > about, so the bad html output looks ok when rendered.
> >
> > Regards,
> >
> > Simon
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > For additional commands, e-mail: user-help@commons.apache.org
> >
> >
>

Re: inputFileUpload dont decode!!

Posted by Song Jason <ja...@gmail.com>.
I knew commons-file-uploads really didn't decode correctly. It just support
MIME contextType has a charset=xxx but not use the charactorEncoding of the
request/response. DiskFileItem should be change to support.

On 12/13/07, simon <si...@chello.at> wrote:
>
>
> On Thu, 2007-12-13 at 10:29 -0800, Rogerio Eduardo Oliveira wrote:
> > Hello All,
> >
> > Im new with JSF and tomahawk and dont know what could be happen with my
> page. I put the tag <t:inputFileUpload> in my page and it dont appear.
> Anyone already have this problem? I use the tomahawk.jar (versão 1.1.6)
> and commons-fileuploader(1.2).
>
> To use tomahawk with facelets, you need to create and place in your
> webapp an appropriate facelets taglib file.
>
> This is unfortunately not an easy process. See the myfaces wiki for more
> information; a link to the wiki can be found on the main myfaces
> website.
>
> When facelets finds an xml tag in a page that it does *not* recognise as
> a jsf tag, it just copies the data literally to the output. As you can
> see, your html output contains an t:inputFileUpload tag. What should be
> there is the html that a t:inputFileUpload component renderer generates,
> but facelets doesn't realise that it should create and render a
> component for this tag because there is no installed tomahawk taglib.
>
> And a web-browser always just ignores elements that it doesn't know
> about, so the bad html output looks ok when rendered.
>
> Regards,
>
> Simon
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

Re: inputFileUpload dont decode!!

Posted by simon <si...@chello.at>.
On Thu, 2007-12-13 at 10:29 -0800, Rogerio Eduardo Oliveira wrote:
> Hello All,
> 
> Im new with JSF and tomahawk and dont know what could be happen with my page. I put the tag <t:inputFileUpload> in my page and it dont appear. Anyone already have this problem? I use the tomahawk.jar (versão 1.1.6) and commons-fileuploader(1.2).

To use tomahawk with facelets, you need to create and place in your
webapp an appropriate facelets taglib file.

This is unfortunately not an easy process. See the myfaces wiki for more
information; a link to the wiki can be found on the main myfaces
website.

When facelets finds an xml tag in a page that it does *not* recognise as
a jsf tag, it just copies the data literally to the output. As you can
see, your html output contains an t:inputFileUpload tag. What should be
there is the html that a t:inputFileUpload component renderer generates,
but facelets doesn't realise that it should create and render a
component for this tag because there is no installed tomahawk taglib.

And a web-browser always just ignores elements that it doesn't know
about, so the bad html output looks ok when rendered.

Regards,

Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org