0

I am developing a web application using hibernate spring and JSF on eclipse I have created page:ReclamationList.jsp to list all reclamations
I get an error when I submit my form on first page the code.

This is my page :

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
  <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
  <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
  <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
  <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title> Liste des reclamations</title>
</head>
<body>
<f:view>
<h:form id="mainForm">
<rich:scrollableDataTable id="reclamationTable" binding="#{reclamationBean.reclamationTable}" value="#{reclamationBean.reclamationList}" 
var="reclamation" width="300px" height="200px">
<rich:column id="objet" width="60px">
<f:facet name="header"><h:outputText value="objet"/> </f:facet>
<h:outputText value="#{reclamation.objet}"/>
</rich:column>
<rich:column id="dateCreation" width="60px">
<f:facet name="header"><h:outputText value="dateCreation"/> </f:facet>
<h:outputText value="#{reclamation.dateCreation}"/>
</rich:column>
<rich:column id="priorité" width="60px">
<f:facet name="header"><h:outputText value="priorité"/> </f:facet>
<h:outputText value="#{reclamation.priorité}"/>
</rich:column>



</rich:scrollableDataTable>
</h:form>

</f:view>

</body>
</html>

my class bean is ReclamationBean.java:

package web;

import java.io.Serializable;


import java.util.List;

import javax.annotation.PostConstruct;

import org.richfaces.component.html.HtmlScrollableDataTable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import DAO.Reclamation;
import service.ReclamationService;


@Component("reclamationBean") 
@Scope("session")
public class ReclamationBean implements Serializable {


    @Autowired
    private List<Reclamation> reclamationList;
    private transient ReclamationService reclamationService;
    private transient HtmlScrollableDataTable reclamationTable;

    public List<Reclamation> getReclamationList() {
        return reclamationList;
    }
    public void setReclamationList(List<Reclamation> reclamationList) {
        this.reclamationList = reclamationList;
    }
    public HtmlScrollableDataTable getReclamationTable() {
        return reclamationTable;
    }
    public void setReclamationTable(HtmlScrollableDataTable reclamationTable) {
        this.reclamationTable = reclamationTable;
    }


}

This is the error which I got when I submit my page:

org.apache.jasper.JasperException: javax.faces.FacesException: javax.faces.el.PropertyNotFoundException: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'reclamationBean' resolved to null
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • It seems that you are not loading your application context. Do you have the Spring Dispatcher servlet configured in your web.xml? – DwB Aug 22 '13 at 16:03
  • yeh in web.xml i have this ligne: contextConfigLocation classpath:application-context.xml – user2664235 Aug 22 '13 at 22:39
  • add your entire web.xml to the question please. the part you listed will not start spring, it just configures the location of the config location. – DwB Aug 23 '13 at 15:09
  • org.springframework.web.context.ContextLoaderListener org.springframework.web.context.request.RequestContextListener contextConfigLocation classpath:application-context.xml – user2664235 Aug 23 '13 at 15:48
  • Faces Servlet javax.faces.webapp.FacesServlet Faces Servlet *.jsf RichFaces Filter org.ajax4jsf.Filter RichFaces Filter Faces Servlet – user2664235 Aug 23 '13 at 15:49
  • This may be a silly question, but do you have a list of Reclimation objects configured in spring? – DwB Aug 23 '13 at 15:59
  • application-context.xml: DAO.Action DAO.Etat DAO.EtatSuivi DAO.Reclamation DAO.TypeAction DAO.Utilisateur org.hibernate.dialect.MySQLInnoDBDialect – user2664235 Aug 23 '13 at 17:24

1 Answers1

1

Change your managed bean class to like this way

@ManagedBean(name ="reclamationBean")
@SessionScoped
public class ReclamationBean implements Serializable {
}