facebook

JSF New – missing somthing

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #275039 Reply

    Michaelcford
    Member

    So I did the tutorals, thought I understood it all but.
    I did a very basic datatable using hibernate and it fails, I missied somthing.

    Error:
    javax.servlet.ServletException: An exception occurred processing JSP page /listnames.jsp at line 30

    27:
    28: <body>
    29: <f:view>
    30: <h:dataTable border=”1″ id=”JsfTable” rows=”10″
    31: value=”#{Index.names}”
    32: var=”idx” binding=”#{Index.data}”>
    33: <h:column id=”column1″>

    JSF Table:
    <body>
    <f:view>
    <h:dataTable border=”1″ id=”JsfTable” rows=”10″
    value=”#{Index.names}”
    var=”idx” binding=”#{Index.data}”>
    <h:column id=”column1″>
    <f:facet name=”header”>
    <h:outputText value=”ID” />
    </f:facet>
    <h:outputText value=”#{idx.id}” />
    </h:column>
    <h:column id=”column2″>
    <f:facet name=”header”>
    <h:outputText value=”Name”></h:outputText>
    </f:facet>
    <h:outputText value=”#{idx.name}”/>
    </h:column>
    </h:dataTable>
    <br>
    </f:view>
    </body>

    Managed Bean:
    public class index {
    public index() {

    }
    private UIData data = null;
    Collection names;

    //Property getters – setters

    public void setData(UIData data)
    {
    this.data = data;
    }

    public UIData getData()
    {
    return data;
    }
    public Collection getNames(){

    TestDAO dao = new TestDAO();
    try {
    names = dao.findAll();

    } catch (HibernateException e) {
    System.err.println(“Entity retrieval failed.”);
    e.printStackTrace();
    } finally {
    try {
    dao.getSession().close();
    } catch (Exception e) {
    // do nothing
    }
    }
    return names;
    }
    public void setBooks(Collection names) {
    this.names = names;
    }
    }
    ——————————-
    I see it call to the constructor, but then fails, I expected it to call getNames.
    Worked struts for a while, but still not getting somthing here.

    Any help would be wonderful.

    #275044 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev

    try and use either value or binding, but not both…

    #275279 Reply

    All I saw was that MyEclipse 6 supported JSF 1.1 but I did not see JSF 1.2. Did I miss something and if not is there a short answer to why JSF 1.2 is not supported.

    #275296 Reply

    I created a new project and saw that I could use JSF 1.2. Since I upgraded to MyEclipse 6.0 and kept the projects from my previous version, is there a way for me to see what jsf settings I used in an existing project, or does it just use whatever jsf jar files are in my build properties. Since I want to use JSF 1.2 if my original project specified JSF 1.1 do I need to do anything other than make sure the new JSF 1.2 jar files are in my classpath.

    #275385 Reply

    Riyad Kalla
    Member

    MyEclipse does support JSF 1.2, but it’s part of the Java EE 5 spec now, so any Java EE 5-spec project will automatically use JSF 1.2. If you want to use JSF 1.2, you should make sure your project is a Java EE 5 project.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: JSF New – missing somthing

You must be logged in to post in the forum log in