IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JSF Java Discussion :

Upload image : type=file


Sujet :

JSF Java

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    136
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 136
    Points : 66
    Points
    66
    Par défaut Upload image : type=file
    Bonjour

    Peut-on en jsf utilisé un champ comme en html : <input type="file"> pour uploader une image ??

  2. #2
    Inactif  
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    2 189
    Détails du profil
    Informations personnelles :
    Âge : 43
    Localisation : Suisse

    Informations forums :
    Inscription : Mai 2006
    Messages : 2 189
    Points : 2 336
    Points
    2 336
    Par défaut
    oui tu as un composant <t:inputFileUpload fait pour ca

  3. #3
    Membre du Club
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    136
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 136
    Points : 66
    Points
    66
    Par défaut
    <t:inputFileUpload !! c'est une balise jsf ??

  4. #4
    Inactif  
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    2 189
    Détails du profil
    Informations personnelles :
    Âge : 43
    Localisation : Suisse

    Informations forums :
    Inscription : Mai 2006
    Messages : 2 189
    Points : 2 336
    Points
    2 336
    Par défaut
    tomahawk pour etre exact

  5. #5
    Membre du Club
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    136
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 136
    Points : 66
    Points
    66
    Par défaut
    comment peut-on utilisé cette balise dans ma page ??

    question idiote mais je débute en jsf, c'est ma premiere semaine et je suis un peux perdu lol

  6. #6
    Inactif  
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    2 189
    Détails du profil
    Informations personnelles :
    Âge : 43
    Localisation : Suisse

    Informations forums :
    Inscription : Mai 2006
    Messages : 2 189
    Points : 2 336
    Points
    2 336
    Par défaut
    il faut importer la taglib

    <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>

    et pour l utilisation va voir ici http://wiki.apache.org/myfaces/Setup_For_File_Uploads

  7. #7
    Membre du Club
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    136
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 136
    Points : 66
    Points
    66
    Par défaut
    je trouve pas ou téléchargé tomahawk.jar !!

  8. #8
    Membre confirmé
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    511
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 511
    Points : 514
    Points
    514
    Par défaut
    Ici pour le download

    http://myfaces.apache.org/download.html

    Mais faut aussi que tu es l'implémentation d'apache. Je ne pense pas que tomahawk marche avec celle de sun.

  9. #9
    Membre du Club
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    136
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 136
    Points : 66
    Points
    66
    Par défaut
    ou faut-il mettre "tomahawk-1.1.3.jar" et comment configuré ça dans le web.xml ??

    erreur :
    The absolute uri: http://myfaces.apache.org/tomahawk cannot be resolved in either web.xml or the jar files deployed with this application

  10. #10
    Inactif  
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    2 189
    Détails du profil
    Informations personnelles :
    Âge : 43
    Localisation : Suisse

    Informations forums :
    Inscription : Mai 2006
    Messages : 2 189
    Points : 2 336
    Points
    2 336
    Par défaut
    Il faut mettre le jar dans ton WEB-INF directory la ou se trouve tes autres librairies

    pour le web.xml tu n as rien besoin de modifier

  11. #11
    Membre du Club
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    136
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 136
    Points : 66
    Points
    66
    Par défaut
    euhhh encore une erreur !!

    quand je met mon formulaire de cette façon :
    <h:form enctype="multipart/form-data">

    les méthode ne sont plus appelé , y'a que la méthode postConstruct qui est appelé !!!

  12. #12
    Membre du Club
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    136
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 136
    Points : 66
    Points
    66
    Par défaut
    maintenant il me sort une execption : NoClassDefFoundError quand il passe sur getMyUploadedFile() !!!

    quel qu'un à une idée ???

  13. #13
    Membre confirmé
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    511
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 511
    Points : 514
    Points
    514
    Par défaut
    Il trouve pas ta classe ou ta fonction....

  14. #14
    Membre du Club
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    136
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 136
    Points : 66
    Points
    66
    Par défaut
    j'imagine bien mais j'ai suivi cet exemple :
    http://wiki.apache.org/myfaces/Setup_For_File_Uploads

    pour mettre en place un inputFileUpload, mais ça mache pas !!

    si je met mon formulaire de cette façon :
    <h:form enctype="multipart/form-data">
    il passe pas dans ma methode saveDescription

    <h:commandLink action="#{monController.saveDescription}" value="Enregistrer" ></h:commandLink>

    et si je met le formulaire de cette façon <h:form>
    il passe mais ne trouve pas myUploadedFile !!!

  15. #15
    Inactif  
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    2 189
    Détails du profil
    Informations personnelles :
    Âge : 43
    Localisation : Suisse

    Informations forums :
    Inscription : Mai 2006
    Messages : 2 189
    Points : 2 336
    Points
    2 336
    Par défaut
    et si tu changes le commandLink en commandButton ?

  16. #16
    Membre du Club
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    136
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 136
    Points : 66
    Points
    66
    Par défaut
    c'est pareil, j'ai deja testé ça ...

    le <h:commandLink> sert surtout pour l'appliquer à une image par la suite

Discussions similaires

  1. DnD upload d'image (input type "file")
    Par lolalilo dans le forum Général JavaScript
    Réponses: 19
    Dernier message: 24/05/2013, 11h26
  2. Upload Image et Input Type File
    Par skyline86 dans le forum Langage
    Réponses: 3
    Dernier message: 23/05/2009, 21h27
  3. [Upload] 2 type file pour 1 upload
    Par flydragon dans le forum Langage
    Réponses: 4
    Dernier message: 10/05/2006, 09h29
  4. [Javascript] UPLOAD FICHIER(avc code de modif du txt dun iput type file)
    Par genjikun dans le forum Général JavaScript
    Réponses: 9
    Dernier message: 01/02/2006, 16h05
  5. aperçu d image avec input type file marche pas dans ffx
    Par siddh dans le forum Général JavaScript
    Réponses: 4
    Dernier message: 09/11/2005, 09h11

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo