2 Replies Latest reply on Feb 27, 2013 7:31 AM by gimbal2

    not able to initialize property of java class inside managed bean

      This is JSF 2.0 project ,eclipse Juno
      BeanName.java file

      import javax.faces.bean.ManagedBean;
      import javax.faces.bean.SessionScoped;

      public class OrderHeaderBean {
           private String rmaNumber="String";
           private String orderReferenceNumber="Sc-15B-CC";
           private String status="Issued Fully Received";
           private String dateRequested="2011-01-07";
           private String dateApproved="2011-01-20";
           Address shipProductTo = new Address();
           private Address billingAddress=new Address();
           private Address shippingAddress=new Address();
           private int returnForCredit[]={11,22,33,44,55};

           private int returnForExchange[]={01,02,03,04,05};
           shipProductTo.name=""; //error here

      here i am trying to initialize name property of Address class(normal java) ,which is as below

      public class Address {
           public String name;
           public String address1;
           public String address2;
           public String city;
           public String state;
           public int zipcode;
           public String country;

      error is "Syntax error on token "name", VariableDeclaratorId expected after this token"