0 Replies Latest reply on Jul 30, 2007 4:02 AM by yohann Normandin

    problem when I want to persist data

    yohann Normandin Newbie

      Hi !!

      I want to persist data in my database. However I have an error :

      Exception during request processing: javax.servlet.ServletException: /abonnement_contact.xhtml @17,68 value="#{contact.firstName}": Target Unreachable, identifier 'contact' resolved to null

      Here is my ContactManager :
      public class ContactManager implements com.pingwy.web.front.ContactManagerLocal, Serializable{
       private EntityManager em;
       @In (create = true, required = true) @Out
       private Contact contact;
       @In @Out (required = false)
       Contact currentContact;
       public String updateContact(){
       return null;
       public String removeContact (){
       System.out.println("contact bientot supprimé");
       return null;
       public String createContact(Contact c){
       contact = c;
       return null;
       @Remove @Destroy
       public void destroy(){
       public Contact getContact() {
       return contact;
       public void setContact(Contact contact) {
       this.contact = contact;

      and my page :
      <?xml version='1.0' encoding='UTF-8' ?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       <ui:composition template="templates/client.xhtml">
       <ui:define name="servicesclients">
       <h:panelGrid columns="2">
       <h:outputLabel value="FirstName :"/>
       <h:inputText value="#{contact.firstName}"/>
       <h:outputLabel value="LastName :"/>
       <h:inputText value="#{contact.lastName}"/>
       <h:outputLabel value="Phone :"/>
       <h:inputText value="#{contact.phone}"/>
       <h:outputLabel value="Other Phone :"/>
       <h:inputText value="#{contact.otherPhone}"/>
       <h:outputLabel value="Mail :"/>
       <h:inputText value="#{contact.mail}"/>
       <h:outputLabel value="Username :"/>
       <h:inputText value="#{contact.username}"/>
       <h:outputLabel value="Password :"/>
       <h:inputText value="#{contact.password}"/>
       <h:outputLabel value="Fax :"/>
       <h:inputText value="#{contact.fax}"/>
       <h:outputLabel value="Position :"/>
       <h:inputText value="#{contact.position}"/>
       <h:commandButton id="change" value="Change" action="#{ContactManager.createContact(contact)}"/>

      thanks in advance