Help Class,
Can anyone help with lab 4006?  I don't know why First and Last names were not 
displaying.

I have this codes in Name Class.

package org.apache.taglibs.standard.examples.beans;

public class Name {
    
    private String firstName;
    private String lastName;

    public String getFirstName() {
        return firstName;
    }
    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }
    public String getLastName() {
        return lastName;
    }
    public void setLastName(String lastName) {
        this.lastName = lastName;
    }
}

---------------------------------------------------------
I have this codes in Person Class.

package org.apache.taglibs.standard.examples.beans;

public class Person {

    private Name name;

    public Name getName() {
        return name;
    }
    public void setName(Name name) {
        this.name = name;
    }
}

---------------------------------------------------------
I placed this code at the end of Init.

 import org.apache.taglibs.standard.examples.beans.*;
        Name name = new Name();
        name.setFirstName("Emmanuel");
        name.setLastName("Faneye");

        Person person = new Person();
        person.setName(name);

        sce.getServletContext().setAttribute("person", person);

---------------------------------------------------------

This code goes to the end of reponse.

  <jsp:useBean id="person" scope="session" 
class="org.apache.taglibs.standard.examples.beans.Person" />
        <jsp:setProperty name="person" property="*"  />
        <br>
        <br>

        <table border="1">
            <c:forEach var="person" items="${persons}">
              <tr>
                <td><c:out value="${person.name.firstName}"/> </td>
                <td><c:out value="${person.name.lastName}"/> </td>
              </tr>
           </c:forEach>
        </table>


Thanks for any help.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to