tutorials.de Buch-Aktion 05/2012
ERLEDIGT
NEIN
ANTWORTEN
1
ZUGRIFFE
895
EMPFEHLEN
  • An Twitter übertragen
  • An Facebook übertragen
AUF DIESES THEMA
ANTWORTEN
  1. #1
    eagle1985 eagle1985 ist offline Mitglied Silber
    Registriert seit
    May 2007
    Beiträge
    63
    Hallo zusammen,
    ich versuche mich gerade in JEE einzuarbeiten.

    Habe mit Netbeans ein MavenJEE-Project erstellt.

    Wenn ich mein erstes Test-Project auf den Glasfish-Server deploye erhalte ich folgende Fehlermeldung:

    /index.xhtml @18,94 value="#{loginView.customer.username}": The class 'view.beans.LoginManagedBean' does not have the property 'customer'.
    Hier mein index.xhtml
    HTML-Code:
    <?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"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core">
      <h:head>
        <title>JEE6-Test mit JSF</title>
      </h:head>
      <h:body>
        <p>
          <f:view>
            <h:form>
              <h:outputLabel value="Login"/><h:inputText value="#{loginView.customer.username}"/><br />
              <h:outputLabel value="Password"/><h:inputSecret value="#{loginView.customer.password}"/><br />
              <h:commandButton action="#{loginView.login()}" value="Login"/> <h:commandButton action="createCustomer" value="New Customer" />
            </h:form>
          </f:view>
        </p>
      </h:body>
    </html>
    und das ManagedBean
    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    
    @ManagedBean(name="loginView")
    @RequestScoped
    public class LoginManagedBean {
      
      private Customer customer;
     
      @EJB
      private UserControlSessionBean userControlSessionBean;
      
      /** Creates a new instance of LoginManagedBean */
      public LoginManagedBean() {
        customer = new Customer();
      }
      
      public boolean login(){
        if (userControlSessionBean.loginCustomer(customer) != null)
          return true;
        return false;
      }
      
      public boolean createNewUser(){
        
        if (userControlSessionBean.newCustomer(customer) != null)
          return true;
        return false;
      }
     
      public Customer getCustomer() {
        return customer;
      }
     
      public void setCustomer(Customer customer) {
        this.customer = customer;
      }
      
      
    }

    hat jemand eine Ahnung was hier schieflauft und wiso Glasfish das Property nicht findet?

    Besten Dank für eure Hilfe
     

  2. #2
    enrix enrix ist offline Mitglied Silber
    Registriert seit
    May 2009
    Beiträge
    69
    Benutzt du vielleicht als import javax.enterprise.context.RequestScoped statt javax.faces.bean.RequestScoped ?
     

Ähnliche Themen

  1. JSP mit JSTL findet Property nicht
    Von wakoz im Forum Enterprise Java (JEE, J2EE, Spring & Co.)
    Antworten: 8
    Letzter Beitrag: 08.04.10, 15:31
  2. RectF property nicht zugreifbar
    Von SpongeStone im Forum .NET Windows Forms
    Antworten: 6
    Letzter Beitrag: 04.02.09, 22:26
  3. Property Datei nicht überschreiben
    Von BetaRR400 im Forum Java
    Antworten: 3
    Letzter Beitrag: 18.09.08, 12:16
  4. JSF-Frage: Attribute einer ManagedBean in einer anderen Managedbean lesen
    Von navino im Forum Enterprise Java (JEE, J2EE, Spring & Co.)
    Antworten: 0
    Letzter Beitrag: 21.04.08, 08:57
  5. Antworten: 2
    Letzter Beitrag: 29.03.05, 19:14

Stichworte