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

D�veloppement Web en Java Discussion :

Erreure "map is not generic; it cannot be parameterized with arguments <string, object>"


Sujet :

D�veloppement Web en Java

Vue hybride

Message pr�c�dent Message pr�c�dent   Message suivant Message suivant
  1. #1
    Membre averti
    Homme Profil pro
    �tudiant
    Inscrit en
    Avril 2011
    Messages
    14
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activit� : �tudiant

    Informations forums :
    Inscription : Avril 2011
    Messages : 14
    Par d�faut Erreure "map is not generic; it cannot be parameterized with arguments <string, object>"
    bonjour;
    je suis entrain de developpez une petite application jee hibernate spring
    j'ai une erreur
    "the type map is not generic; it cannot be parameterized with arguments <string, object>"

    pour "Map<String, Object> model = new HashMap<String, Object>();"


    est ce que pouvez m'aider?
    voila la classe articlecontroleur qui contient l'erreur




    package com.bd.controleur;

    import java.util.HashMap;

    import javax.servlet.http.HttpServletRequest;


    import org.apache.xpath.operations.String;
    import org.hibernate.mapping.Map;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Controller;
    import org.springframework.ui.ModelMap;
    import org.springframework.validation.BindingResult;
    import org.springframework.web.bind.annotation.ModelAttribute;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestMethod;
    import org.springframework.web.servlet.ModelAndView;

    import com.bd.entity.Article;
    import com.bd.service.ArticleService;


    @Controller
    @RequestMapping("/Article/GererArticle")
    public class ArticleControleur {

    @Autowired
    private ArticleService articleService;

    @RequestMapping(method = RequestMethod.GET)
    public ModelAndView listAricle(){


    Map<String, Object> model = new HashMap<String, Object>();
    model.put("articles", articleService.getAllArticles());


    //new ModelAndView("nom de la page jsp", model qui contient l'ensemble des beans que tu vas passer a cette page)
    return new ModelAndView("GererArticle", model);

    }
    //formulaire vide d'ajout d'un event
    @RequestMapping("/articleAdd")
    public ModelAndView addArticle(@ModelAttribute(value="article") Article article,
    HttpServletRequest request,
    ModelMap modelMap) {

    Map<String, Object> model = new HashMap<String, Object>();


    model.put("articles", article);
    return new ModelAndView("articleAdd", model);
    }

    //enregistrer le formulaire
    @RequestMapping(value = "/save", method = RequestMethod.POST)
    public ModelAndView saveArticle(@ModelAttribute("article") Article article,BindingResult result) {



    if (result.hasErrors()) {
    Map<String, Object> model = new HashMap<String, Object>();
    String a="existe deja";
    model.put("existe",a);
    model.put("article", article);
    return new ModelAndView("articleAdd",model);
    } else {


    articleService.saveArticle(article);}






    }
    }

  2. #2
    Membre �m�rite
    Avatar de bpy1401
    Homme Profil pro
    Ing�nieur d�veloppement logiciels
    Inscrit en
    Mars 2003
    Messages
    511
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 64
    Localisation : France, Eure (Haute Normandie)

    Informations professionnelles :
    Activit� : Ing�nieur d�veloppement logiciels
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2003
    Messages : 511
    Par d�faut
    Bonjour

    Peut tu nous donner la version de JAVA que tu utilise

    merci

  3. #3
    Membre averti
    Homme Profil pro
    �tudiant
    Inscrit en
    Avril 2011
    Messages
    14
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activit� : �tudiant

    Informations forums :
    Inscription : Avril 2011
    Messages : 14
    Par d�faut
    la version est jre7 et jdk 1.7.0

    merci

  4. #4
    Membre �prouv� Avatar de +Guilhem
    Profil pro
    Ing�nieur d'�tudes Java/JEE
    Inscrit en
    Novembre 2007
    Messages
    78
    D�tails du profil
    Informations personnelles :
    �ge : 37
    Localisation : France, Alpes Maritimes (Provence Alpes C�te d'Azur)

    Informations professionnelles :
    Activit� : Ing�nieur d'�tudes Java/JEE

    Informations forums :
    Inscription : Novembre 2007
    Messages : 78
    Par d�faut
    Tu fais un import de la mauvaise classe.

    Replace
    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    import org.hibernate.mapping.Map;
    par

  5. #5
    Membre averti
    Homme Profil pro
    �tudiant
    Inscrit en
    Avril 2011
    Messages
    14
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activit� : �tudiant

    Informations forums :
    Inscription : Avril 2011
    Messages : 14
    Par d�faut
    j'ai essayer de changer cet import mais il m'apparait un autre erreur pour



    model.put("articles", articleService.getAllArticles());

    return new ModelAndView("GererArticle", model);




    merci

  6. #6
    Membre averti
    Homme Profil pro
    �tudiant
    Inscrit en
    Avril 2011
    Messages
    14
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activit� : �tudiant

    Informations forums :
    Inscription : Avril 2011
    Messages : 14
    Par d�faut
    Citation Envoy� par achref05 Voir le message
    j'ai essayer de changer cet import mais il m'apparait un autre erreur pour



    model.put("articles", articleService.getAllArticles());

    return new ModelAndView("GererArticle", model);




    merci
    l'erreur est
    the methode put(string, object) in the type map<string, object> is not applicate for the argument (string, liste<Article>)

Discussions similaires

  1. Erreur "ArrayList is not generic"
    Par Bobette dans le forum Servlets/JSP
    R�ponses: 12
    Dernier message: 03/04/2012, 12h42
  2. [OpenLayers] �tendre de la class Map donne l'erreur this.registerEvents is not a function dans Firebug
    Par lermit dans le forum SIG : Syst�me d'information G�ographique
    R�ponses: 0
    Dernier message: 09/08/2010, 15h48
  3. it cannot be parameterized with arguments
    Par MacReiben dans le forum Hibernate
    R�ponses: 4
    Dernier message: 10/07/2006, 15h29
  4. Utilisation javah --> Erreur : Class XXXX could not be fo
    Par vano dans le forum G�n�ral Java
    R�ponses: 6
    Dernier message: 09/05/2005, 21h32
  5. [Dev-Pascal] Erreur "Unit Graph could not be compiled"
    Par marc26 dans le forum Autres IDE
    R�ponses: 3
    Dernier message: 03/02/2005, 07h28

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