hi,

you need to use TRINIDAD's UploadedFile in your backing bean:
http://myfaces.apache.org/trinidad/trinidad-api/apidocs/org/apache/myfaces/trinidad/model/UploadedFile.html

Not the one from Tomahawk (org.apache.myfaces.custom.fileupload.UploadedFile).

Yes, JavaEE is a cool thing... no common upload api...
so every framework has to do its soup ...

sorry for the inconvenience.

-Matthias

On Tue, Dec 16, 2008 at 8:10 PM, Álvaro Blázquez <[email protected]> wrote:
> Dear support team,
>
>
>
> I got an exception  (Cannot convert
> org.apache.myfaces.trinidadinternal.config.upload.uploadedfiles$fixfilen...@15e3d24a
> of type class
> org.apache.myfaces.trinidadinternal.config.upload.UploadedFiles$FixFilename
> to interface org.apache.myfaces.custom.fileupload.UploadedFile
>
> ) when trying to upload a file using the inputFile tag from trinidad.
>
>
>
> I'm using MyFaces 1.2.5 and Trinidad 1.2.10.  under Apache Tomcat v6.0. See
> the attached files for more info about project config.
>
>
>
> This error occurs when I click on the upload button. The error message
> appears in the inputFile tag, below the input element, it looks like
> Trinidad API is catching the exception. This is the related jsp code:
>
>
>
>                         <tr:form usesUpload="true" >
>
>                               <f:verbatim><strong>Carga de Datos del
> indicador </strong></f:verbatim><h:outputLabel for="selectone_data"
> value="#{addIndicatorBean.dataName}" styleClass="txtRojo"
> style="font-weight:bold"/>
>
>                               <h:panelGroup style="font-size: medium;
> border: none; padding: 0px">
>
>                                    <tr:inputFile label="Selección de
> Fichero: " value="#{addIndicatorBean.uploadedFile}" />
>
>                               </h:panelGroup>
>
>                               <tr:commandButton text="Iniciar Carga de
> Datos" action="#{addIndicatorBean.loadDataFromFile}"
> styleClass="inputButton" />
>
>                         </tr:form>
>
>
>
>
>
> This is the related Managed Bean code:
>
>
>
>       /** */
>
>       public UploadedFile getUploadedFile() {
>
>             return uploadedFile;
>
>       }
>
>
>
>       /** */
>
>       public void setUploadedFile(UploadedFile uploadedFile) {
>
>             this.uploadedFile = uploadedFile;
>
>       }
>
>
>
>       /** */
>
>       public String loadDataFromFile() {
>
>             MasterValuesLoader loader;
>
>             UploadedFile file;
>
>
>
>             file = getUploadedFile();
>
>             //quitar el && false para que entre en el if
>
>             if ((focusedData != null) && (file != null) /*&& false*/) {
>
>                   try {
>
>                         loader = new MasterValuesLoader("iecisa_v2");
>
>
> loader.loadFromFileToMasterValues(focusedData.getValue(),
> file.getInputStream(), "VALORES");
>
>                   } catch(IOException e) {
>
>                   }
>
> }
>
> }
>
>
>
>
>
> And this is the error message:
>
>
>
> Cannot convert
> org.apache.myfaces.trinidadinternal.config.upload.uploadedfiles$fixfilen...@15e3d24a
> of type class
> org.apache.myfaces.trinidadinternal.config.upload.UploadedFiles$FixFilename
> to interface org.apache.myfaces.custom.fileupload.UploadedFile
>
>
>
> I don't have idea what can be happening… May you help me? I would be very
> thankful to you.
>
>
>
> Best Regards and thanks in advance,
>
>
>
>
>
> Álvaro Blázquez_Departamento de Desarrollo
>
> e-mail: [email protected]
>
>
>
> TUENT TELECOMUNICACIONES S.L.
> C/ Marie Curie, 19 [Parque Empresarial Rivas-Futura]
> 28529 - Rivas-Vaciamadrid
>
> www.tuent.com
> Tlf: 91 187 79 88
> Fax: 91 499 98 10
>
>
>
> __________ Información de ESET NOD32 Antivirus, versión de la base de firmas
> de virus 3683 (20081211) __________
>
> ESET NOD32 Antivirus ha comprobado este mensaje.
> http://www.eset.com
>



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf

Reply via email to