mercredi 27 mai 2015

JSP Method not found: class java.lang.String

I have this exception andd i can't find a solution

COntroller :

@RequestMapping(value="/sujet")
    public String detail(Model model, HttpServletRequest request, Long idSujet) {
        Utilisateur user = (Utilisateur) request.getSession().getAttribute("user");
        model.addAttribute("nbrMails", metierUtilisateur.listDesEmailsRecuNonLu(user.getIdUtilisateur()).size());

        SujetForum sujet = metierSujetForum.findById(idSujet);
        sujet.setMessagesForums(metierSujetForum.getListMessageForum(idSujet));

        model.addAttribute("sujet", sujet);
        model.addAttribute("messages", metierSujetForum.getListMessageForum(idSujet));


        return "/coordinateur/detailSujetForum";
    }

this is my Bean definition : i defined all the getters and setters for all attributes but is till get the same exception

@Entity
public class MessagesForum implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long idMessage;
    private String message;
    private Date dateDepotMessage;
    private boolean messageCorrecte;

    @ManyToOne
    @JoinColumn(name = "idSujet")
    private SujetForum sujetForum;

    @ManyToOne
    @JoinColumn(name = "idUtilisateur")
    private Utilisateur utilisateur;

    @OneToMany(mappedBy = "messageForum")
    private Collection<PieceJointeForum> pieceJointeForums;

    public MessagesForum(String message, Date dateDepotMessage, boolean messageCorrecte) {
        super();
        this.message = message;
        this.dateDepotMessage = dateDepotMessage;
        this.messageCorrecte = messageCorrecte;
    }

    public MessagesForum() {
        super();
    }

    public Long getIdMessage() {
        return idMessage;
    }

    public void setIdMessage(Long idMessage) {
        this.idMessage = idMessage;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Date getDateDepotMessage() {
        return dateDepotMessage;
    }

    public void setDateDepotMessage(Date dateDepotMessage) {
        this.dateDepotMessage = dateDepotMessage;
    }

    public boolean isMessageCorrecte() {
        return messageCorrecte;
    }

    public void setMessageCorrecte(boolean messageCorrecte) {
        this.messageCorrecte = messageCorrecte;
    }

    public SujetForum getSujetForum() {
        return sujetForum;
    }

    public void setSujetForum(SujetForum sujetForum) {
        this.sujetForum = sujetForum;
    }

    public Utilisateur getUtilisateur() {
        return utilisateur;
    }

    public void setUtilisateur(Utilisateur utilisateur) {
        this.utilisateur = utilisateur;
    }

    public Collection<PieceJointeForum> getPieceJointeForums() {
        return pieceJointeForums;
    }

    public void setPieceJointeForums(Collection<PieceJointeForum> pieceJointeForums) {
        this.pieceJointeForums = pieceJointeForums;
    }

}

this is the output of the exception

615:                 <div class="media-body">
616:                   <div class="media-text">
617:                     <h5 class="semibold mt0 mb5 text-accent"></h5>
618:                     <p class="mb5">${msg.getIdMessage() }.</p>
619:                     <!-- meta icon -->
620:                     <p class="mb0">
621:                       <span class="media-meta"></span> <span class="mr5 ml5 text-muted">*</span> <a href="javascript:void(0);" class="media-meta text-default" data-t
oggle="tooltip" title="" data-original-title="Reply"><i class="ico-reply"></i></a>


Stacktrace:] with root cause
javax.el.MethodNotFoundException: Method not found: class java.lang.String.getIdMessage()
    at javax.el.Util.findWrapper(Util.java:352)
    at javax.el.Util.findMethod(Util.java:214)
    at javax.el.BeanELResolver.invoke(BeanELResolver.java:174)
    at org.apache.jasper.el.JasperELResolver.invoke(JasperELResolver.java:139)
    at org.apache.el.parser.AstValue.getValue(AstValue.java:173)
    at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
    at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:967)
    at org.apache.jsp.WEB_002dINF.views.coordinateur.detailSujetForum_jsp._jspx_meth_c_005fforEach_005f0(detailSujetForum_jsp.java:1242)
    at org.apache.jsp.WEB_002dINF.views.coordinateur.detailSujetForum_jsp._jspService(detailSujetForum_jsp.java:832)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)

Aucun commentaire:

Enregistrer un commentaire